Skip to content

Commit 3e30a93

Browse files
sync with cpython 94ad6826
1 parent 05b6b65 commit 3e30a93

File tree

3 files changed

+132
-141
lines changed

3 files changed

+132
-141
lines changed

c-api/import.po

Lines changed: 55 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.12\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2023-12-07 00:03+0000\n"
11+
"POT-Creation-Date: 2024-02-06 00:03+0000\n"
1212
"PO-Revision-Date: 2018-05-23 14:06+0000\n"
1313
"Last-Translator: Adrian Liaw <[email protected]>\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -25,73 +25,60 @@ msgstr "引入模組"
2525

2626
#: ../../c-api/import.rst:16
2727
msgid ""
28-
"This is a simplified interface to :c:func:`PyImport_ImportModuleEx` below, "
29-
"leaving the *globals* and *locals* arguments set to ``NULL`` and *level* set "
30-
"to 0. When the *name* argument contains a dot (when it specifies a "
31-
"submodule of a package), the *fromlist* argument is set to the list "
32-
"``['*']`` so that the return value is the named module rather than the top-"
33-
"level package containing it as would otherwise be the case. (Unfortunately, "
34-
"this has an additional side effect when *name* in fact specifies a "
35-
"subpackage instead of a submodule: the submodules specified in the package's "
36-
"``__all__`` variable are loaded.) Return a new reference to the imported "
37-
"module, or ``NULL`` with an exception set on failure. A failing import of a "
38-
"module doesn't leave the module in :data:`sys.modules`."
28+
"This is a wrapper around :c:func:`PyImport_Import()` which takes a :c:expr:"
29+
"`const char *` as an argument instead of a :c:expr:`PyObject *`."
3930
msgstr ""
4031

41-
#: ../../c-api/import.rst:28 ../../c-api/import.rst:89
42-
msgid "This function always uses absolute imports."
43-
msgstr ""
44-
45-
#: ../../c-api/import.rst:33
32+
#: ../../c-api/import.rst:21
4633
msgid "This function is a deprecated alias of :c:func:`PyImport_ImportModule`."
4734
msgstr ""
4835

49-
#: ../../c-api/import.rst:35
36+
#: ../../c-api/import.rst:23
5037
msgid ""
5138
"This function used to fail immediately when the import lock was held by "
5239
"another thread. In Python 3.3 though, the locking scheme switched to per-"
5340
"module locks for most purposes, so this function's special behaviour isn't "
5441
"needed anymore."
5542
msgstr ""
5643

57-
#: ../../c-api/import.rst:46
44+
#: ../../c-api/import.rst:34
5845
msgid ""
5946
"Import a module. This is best described by referring to the built-in Python "
6047
"function :func:`__import__`."
6148
msgstr ""
6249

63-
#: ../../c-api/import.rst:49 ../../c-api/import.rst:65
50+
#: ../../c-api/import.rst:37 ../../c-api/import.rst:53
6451
msgid ""
6552
"The return value is a new reference to the imported module or top-level "
6653
"package, or ``NULL`` with an exception set on failure. Like for :func:"
6754
"`__import__`, the return value when a submodule of a package was requested "
6855
"is normally the top-level package, unless a non-empty *fromlist* was given."
6956
msgstr ""
7057

71-
#: ../../c-api/import.rst:55
58+
#: ../../c-api/import.rst:43
7259
msgid ""
7360
"Failing imports remove incomplete module objects, like with :c:func:"
7461
"`PyImport_ImportModule`."
7562
msgstr ""
7663

77-
#: ../../c-api/import.rst:61
64+
#: ../../c-api/import.rst:49
7865
msgid ""
7966
"Import a module. This is best described by referring to the built-in Python "
8067
"function :func:`__import__`, as the standard :func:`__import__` function "
8168
"calls this function directly."
8269
msgstr ""
8370

84-
#: ../../c-api/import.rst:75
71+
#: ../../c-api/import.rst:63
8572
msgid ""
8673
"Similar to :c:func:`PyImport_ImportModuleLevelObject`, but the name is a "
8774
"UTF-8 encoded string instead of a Unicode object."
8875
msgstr ""
8976

90-
#: ../../c-api/import.rst:78
77+
#: ../../c-api/import.rst:66
9178
msgid "Negative values for *level* are no longer accepted."
9279
msgstr ""
9380

94-
#: ../../c-api/import.rst:83
81+
#: ../../c-api/import.rst:71
9582
msgid ""
9683
"This is a higher-level interface that calls the current \"import hook "
9784
"function\" (with an explicit *level* of 0, meaning absolute import). It "
@@ -100,21 +87,25 @@ msgid ""
10087
"hooks are installed in the current environment."
10188
msgstr ""
10289

103-
#: ../../c-api/import.rst:94
90+
#: ../../c-api/import.rst:77
91+
msgid "This function always uses absolute imports."
92+
msgstr ""
93+
94+
#: ../../c-api/import.rst:82
10495
msgid ""
10596
"Reload a module. Return a new reference to the reloaded module, or ``NULL`` "
10697
"with an exception set on failure (the module still exists in this case)."
10798
msgstr ""
10899

109-
#: ../../c-api/import.rst:100
100+
#: ../../c-api/import.rst:88
110101
msgid ""
111102
"Return the module object corresponding to a module name. The *name* "
112103
"argument may be of the form ``package.module``. First check the modules "
113104
"dictionary if there's one there, and if not, create a new one and insert it "
114105
"in the modules dictionary. Return ``NULL`` with an exception set on failure."
115106
msgstr ""
116107

117-
#: ../../c-api/import.rst:107
108+
#: ../../c-api/import.rst:95
118109
msgid ""
119110
"This function does not load or import the module; if the module wasn't "
120111
"already loaded, you will get an empty module object. Use :c:func:"
@@ -123,13 +114,13 @@ msgid ""
123114
"already present."
124115
msgstr ""
125116

126-
#: ../../c-api/import.rst:117
117+
#: ../../c-api/import.rst:105
127118
msgid ""
128119
"Similar to :c:func:`PyImport_AddModuleObject`, but the name is a UTF-8 "
129120
"encoded string instead of a Unicode object."
130121
msgstr ""
131122

132-
#: ../../c-api/import.rst:125
123+
#: ../../c-api/import.rst:113
133124
msgid ""
134125
"Given a module name (possibly of the form ``package.module``) and a code "
135126
"object read from a Python bytecode file or obtained from the built-in "
@@ -143,118 +134,118 @@ msgid ""
143134
"to the module author's intents) state."
144135
msgstr ""
145136

146-
#: ../../c-api/import.rst:135
137+
#: ../../c-api/import.rst:123
147138
msgid ""
148139
"The module's :attr:`__spec__` and :attr:`__loader__` will be set, if not set "
149140
"already, with the appropriate values. The spec's loader will be set to the "
150141
"module's ``__loader__`` (if set) and to an instance of :class:`~importlib."
151142
"machinery.SourceFileLoader` otherwise."
152143
msgstr ""
153144

154-
#: ../../c-api/import.rst:140
145+
#: ../../c-api/import.rst:128
155146
msgid ""
156147
"The module's :attr:`__file__` attribute will be set to the code object's :"
157148
"attr:`~codeobject.co_filename`. If applicable, :attr:`__cached__` will also "
158149
"be set."
159150
msgstr ""
160151

161-
#: ../../c-api/import.rst:144
152+
#: ../../c-api/import.rst:132
162153
msgid ""
163154
"This function will reload the module if it was already imported. See :c:"
164155
"func:`PyImport_ReloadModule` for the intended way to reload a module."
165156
msgstr ""
166157

167-
#: ../../c-api/import.rst:147
158+
#: ../../c-api/import.rst:135
168159
msgid ""
169160
"If *name* points to a dotted name of the form ``package.module``, any "
170161
"package structures not already created will still not be created."
171162
msgstr ""
172163

173-
#: ../../c-api/import.rst:150
164+
#: ../../c-api/import.rst:138
174165
msgid ""
175166
"See also :c:func:`PyImport_ExecCodeModuleEx` and :c:func:"
176167
"`PyImport_ExecCodeModuleWithPathnames`."
177168
msgstr ""
178169

179-
#: ../../c-api/import.rst:153
170+
#: ../../c-api/import.rst:141
180171
msgid ""
181172
"The setting of :attr:`__cached__` and :attr:`__loader__` is deprecated. See :"
182173
"class:`~importlib.machinery.ModuleSpec` for alternatives."
183174
msgstr ""
184175

185-
#: ../../c-api/import.rst:161
176+
#: ../../c-api/import.rst:149
186177
msgid ""
187178
"Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute "
188179
"of the module object is set to *pathname* if it is non-``NULL``."
189180
msgstr ""
190181

191-
#: ../../c-api/import.rst:164
182+
#: ../../c-api/import.rst:152
192183
msgid "See also :c:func:`PyImport_ExecCodeModuleWithPathnames`."
193184
msgstr "也請見 :c:func:`PyImport_ExecCodeModuleWithPathnames`\\ 。"
194185

195-
#: ../../c-api/import.rst:169
186+
#: ../../c-api/import.rst:157
196187
msgid ""
197188
"Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`__cached__` "
198189
"attribute of the module object is set to *cpathname* if it is non-``NULL``. "
199190
"Of the three functions, this is the preferred one to use."
200191
msgstr ""
201192

202-
#: ../../c-api/import.rst:175
193+
#: ../../c-api/import.rst:163
203194
msgid ""
204195
"Setting :attr:`__cached__` is deprecated. See :class:`~importlib.machinery."
205196
"ModuleSpec` for alternatives."
206197
msgstr ""
207198

208-
#: ../../c-api/import.rst:182
199+
#: ../../c-api/import.rst:170
209200
msgid ""
210201
"Like :c:func:`PyImport_ExecCodeModuleObject`, but *name*, *pathname* and "
211202
"*cpathname* are UTF-8 encoded strings. Attempts are also made to figure out "
212203
"what the value for *pathname* should be from *cpathname* if the former is "
213204
"set to ``NULL``."
214205
msgstr ""
215206

216-
#: ../../c-api/import.rst:188
207+
#: ../../c-api/import.rst:176
217208
msgid ""
218209
"Uses :func:`!imp.source_from_cache()` in calculating the source path if only "
219210
"the bytecode path is provided."
220211
msgstr ""
221212

222-
#: ../../c-api/import.rst:191
213+
#: ../../c-api/import.rst:179
223214
msgid "No longer uses the removed :mod:`!imp` module."
224215
msgstr "不再使用已被移除的 :mod:`!imp` 模組。"
225216

226-
#: ../../c-api/import.rst:197
217+
#: ../../c-api/import.rst:185
227218
msgid ""
228219
"Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` "
229220
"file). The magic number should be present in the first four bytes of the "
230221
"bytecode file, in little-endian byte order. Returns ``-1`` on error."
231222
msgstr ""
232223

233-
#: ../../c-api/import.rst:201
224+
#: ../../c-api/import.rst:189
234225
msgid "Return value of ``-1`` upon failure."
235226
msgstr "當失敗時回傳 ``-1``。"
236227

237-
#: ../../c-api/import.rst:207
228+
#: ../../c-api/import.rst:195
238229
msgid ""
239230
"Return the magic tag string for :pep:`3147` format Python bytecode file "
240231
"names. Keep in mind that the value at ``sys.implementation.cache_tag`` is "
241232
"authoritative and should be used instead of this function."
242233
msgstr ""
243234

244-
#: ../../c-api/import.rst:215
235+
#: ../../c-api/import.rst:203
245236
msgid ""
246237
"Return the dictionary used for the module administration (a.k.a. ``sys."
247238
"modules``). Note that this is a per-interpreter variable."
248239
msgstr ""
249240

250-
#: ../../c-api/import.rst:220
241+
#: ../../c-api/import.rst:208
251242
msgid ""
252243
"Return the already imported module with the given name. If the module has "
253244
"not been imported yet then returns ``NULL`` but does not set an error. "
254245
"Returns ``NULL`` and sets an error if the lookup failed."
255246
msgstr ""
256247

257-
#: ../../c-api/import.rst:228
248+
#: ../../c-api/import.rst:216
258249
msgid ""
259250
"Return a finder object for a :data:`sys.path`/:attr:`!pkg.__path__` item "
260251
"*path*, possibly by fetching it from the :data:`sys.path_importer_cache` "
@@ -265,7 +256,7 @@ msgid ""
265256
"path_importer_cache`. Return a new reference to the finder object."
266257
msgstr ""
267258

268-
#: ../../c-api/import.rst:239
259+
#: ../../c-api/import.rst:227
269260
msgid ""
270261
"Load a frozen module named *name*. Return ``1`` for success, ``0`` if the "
271262
"module is not found, and ``-1`` with an exception set if the initialization "
@@ -274,31 +265,31 @@ msgid ""
274265
"the module if it was already imported.)"
275266
msgstr ""
276267

277-
#: ../../c-api/import.rst:247
268+
#: ../../c-api/import.rst:235
278269
msgid "The ``__file__`` attribute is no longer set on the module."
279270
msgstr ""
280271

281-
#: ../../c-api/import.rst:253
272+
#: ../../c-api/import.rst:241
282273
msgid ""
283274
"Similar to :c:func:`PyImport_ImportFrozenModuleObject`, but the name is a "
284275
"UTF-8 encoded string instead of a Unicode object."
285276
msgstr ""
286277

287-
#: ../../c-api/import.rst:261
278+
#: ../../c-api/import.rst:249
288279
msgid ""
289280
"This is the structure type definition for frozen module descriptors, as "
290281
"generated by the :program:`freeze` utility (see :file:`Tools/freeze/` in the "
291282
"Python source distribution). Its definition, found in :file:`Include/import."
292283
"h`, is::"
293284
msgstr ""
294285

295-
#: ../../c-api/import.rst:273
286+
#: ../../c-api/import.rst:261
296287
msgid ""
297288
"The new ``is_package`` field indicates whether the module is a package or "
298289
"not. This replaces setting the ``size`` field to a negative value."
299290
msgstr ""
300291

301-
#: ../../c-api/import.rst:279
292+
#: ../../c-api/import.rst:267
302293
msgid ""
303294
"This pointer is initialized to point to an array of :c:struct:`_frozen` "
304295
"records, terminated by one whose members are all ``NULL`` or zero. When a "
@@ -307,7 +298,7 @@ msgid ""
307298
"frozen modules."
308299
msgstr ""
309300

310-
#: ../../c-api/import.rst:287
301+
#: ../../c-api/import.rst:275
311302
msgid ""
312303
"Add a single module to the existing table of built-in modules. This is a "
313304
"convenience wrapper around :c:func:`PyImport_ExtendInittab`, returning "
@@ -317,19 +308,19 @@ msgid ""
317308
"before :c:func:`Py_Initialize`."
318309
msgstr ""
319310

320-
#: ../../c-api/import.rst:297
311+
#: ../../c-api/import.rst:285
321312
msgid ""
322313
"Structure describing a single entry in the list of built-in modules. "
323314
"Programs which embed Python may use an array of these structures in "
324315
"conjunction with :c:func:`PyImport_ExtendInittab` to provide additional "
325316
"built-in modules. The structure consists of two members:"
326317
msgstr ""
327318

328-
#: ../../c-api/import.rst:305
319+
#: ../../c-api/import.rst:293
329320
msgid "The module name, as an ASCII encoded string."
330321
msgstr ""
331322

332-
#: ../../c-api/import.rst:314
323+
#: ../../c-api/import.rst:302
333324
msgid ""
334325
"Add a collection of modules to the table of built-in modules. The *newtab* "
335326
"array must end with a sentinel entry which contains ``NULL`` for the :c:"
@@ -340,7 +331,7 @@ msgid ""
340331
"before :c:func:`Py_Initialize`."
341332
msgstr ""
342333

343-
#: ../../c-api/import.rst:321
334+
#: ../../c-api/import.rst:309
344335
msgid ""
345336
"If Python is initialized multiple times, :c:func:`PyImport_AppendInittab` "
346337
"or :c:func:`PyImport_ExtendInittab` must be called before each Python "
@@ -363,18 +354,18 @@ msgstr "__all__(套件變數)"
363354
msgid "modules (in module sys)"
364355
msgstr "modules(sys 模組中)"
365356

366-
#: ../../c-api/import.rst:44 ../../c-api/import.rst:123
357+
#: ../../c-api/import.rst:32 ../../c-api/import.rst:111
367358
msgid "built-in function"
368359
msgstr "built-in function(內建函式)"
369360

370-
#: ../../c-api/import.rst:44
361+
#: ../../c-api/import.rst:32
371362
msgid "__import__"
372363
msgstr "__import__"
373364

374-
#: ../../c-api/import.rst:123
365+
#: ../../c-api/import.rst:111
375366
msgid "compile"
376367
msgstr "compile(編譯)"
377368

378-
#: ../../c-api/import.rst:259
369+
#: ../../c-api/import.rst:247
379370
msgid "freeze utility"
380371
msgstr "freeze utility(凍結工具)"

0 commit comments

Comments
 (0)