-
-
Notifications
You must be signed in to change notification settings - Fork 403
Expand file tree
/
Copy pathimport.po
More file actions
2362 lines (2140 loc) · 110 KB
/
import.po
File metadata and controls
2362 lines (2140 loc) · 110 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright (C) 2001-2020, Python Software Foundation
# This file is distributed under the same license as the Python package.
# Maintained by the python-doc-es workteam.
# docs-es@python.org /
# https://mail.python.org/mailman3/lists/docs-es.python.org/
# Check https://github.com/python/python-docs-es/blob/3.8/TRANSLATORS to
# get the list of volunteers
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.8\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-11-21 16:38-0300\n"
"PO-Revision-Date: 2023-10-15 16:21-0700\n"
"Last-Translator: Cristián Maureira-Fredes <cmaureirafredes@gmail.com>\n"
"Language: es\n"
"Language-Team: python-doc-es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.16.0\n"
#: ../Doc/reference/import.rst:6
msgid "The import system"
msgstr "El sistema de importación"
#: ../Doc/reference/import.rst:10
msgid ""
"Python code in one :term:`module` gains access to the code in another module "
"by the process of :term:`importing` it. The :keyword:`import` statement is "
"the most common way of invoking the import machinery, but it is not the only "
"way. Functions such as :func:`importlib.import_module` and built-in :func:"
"`__import__` can also be used to invoke the import machinery."
msgstr ""
"El código Python en un :term:`módulo <module>` obtiene acceso al código en "
"otro módulo por el proceso de :term:`importarlo <importing>`. La "
"instrucción :keyword:`import` es la forma más común de invocar la maquinaria "
"de importación, pero no es la única manera. Funciones como :func:`importlib."
"import_module` y built-in :func:`__import__` también se pueden utilizar para "
"invocar la maquinaria de importación."
#: ../Doc/reference/import.rst:16
msgid ""
"The :keyword:`import` statement combines two operations; it searches for the "
"named module, then it binds the results of that search to a name in the "
"local scope. The search operation of the :keyword:`!import` statement is "
"defined as a call to the :func:`__import__` function, with the appropriate "
"arguments. The return value of :func:`__import__` is used to perform the "
"name binding operation of the :keyword:`!import` statement. See the :"
"keyword:`!import` statement for the exact details of that name binding "
"operation."
msgstr ""
"La instrucción :keyword:`import` combina dos operaciones; busca el módulo "
"con nombre y, a continuación, enlaza los resultados de esa búsqueda a un "
"nombre en el ámbito local. La operación de búsqueda de la instrucción :"
"keyword:`!import` se define como una llamada a la función :func:"
"`__import__`, con los argumentos adecuados. El valor retornado de :func:"
"`__import__` se utiliza para realizar la operación de enlace de nombre de la "
"instrucción :keyword:`!import`. Consulte la instrucción :keyword:`!import` "
"para obtener los detalles exactos de esa operación de enlace de nombres."
#: ../Doc/reference/import.rst:25
msgid ""
"A direct call to :func:`__import__` performs only the module search and, if "
"found, the module creation operation. While certain side-effects may occur, "
"such as the importing of parent packages, and the updating of various caches "
"(including :data:`sys.modules`), only the :keyword:`import` statement "
"performs a name binding operation."
msgstr ""
"Una llamada directa a :func:`__import__` realiza solo la búsqueda del módulo "
"y, si se encuentra, la operación de creación del módulo. Aunque pueden "
"producirse ciertos efectos secundarios, como la importación de paquetes "
"primarios y la actualización de varias memorias caché (incluidas :data:`sys."
"modules`), solo la instrucción :keyword:`import` realiza una operación de "
"enlace de nombres."
#: ../Doc/reference/import.rst:31
msgid ""
"When an :keyword:`import` statement is executed, the standard builtin :func:"
"`__import__` function is called. Other mechanisms for invoking the import "
"system (such as :func:`importlib.import_module`) may choose to bypass :func:"
"`__import__` and use their own solutions to implement import semantics."
msgstr ""
"Cuando se ejecuta una instrucción :keyword:`import`, se llama a la función "
"estándar incorporada :func:`__import__`. Otros mecanismos para invocar el "
"sistema de importación (como :func:`importlib.import_module`) pueden optar "
"por omitir :func:`__import__` y utilizar sus propias soluciones para "
"implementar la semántica de importación."
#: ../Doc/reference/import.rst:36
msgid ""
"When a module is first imported, Python searches for the module and if "
"found, it creates a module object [#fnmo]_, initializing it. If the named "
"module cannot be found, a :exc:`ModuleNotFoundError` is raised. Python "
"implements various strategies to search for the named module when the import "
"machinery is invoked. These strategies can be modified and extended by "
"using various hooks described in the sections below."
msgstr ""
"Cuando se importa un módulo por primera vez, Python busca el módulo y, si se "
"encuentra, crea un objeto de módulo [#fnmo]_, inicializándolo. Si no se "
"encuentra el módulo con nombre, se genera un :exc:`ModuleNotFoundError`. "
"Python implementa varias estrategias para buscar el módulo con nombre cuando "
"se invoca la maquinaria de importación. Estas estrategias se pueden "
"modificar y ampliar mediante el uso de varios ganchos descritos en las "
"secciones siguientes."
#: ../Doc/reference/import.rst:43
msgid ""
"The import system has been updated to fully implement the second phase of :"
"pep:`302`. There is no longer any implicit import machinery - the full "
"import system is exposed through :data:`sys.meta_path`. In addition, native "
"namespace package support has been implemented (see :pep:`420`)."
msgstr ""
"El sistema de importación se ha actualizado para aplicar plenamente la "
"segunda fase de :pep:`302`. Ya no hay ninguna maquinaria de importación "
"implícita: todo el sistema de importación se expone a través de :data:`sys."
"meta_path`. Además, se ha implementado la compatibilidad con paquetes de "
"espacio de nombres nativos (consulte :pep:`420`)."
#: ../Doc/reference/import.rst:51
msgid ":mod:`importlib`"
msgstr ":mod:`importlib`"
#: ../Doc/reference/import.rst:53
msgid ""
"The :mod:`importlib` module provides a rich API for interacting with the "
"import system. For example :func:`importlib.import_module` provides a "
"recommended, simpler API than built-in :func:`__import__` for invoking the "
"import machinery. Refer to the :mod:`importlib` library documentation for "
"additional detail."
msgstr ""
"El módulo :mod:`importlib` proporciona una API enriquecida para interactuar "
"con el sistema de importación. Por ejemplo :func:`importlib.import_module` "
"proporciona una API recomendada y más sencilla que la integrada :func:"
"`__import__` para invocar la maquinaria de importación. Consulte la "
"documentación de la biblioteca :mod:`importlib` para obtener más detalles."
#: ../Doc/reference/import.rst:62
msgid "Packages"
msgstr "Paquetes"
#: ../Doc/reference/import.rst:67
msgid ""
"Python has only one type of module object, and all modules are of this type, "
"regardless of whether the module is implemented in Python, C, or something "
"else. To help organize modules and provide a naming hierarchy, Python has a "
"concept of :term:`packages <package>`."
msgstr ""
"Python sólo tiene un tipo de objeto módulo, y todos los módulos son de este "
"tipo, independientemente de si el módulo está implementado en Python, C, o "
"en cualquier otro lenguaje. Para ayudar a organizar los módulos y "
"proporcionar una jerarquía de nombres, Python tiene un concepto de :term:"
"`paquete <package>`."
#: ../Doc/reference/import.rst:72
msgid ""
"You can think of packages as the directories on a file system and modules as "
"files within directories, but don't take this analogy too literally since "
"packages and modules need not originate from the file system. For the "
"purposes of this documentation, we'll use this convenient analogy of "
"directories and files. Like file system directories, packages are organized "
"hierarchically, and packages may themselves contain subpackages, as well as "
"regular modules."
msgstr ""
"Puedes pensar en los paquetes como los directorios de un sistema de archivos "
"y en los módulos como archivos dentro de los directorios, pero no te tomes "
"esta analogía demasiado literalmente, ya que los paquetes y los módulos no "
"tienen por qué originarse en el sistema de archivos. Para los propósitos de "
"esta documentación, usaremos esta conveniente analogía de directorios y "
"archivos. Al igual que los directorios del sistema de archivos, los "
"paquetes están organizados de forma jerárquica, y los paquetes pueden "
"contener subpaquetes, así como módulos regulares."
#: ../Doc/reference/import.rst:80
msgid ""
"It's important to keep in mind that all packages are modules, but not all "
"modules are packages. Or put another way, packages are just a special kind "
"of module. Specifically, any module that contains a ``__path__`` attribute "
"is considered a package."
msgstr ""
"Es importante tener en cuenta que todos los paquetes son módulos, pero no "
"todos los módulos son paquetes. O dicho de otro modo, los paquetes son sólo "
"un tipo especial de módulo. Específicamente, cualquier módulo que contenga "
"un atributo ``__path__`` se considera un paquete."
#: ../Doc/reference/import.rst:85
msgid ""
"All modules have a name. Subpackage names are separated from their parent "
"package name by a dot, akin to Python's standard attribute access syntax. "
"Thus you might have a package called :mod:`email`, which in turn has a "
"subpackage called :mod:`email.mime` and a module within that subpackage "
"called :mod:`email.mime.text`."
msgstr ""
"Todos los módulos tienen un nombre. Los nombres de los subpaquetes están "
"separados de su nombre de paquete principal por un punto, similar a la "
"sintaxis de acceso de atributo estándar de Python. Por lo tanto, podría "
"tener un paquete llamado :mod:`email`, que a su vez tiene un subpaquete "
"llamado :mod:`email.mime` y un módulo dentro de ese subpaquete llamado :mod:"
"`email.mime.text`."
#: ../Doc/reference/import.rst:93
msgid "Regular packages"
msgstr "Paquetes regulares"
#: ../Doc/reference/import.rst:98
msgid ""
"Python defines two types of packages, :term:`regular packages <regular "
"package>` and :term:`namespace packages <namespace package>`. Regular "
"packages are traditional packages as they existed in Python 3.2 and earlier. "
"A regular package is typically implemented as a directory containing an "
"``__init__.py`` file. When a regular package is imported, this ``__init__."
"py`` file is implicitly executed, and the objects it defines are bound to "
"names in the package's namespace. The ``__init__.py`` file can contain the "
"same Python code that any other module can contain, and Python will add some "
"additional attributes to the module when it is imported."
msgstr ""
"Python define dos tipos de paquetes, :term:`paquetes regulares <regular "
"package>` y :term:`paquetes de espacio de nombres <namespace package>`. Los "
"paquetes regulares son los paquetes tradicionales tal y como existían en "
"Python 3.2 y anteriores. Un paquete regular se implementa típicamente como "
"un directorio que contiene un archivo ``init__.py``. Cuando se importa un "
"paquete regular, este archivo ``__init__.py`` se ejecuta implícitamente, y "
"los objetos que define están vinculados a nombres en el espacio de nombres "
"del paquete. El archivo ``__init__.py`` puede contener el mismo código "
"Python que puede contener cualquier otro módulo, y Python añadirá algunos "
"atributos adicionales al módulo cuando se importe."
#: ../Doc/reference/import.rst:108
msgid ""
"For example, the following file system layout defines a top level ``parent`` "
"package with three subpackages::"
msgstr ""
"Por ejemplo, la siguiente disposición del sistema de archivos define un "
"paquete ``parent`` de nivel superior con tres subpaquetes::"
#: ../Doc/reference/import.rst:111
msgid ""
"parent/\n"
" __init__.py\n"
" one/\n"
" __init__.py\n"
" two/\n"
" __init__.py\n"
" three/\n"
" __init__.py"
msgstr ""
#: ../Doc/reference/import.rst:120
msgid ""
"Importing ``parent.one`` will implicitly execute ``parent/__init__.py`` and "
"``parent/one/__init__.py``. Subsequent imports of ``parent.two`` or "
"``parent.three`` will execute ``parent/two/__init__.py`` and ``parent/three/"
"__init__.py`` respectively."
msgstr ""
"Importando ``parent.one`` se ejecutará implícitamente ``parent/__init__.py`` "
"y ``parent/one/__init__.py``. La importación posterior de ``parent.two`` o "
"``parent.three`` ejecutará ``parent/two/__init__.py`` y ``parent/three/"
"__init__.py`` respectivamente."
#: ../Doc/reference/import.rst:127
msgid "Namespace packages"
msgstr "Paquetes de espacio de nombres"
#: ../Doc/reference/import.rst:133
msgid ""
"A namespace package is a composite of various :term:`portions <portion>`, "
"where each portion contributes a subpackage to the parent package. Portions "
"may reside in different locations on the file system. Portions may also be "
"found in zip files, on the network, or anywhere else that Python searches "
"during import. Namespace packages may or may not correspond directly to "
"objects on the file system; they may be virtual modules that have no "
"concrete representation."
msgstr ""
"Un paquete de espacio de nombres es un compuesto de varias :term:`porciones "
"<portion>`, donde cada porción contribuye con un subpaquete al paquete "
"padre. Las porciones pueden residir en diferentes lugares del sistema de "
"archivos. Las porciones también pueden encontrarse en archivos zip, en la "
"red, o en cualquier otro lugar que Python busque durante la importación. "
"Los paquetes de espacios de nombres pueden corresponder o no directamente a "
"objetos del sistema de archivos; pueden ser módulos virtuales que no tienen "
"una representación concreta."
#: ../Doc/reference/import.rst:141
msgid ""
"Namespace packages do not use an ordinary list for their ``__path__`` "
"attribute. They instead use a custom iterable type which will automatically "
"perform a new search for package portions on the next import attempt within "
"that package if the path of their parent package (or :data:`sys.path` for a "
"top level package) changes."
msgstr ""
"Los paquetes de espacios de nombres no usan una lista ordinaria para su "
"atributo ``__path__``. En su lugar utilizan un tipo iterable personalizado "
"que realizará automáticamente una nueva búsqueda de porciones de paquete en "
"el siguiente intento de importación dentro de ese paquete si la ruta de su "
"paquete padre (o :data:`sys.path`` para un paquete de nivel superior) cambia."
#: ../Doc/reference/import.rst:147
msgid ""
"With namespace packages, there is no ``parent/__init__.py`` file. In fact, "
"there may be multiple ``parent`` directories found during import search, "
"where each one is provided by a different portion. Thus ``parent/one`` may "
"not be physically located next to ``parent/two``. In this case, Python will "
"create a namespace package for the top-level ``parent`` package whenever it "
"or one of its subpackages is imported."
msgstr ""
"Con los paquetes de espacio de nombres, no hay ningún archivo ``parent/"
"__init__.py``. De hecho, puede haber varios directorios ``padre`` "
"encontrados durante la búsqueda de importación, donde cada uno de ellos es "
"proporcionado por una parte diferente. Por lo tanto, ``padre/one`` no puede "
"estar físicamente situado junto a ``padre/two``. En este caso, Python "
"creará un paquete de espacio de nombres para el paquete ``parent`` de nivel "
"superior siempre que se importe él o uno de sus subpaquetes."
#: ../Doc/reference/import.rst:154
msgid "See also :pep:`420` for the namespace package specification."
msgstr ""
"Consulte también :pep:`420` para conocer la especificación del paquete de "
"espacio de nombres."
#: ../Doc/reference/import.rst:158
msgid "Searching"
msgstr "Buscando"
#: ../Doc/reference/import.rst:160
msgid ""
"To begin the search, Python needs the :term:`fully qualified <qualified "
"name>` name of the module (or package, but for the purposes of this "
"discussion, the difference is immaterial) being imported. This name may "
"come from various arguments to the :keyword:`import` statement, or from the "
"parameters to the :func:`importlib.import_module` or :func:`__import__` "
"functions."
msgstr ""
"Para comenzar la búsqueda, Python necesita el nombre :term:`totalmente "
"calificado <qualified name>` del módulo (o paquete, pero para los fines de "
"esta discusión, la diferencia es irrelevante) que se está importando. Este "
"nombre puede provenir de varios argumentos a la instrucción :keyword:"
"`import`, o de los parámetros de las funciones :func:`importlib."
"import_module` o :func:`__import__`."
#: ../Doc/reference/import.rst:166
msgid ""
"This name will be used in various phases of the import search, and it may be "
"the dotted path to a submodule, e.g. ``foo.bar.baz``. In this case, Python "
"first tries to import ``foo``, then ``foo.bar``, and finally ``foo.bar."
"baz``. If any of the intermediate imports fail, a :exc:`ModuleNotFoundError` "
"is raised."
msgstr ""
"Este nombre se utilizará en varias fases de la búsqueda de importación, y "
"puede ser la ruta de acceso punteada a un submódulo, por ejemplo, ``foo.bar."
"baz``. En este caso, Python primero intenta importar ``foo``, luego ``foo."
"bar``, y finalmente ``foo.bar.baz``. Si se produce un error en cualquiera de "
"las importaciones intermedias, se genera un :exc:`ModuleNotFoundError`."
#: ../Doc/reference/import.rst:173
msgid "The module cache"
msgstr "La caché del módulo"
#: ../Doc/reference/import.rst:178
msgid ""
"The first place checked during import search is :data:`sys.modules`. This "
"mapping serves as a cache of all modules that have been previously imported, "
"including the intermediate paths. So if ``foo.bar.baz`` was previously "
"imported, :data:`sys.modules` will contain entries for ``foo``, ``foo.bar``, "
"and ``foo.bar.baz``. Each key will have as its value the corresponding "
"module object."
msgstr ""
"El primer lugar comprobado durante la búsqueda de importación es :data:`sys."
"modules`. Esta asignación sirve como caché de todos los módulos que se han "
"importado previamente, incluidas las rutas intermedias. Por lo tanto, si "
"``foo.bar.baz`` se importó previamente, :data:`sys.modules` contendrá "
"entradas para ``foo``, ``foo.bar``, y ``foo.bar.baz``. Cada clave tendrá "
"como valor el objeto de módulo correspondiente."
#: ../Doc/reference/import.rst:185
msgid ""
"During import, the module name is looked up in :data:`sys.modules` and if "
"present, the associated value is the module satisfying the import, and the "
"process completes. However, if the value is ``None``, then a :exc:"
"`ModuleNotFoundError` is raised. If the module name is missing, Python will "
"continue searching for the module."
msgstr ""
"Durante la importación, el nombre del módulo se busca en :data:`sys.modules` "
"y si está presente, el valor asociado es el módulo que satisface la "
"importación y el proceso se completa. Sin embargo, si el valor es ``None``, "
"se genera un :exc:`ModuleNotFoundError`. Si falta el nombre del módulo, "
"Python continuará buscando el módulo."
#: ../Doc/reference/import.rst:191
msgid ""
":data:`sys.modules` is writable. Deleting a key may not destroy the "
"associated module (as other modules may hold references to it), but it will "
"invalidate the cache entry for the named module, causing Python to search "
"anew for the named module upon its next import. The key can also be assigned "
"to ``None``, forcing the next import of the module to result in a :exc:"
"`ModuleNotFoundError`."
msgstr ""
":data:`sys.modules` se puede escribir. La eliminación de una clave no puede "
"destruir el módulo asociado (ya que otros módulos pueden contener "
"referencias a él), pero invalidará la entrada de caché para el módulo con "
"nombre, lo que hará que Python busque de nuevo el módulo con nombre en su "
"próxima importación. La clave también se puede asignar a ``None``, lo que "
"obliga a la siguiente importación del módulo a dar como resultado un :exc:"
"`ModuleNotFoundError`."
#: ../Doc/reference/import.rst:198
msgid ""
"Beware though, as if you keep a reference to the module object, invalidate "
"its cache entry in :data:`sys.modules`, and then re-import the named module, "
"the two module objects will *not* be the same. By contrast, :func:`importlib."
"reload` will reuse the *same* module object, and simply reinitialise the "
"module contents by rerunning the module's code."
msgstr ""
"Tenga cuidado, sin embargo, como si mantiene una referencia al objeto "
"module, invalide su entrada de caché en :data:`sys.modules` y, a "
"continuación, vuelva a importar el módulo con nombre, los dos objetos de "
"módulo *no* serán los mismos. Por el contrario, :func:`importlib.reload` "
"reutilizará el objeto de módulo *same* y simplemente reinicializará el "
"contenido del módulo volviendo a ejecutar el código del módulo."
#: ../Doc/reference/import.rst:208
msgid "Finders and loaders"
msgstr "Buscadores y cargadores"
#: ../Doc/reference/import.rst:215
msgid ""
"If the named module is not found in :data:`sys.modules`, then Python's "
"import protocol is invoked to find and load the module. This protocol "
"consists of two conceptual objects, :term:`finders <finder>` and :term:"
"`loaders <loader>`. A finder's job is to determine whether it can find the "
"named module using whatever strategy it knows about. Objects that implement "
"both of these interfaces are referred to as :term:`importers <importer>` - "
"they return themselves when they find that they can load the requested "
"module."
msgstr ""
"Si el módulo con nombre no se encuentra en :data:`sys.modules`, se invoca el "
"protocolo de importación de Python para buscar y cargar el módulo. Este "
"protocolo consta de dos objetos conceptuales, :term:`buscadores <finder>` y :"
"term:`cargadores <loader>`. El trabajo de un buscador es determinar si puede "
"encontrar el módulo con nombre utilizando cualquier estrategia que conozca. "
"Los objetos que implementan ambas interfaces se conocen como :term:"
"`importadores <importer>` se retornan a sí mismos cuando descubren que "
"pueden cargar el módulo solicitado."
#: ../Doc/reference/import.rst:223
msgid ""
"Python includes a number of default finders and importers. The first one "
"knows how to locate built-in modules, and the second knows how to locate "
"frozen modules. A third default finder searches an :term:`import path` for "
"modules. The :term:`import path` is a list of locations that may name file "
"system paths or zip files. It can also be extended to search for any "
"locatable resource, such as those identified by URLs."
msgstr ""
"Python incluye una serie de buscadores e importadores predeterminados. El "
"primero sabe cómo localizar módulos integrados, y el segundo sabe cómo "
"localizar módulos congelados. Un tercer buscador predeterminado busca "
"módulos en :term:`import path`. El :term:`import path` es una lista de "
"ubicaciones que pueden nombrar rutas del sistema de archivos o archivos "
"zip. También se puede ampliar para buscar cualquier recurso localizable, "
"como los identificados por las direcciones URL."
#: ../Doc/reference/import.rst:230
msgid ""
"The import machinery is extensible, so new finders can be added to extend "
"the range and scope of module searching."
msgstr ""
"La maquinaria de importación es extensible, por lo que se pueden añadir "
"nuevos buscadores para ampliar el alcance y el alcance de la búsqueda de "
"módulos."
#: ../Doc/reference/import.rst:233
msgid ""
"Finders do not actually load modules. If they can find the named module, "
"they return a :dfn:`module spec`, an encapsulation of the module's import-"
"related information, which the import machinery then uses when loading the "
"module."
msgstr ""
"En realidad, los buscadores no cargan módulos. Si pueden encontrar el "
"módulo con nombre, retornan un :dfn:`module spec`, una encapsulación de la "
"información relacionada con la importación del módulo, que la maquinaria de "
"importación utiliza al cargar el módulo."
#: ../Doc/reference/import.rst:237
msgid ""
"The following sections describe the protocol for finders and loaders in more "
"detail, including how you can create and register new ones to extend the "
"import machinery."
msgstr ""
"En las secciones siguientes se describe el protocolo para buscadores y "
"cargadores con más detalle, incluido cómo puede crear y registrar otros "
"nuevos para ampliar la maquinaria de importación."
#: ../Doc/reference/import.rst:241
msgid ""
"In previous versions of Python, finders returned :term:`loaders <loader>` "
"directly, whereas now they return module specs which *contain* loaders. "
"Loaders are still used during import but have fewer responsibilities."
msgstr ""
"En versiones anteriores de Python, los buscadores retornaban :term:"
"`cargadores <loader>` directamente, mientras que ahora retornen "
"especificaciones de módulo que *contienen* cargadores. Los cargadores "
"todavía se utilizan durante la importación, pero tienen menos "
"responsabilidades."
#: ../Doc/reference/import.rst:247
msgid "Import hooks"
msgstr "Ganchos de importación"
#: ../Doc/reference/import.rst:257
msgid ""
"The import machinery is designed to be extensible; the primary mechanism for "
"this are the *import hooks*. There are two types of import hooks: *meta "
"hooks* and *import path hooks*."
msgstr ""
"La maquinaria de importación está diseñada para ser extensible; el mecanismo "
"principal para esto son los *ganchos de importación* (import hooks). Hay "
"dos tipos de ganchos de importación: *meta hooks* (meta ganchos) y *import "
"path hooks* (ganchos de ruta de acceso de importación)."
#: ../Doc/reference/import.rst:261
msgid ""
"Meta hooks are called at the start of import processing, before any other "
"import processing has occurred, other than :data:`sys.modules` cache look "
"up. This allows meta hooks to override :data:`sys.path` processing, frozen "
"modules, or even built-in modules. Meta hooks are registered by adding new "
"finder objects to :data:`sys.meta_path`, as described below."
msgstr ""
"Los meta ganchos se llaman al inicio del procesamiento de importación, antes "
"de que se haya producido cualquier otro procesamiento de importación, que no "
"sea búsqueda de caché de :data:`sys.modules`. Esto permite que los "
"metaganchos reemplacen el procesamiento de :data:`sys.path`, módulos "
"congelados o incluso módulos integrados. Los meta ganchos se registran "
"agregando nuevos objetos de buscador a :data:`sys.meta_path`, como se "
"describe a continuación."
#: ../Doc/reference/import.rst:267
msgid ""
"Import path hooks are called as part of :data:`sys.path` (or ``package."
"__path__``) processing, at the point where their associated path item is "
"encountered. Import path hooks are registered by adding new callables to :"
"data:`sys.path_hooks` as described below."
msgstr ""
"Los ganchos de ruta de acceso de importación se invocan como parte del "
"procesamiento :data:`sys.path` (o ``package.__path__``), en el punto donde "
"se encuentra su elemento de ruta de acceso asociado. Los ganchos de ruta de "
"acceso de importación se registran agregando nuevos invocables a :data:`sys."
"path_hooks` como se describe a continuación."
#: ../Doc/reference/import.rst:274
msgid "The meta path"
msgstr "La meta ruta (*path*)"
#: ../Doc/reference/import.rst:280
#, fuzzy
msgid ""
"When the named module is not found in :data:`sys.modules`, Python next "
"searches :data:`sys.meta_path`, which contains a list of meta path finder "
"objects. These finders are queried in order to see if they know how to "
"handle the named module. Meta path finders must implement a method called :"
"meth:`~importlib.abc.MetaPathFinder.find_spec` which takes three arguments: "
"a name, an import path, and (optionally) a target module. The meta path "
"finder can use any strategy it wants to determine whether it can handle the "
"named module or not."
msgstr ""
"Cuando el módulo con nombre no se encuentra en :data:`sys.modules`, Python "
"busca a continuación :data:`sys.meta_path`, que contiene una lista de "
"objetos buscadores de metarutas. Estos buscadores se consultan para ver si "
"saben cómo manejar el módulo nombrado. Los buscadores de rutas de meta "
"deben implementar un método llamado :meth:`~importlib.abc.MetaPathFinder."
"find_spec()` que toma tres argumentos: un nombre, una ruta de importación y "
"(opcionalmente) un módulo de destino. El buscador de metarutas puede usar "
"cualquier estrategia que desee para determinar si puede manejar el módulo "
"con nombre o no."
#: ../Doc/reference/import.rst:289
msgid ""
"If the meta path finder knows how to handle the named module, it returns a "
"spec object. If it cannot handle the named module, it returns ``None``. "
"If :data:`sys.meta_path` processing reaches the end of its list without "
"returning a spec, then a :exc:`ModuleNotFoundError` is raised. Any other "
"exceptions raised are simply propagated up, aborting the import process."
msgstr ""
"Si el buscador de metarutas sabe cómo controlar el módulo con nombre, "
"retorna un objeto de especificación. Si no puede controlar el módulo con "
"nombre, retorna ``None``. Si el procesamiento de :data:`sys.meta_path` "
"llega al final de su lista sin retornar una especificación, se genera un :"
"exc:`ModuleNotFoundError`. Cualquier otra excepción provocada simplemente "
"se propaga hacia arriba, anulando el proceso de importación."
#: ../Doc/reference/import.rst:295
#, fuzzy
msgid ""
"The :meth:`~importlib.abc.MetaPathFinder.find_spec` method of meta path "
"finders is called with two or three arguments. The first is the fully "
"qualified name of the module being imported, for example ``foo.bar.baz``. "
"The second argument is the path entries to use for the module search. For "
"top-level modules, the second argument is ``None``, but for submodules or "
"subpackages, the second argument is the value of the parent package's "
"``__path__`` attribute. If the appropriate ``__path__`` attribute cannot be "
"accessed, a :exc:`ModuleNotFoundError` is raised. The third argument is an "
"existing module object that will be the target of loading later. The import "
"system passes in a target module only during reload."
msgstr ""
"El método de los buscadores de metarutas de :meth:`~importlib.abc."
"metapathFinder.find_spec()` se llama con dos o tres argumentos. El primero "
"es el nombre completo del módulo que se está importando, por ejemplo ``foo."
"bar.baz``. El segundo argumento son las entradas de ruta de acceso que se "
"utilizarán para la búsqueda de módulos. Para los módulos de nivel superior, "
"el segundo argumento es ``None``, pero para submódulos o subpaquetes, el "
"segundo argumento es el valor del atributo ``__path__`` del paquete "
"primario. Si no se puede tener acceso al atributo ``__path__`` adecuado, se "
"genera un :exc:`ModuleNotFoundError`. El tercer argumento es un objeto de "
"módulo existente que será el destino de la carga más adelante. El sistema de "
"importación pasa un módulo de destino solo durante la recarga."
#: ../Doc/reference/import.rst:306
msgid ""
"The meta path may be traversed multiple times for a single import request. "
"For example, assuming none of the modules involved has already been cached, "
"importing ``foo.bar.baz`` will first perform a top level import, calling "
"``mpf.find_spec(\"foo\", None, None)`` on each meta path finder (``mpf``). "
"After ``foo`` has been imported, ``foo.bar`` will be imported by traversing "
"the meta path a second time, calling ``mpf.find_spec(\"foo.bar\", foo."
"__path__, None)``. Once ``foo.bar`` has been imported, the final traversal "
"will call ``mpf.find_spec(\"foo.bar.baz\", foo.bar.__path__, None)``."
msgstr ""
"La metaruta se puede recorrer varias veces para una sola solicitud de "
"importación. Por ejemplo, suponiendo que ninguno de los módulos implicados "
"ya se haya almacenado en caché, la importación de ``foo.bar.baz`` realizará "
"primero una importación de nivel superior, llamando a ``mpf."
"find_spec(\"foo\", None, None)`` en cada buscador de metarutas (``mpf``). "
"Después de importar ``foo`` , ``foo.bar`` se importará atravesando la meta "
"ruta por segunda vez, llamando a ``mpf.find_spec(\"foo.bar\", foo.__path__, "
"None)``. Una vez importado ``foo.bar``, el recorrido final llamará a ``mpf."
"find_spec(\"foo.bar.baz\", foo.bar.__path__, None)``."
#: ../Doc/reference/import.rst:316
msgid ""
"Some meta path finders only support top level imports. These importers will "
"always return ``None`` when anything other than ``None`` is passed as the "
"second argument."
msgstr ""
"Algunos buscadores de metarutas solo admiten importaciones de nivel "
"superior. Estos importadores siempre retornarán ``None`` cuando se pase algo "
"distinto de ``None`` como segundo argumento."
#: ../Doc/reference/import.rst:320
msgid ""
"Python's default :data:`sys.meta_path` has three meta path finders, one that "
"knows how to import built-in modules, one that knows how to import frozen "
"modules, and one that knows how to import modules from an :term:`import "
"path` (i.e. the :term:`path based finder`)."
msgstr ""
"El valor predeterminado de Python :data:`sys.meta_path` tiene tres "
"buscadores de metarutas, uno que sabe cómo importar módulos integrados, uno "
"que sabe cómo importar módulos congelados y otro que sabe cómo importar "
"módulos desde un :term:`import path` (es decir, el :term:`path based "
"finder`)."
#: ../Doc/reference/import.rst:325
#, fuzzy
msgid ""
"The :meth:`~importlib.abc.MetaPathFinder.find_spec` method of meta path "
"finders replaced :meth:`!find_module`, which is now deprecated. While it "
"will continue to work without change, the import machinery will try it only "
"if the finder does not implement :meth:`~importlib.abc.MetaPathFinder."
"find_spec`."
msgstr ""
"El método :meth:`~importlib.abc.MetaPathFinder.find_spec` de los buscadores "
"de meta rutas de la ruta de acceso reemplazó :meth:`~importlib.abc."
"MetaPathFinder.find_module`, que ahora está en desuso. Aunque seguirá "
"funcionando sin cambios, la maquinaria de importación sólo lo intentará si "
"el buscador no implementa ``find_spec()``."
#: ../Doc/reference/import.rst:332
#, fuzzy
msgid ""
"Use of :meth:`!find_module` by the import system now raises :exc:"
"`ImportWarning`."
msgstr ""
"El uso de :meth:`~importlib.abc.MetaPathFinder.find_module` por parte del "
"sistema de importación ahora lanza :exc:`ImportWarning`."
#: ../Doc/reference/import.rst:336
#, fuzzy
msgid ""
":meth:`!find_module` has been removed. Use :meth:`~importlib.abc."
"MetaPathFinder.find_spec` instead."
msgstr ""
"Se eliminó el método ``find_module()``. Utiliza el método :meth:`find_spec` "
"en su lugar."
#: ../Doc/reference/import.rst:342
msgid "Loading"
msgstr "Cargando"
#: ../Doc/reference/import.rst:344
msgid ""
"If and when a module spec is found, the import machinery will use it (and "
"the loader it contains) when loading the module. Here is an approximation "
"of what happens during the loading portion of import::"
msgstr ""
"Si se encuentra una especificación de módulo, la maquinaria de importación "
"la utilizará (y el cargador que contiene) al cargar el módulo. Aquí está "
"una aproximación de lo que sucede durante la porción de carga de la "
"importación:"
#: ../Doc/reference/import.rst:348
msgid ""
"module = None\n"
"if spec.loader is not None and hasattr(spec.loader, 'create_module'):\n"
" # It is assumed 'exec_module' will also be defined on the loader.\n"
" module = spec.loader.create_module(spec)\n"
"if module is None:\n"
" module = ModuleType(spec.name)\n"
"# The import-related module attributes get set here:\n"
"_init_module_attrs(spec, module)\n"
"\n"
"if spec.loader is None:\n"
" # unsupported\n"
" raise ImportError\n"
"if spec.origin is None and spec.submodule_search_locations is not None:\n"
" # namespace package\n"
" sys.modules[spec.name] = module\n"
"elif not hasattr(spec.loader, 'exec_module'):\n"
" module = spec.loader.load_module(spec.name)\n"
"else:\n"
" sys.modules[spec.name] = module\n"
" try:\n"
" spec.loader.exec_module(module)\n"
" except BaseException:\n"
" try:\n"
" del sys.modules[spec.name]\n"
" except KeyError:\n"
" pass\n"
" raise\n"
"return sys.modules[spec.name]"
msgstr ""
#: ../Doc/reference/import.rst:377
msgid "Note the following details:"
msgstr "Tenga en cuenta los siguientes detalles:"
#: ../Doc/reference/import.rst:379
msgid ""
"If there is an existing module object with the given name in :data:`sys."
"modules`, import will have already returned it."
msgstr ""
"Si hay un objeto de módulo existente con el nombre dado en :data:`sys."
"modules`, la importación ya lo habrá retornado."
#: ../Doc/reference/import.rst:382
msgid ""
"The module will exist in :data:`sys.modules` before the loader executes the "
"module code. This is crucial because the module code may (directly or "
"indirectly) import itself; adding it to :data:`sys.modules` beforehand "
"prevents unbounded recursion in the worst case and multiple loading in the "
"best."
msgstr ""
"El módulo existirá en :data:`sys.modules` antes de que el cargador ejecute "
"el código del módulo. Esto es crucial porque el código del módulo puede "
"(directa o indirectamente) importarse a sí mismo; agregándolo a :data:`sys."
"modules` de antemano evita la recursividad sin límites en el peor de los "
"casos y la carga múltiple en el mejor."
#: ../Doc/reference/import.rst:388
msgid ""
"If loading fails, the failing module -- and only the failing module -- gets "
"removed from :data:`sys.modules`. Any module already in the :data:`sys."
"modules` cache, and any module that was successfully loaded as a side-"
"effect, must remain in the cache. This contrasts with reloading where even "
"the failing module is left in :data:`sys.modules`."
msgstr ""
"Si se produce un error en la carga, el módulo con errores -- y solo el "
"módulo con errores -- se elimina de :data:`sys.modules`. Cualquier módulo "
"que ya esté en la caché de :data:`sys.modules` y cualquier módulo que se "
"haya cargado correctamente como efecto secundario, debe permanecer en la "
"memoria caché. Esto contrasta con la recarga donde incluso el módulo que "
"falla se deja en :data:`sys.modules`."
#: ../Doc/reference/import.rst:394
msgid ""
"After the module is created but before execution, the import machinery sets "
"the import-related module attributes (\"_init_module_attrs\" in the pseudo-"
"code example above), as summarized in a :ref:`later section <import-mod-"
"attrs>`."
msgstr ""
"Después de crear el módulo pero antes de la ejecución, la maquinaria de "
"importación establece los atributos del módulo relacionados con la "
"importación (\"_init_module_attrs\" en el ejemplo de pseudocódigo anterior), "
"como se resume en una :ref:`sección posterior <import-mod-attrs>`."
#: ../Doc/reference/import.rst:399
msgid ""
"Module execution is the key moment of loading in which the module's "
"namespace gets populated. Execution is entirely delegated to the loader, "
"which gets to decide what gets populated and how."
msgstr ""
"La ejecución del módulo es el momento clave de la carga en el que se rellena "
"el espacio de nombres del módulo. La ejecución se delega por completo en el "
"cargador, lo que llega a decidir qué se rellena y cómo."
#: ../Doc/reference/import.rst:403
msgid ""
"The module created during loading and passed to exec_module() may not be the "
"one returned at the end of import [#fnlo]_."
msgstr ""
"El módulo creado durante la carga y pasado a exec_module() puede no ser el "
"que se retorna al final de la importación [#fnlo]_."
#: ../Doc/reference/import.rst:406
msgid ""
"The import system has taken over the boilerplate responsibilities of "
"loaders. These were previously performed by the :meth:`importlib.abc.Loader."
"load_module` method."
msgstr ""
"El sistema de importación se ha hecho cargo de las responsabilidades "
"reutilizables de los cargadores. Estos fueron realizados previamente por el "
"método :meth:`importlib.abc.Loader.load_module`."
#: ../Doc/reference/import.rst:412
msgid "Loaders"
msgstr "Cargadores"
#: ../Doc/reference/import.rst:414
msgid ""
"Module loaders provide the critical function of loading: module execution. "
"The import machinery calls the :meth:`importlib.abc.Loader.exec_module` "
"method with a single argument, the module object to execute. Any value "
"returned from :meth:`~importlib.abc.Loader.exec_module` is ignored."
msgstr ""
"Los cargadores de módulos proporcionan la función crítica de carga: "
"ejecución del módulo. La maquinaria de importación llama al método :meth:"
"`importlib.abc.Loader.exec_module` con un único argumento, el objeto module "
"que se va a ejecutar. Se omite cualquier valor retornado de :meth:"
"`~importlib.abc.Loader.exec_module`."
#: ../Doc/reference/import.rst:419
msgid "Loaders must satisfy the following requirements:"
msgstr "Los cargadores deben cumplir los siguientes requisitos:"
#: ../Doc/reference/import.rst:421
msgid ""
"If the module is a Python module (as opposed to a built-in module or a "
"dynamically loaded extension), the loader should execute the module's code "
"in the module's global name space (``module.__dict__``)."
msgstr ""
"Si el módulo es un módulo Python (a diferencia de un módulo integrado o una "
"extensión cargada dinámicamente), el cargador debe ejecutar el código del "
"módulo en el espacio de nombres global del módulo (``module.__dict__``)."
#: ../Doc/reference/import.rst:425
msgid ""
"If the loader cannot execute the module, it should raise an :exc:"
"`ImportError`, although any other exception raised during :meth:`~importlib."
"abc.Loader.exec_module` will be propagated."
msgstr ""
"Si el cargador no puede ejecutar el módulo, debe generar un :exc:"
"`ImportError`, aunque se propagará cualquier otra excepción provocada "
"durante :meth:`~importlib.abc.Loader.exec_module`."
#: ../Doc/reference/import.rst:429
msgid ""
"In many cases, the finder and loader can be the same object; in such cases "
"the :meth:`~importlib.abc.MetaPathFinder.find_spec` method would just return "
"a spec with the loader set to ``self``."
msgstr ""
"En muchos casos, el buscador y el cargador pueden ser el mismo objeto; en "
"tales casos, el método :meth:`~importlib.abc.MetaPathFinder.find_spec` "
"simplemente retornaría una especificación con el cargador establecido en "
"``self``."
#: ../Doc/reference/import.rst:433
msgid ""
"Module loaders may opt in to creating the module object during loading by "
"implementing a :meth:`~importlib.abc.Loader.create_module` method. It takes "
"one argument, the module spec, and returns the new module object to use "
"during loading. ``create_module()`` does not need to set any attributes on "
"the module object. If the method returns ``None``, the import machinery "
"will create the new module itself."
msgstr ""
"Los cargadores de módulos pueden optar por crear el objeto de módulo durante "
"la carga mediante la implementación de un método :meth:`~importlib.abc."
"Loader.create_module`. Toma un argumento, la especificación del módulo, y "
"retorna el nuevo objeto de módulo que se usará durante la carga. "
"``create_module()`` no necesita establecer ningún atributo en el objeto "
"module. Si el método retorna ``None``, la maquinaria de importación creará "
"el nuevo módulo en sí."
#: ../Doc/reference/import.rst:440
msgid "The :meth:`~importlib.abc.Loader.create_module` method of loaders."
msgstr "El método de cargadores :meth:`~importlib.abc.Loader.create_module`."
#: ../Doc/reference/import.rst:443
msgid ""
"The :meth:`~importlib.abc.Loader.load_module` method was replaced by :meth:"
"`~importlib.abc.Loader.exec_module` and the import machinery assumed all the "
"boilerplate responsibilities of loading."
msgstr ""
"El método :meth:`~importlib.abc.Loader.load_module` fue reemplazado por :"
"meth:`~importlib.abc.Loader.exec_module` y la maquinaria de importación "
"asumió todas las responsabilidades reutilizables de la carga."
#: ../Doc/reference/import.rst:448
msgid ""
"For compatibility with existing loaders, the import machinery will use the "
"``load_module()`` method of loaders if it exists and the loader does not "
"also implement ``exec_module()``. However, ``load_module()`` has been "
"deprecated and loaders should implement ``exec_module()`` instead."
msgstr ""
"Para la compatibilidad con los cargadores existentes, la maquinaria de "
"importación utilizará el método de cargadores ``load_module()`` si existe y "
"el cargador no implementa también ``exec_module()``. Sin embargo, "
"``load_module()`` ha quedado obsoleto y los cargadores deben implementar "
"``exec_module()`` en su lugar."
#: ../Doc/reference/import.rst:453
msgid ""
"The ``load_module()`` method must implement all the boilerplate loading "
"functionality described above in addition to executing the module. All the "
"same constraints apply, with some additional clarification:"
msgstr ""
"El método ``load_module()`` debe implementar toda la funcionalidad de carga "
"reutilizable descrita anteriormente, además de ejecutar el módulo. Se "
"aplican todas las mismas restricciones, con algunas aclaraciones adicionales:"
#: ../Doc/reference/import.rst:457
msgid ""
"If there is an existing module object with the given name in :data:`sys."
"modules`, the loader must use that existing module. (Otherwise, :func:"
"`importlib.reload` will not work correctly.) If the named module does not "
"exist in :data:`sys.modules`, the loader must create a new module object and "
"add it to :data:`sys.modules`."
msgstr ""
"Si hay un objeto de módulo existente con el nombre dado en :data:`sys."
"modules`, el cargador debe utilizar ese módulo existente. (De lo contrario, :"
"func:`importlib.reload` no funcionará correctamente.) Si el módulo con "
"nombre no existe en :data:`sys.modules`, el cargador debe crear un nuevo "
"objeto de módulo y agregarlo a :data:`sys.modules`."
#: ../Doc/reference/import.rst:463
msgid ""
"The module *must* exist in :data:`sys.modules` before the loader executes "
"the module code, to prevent unbounded recursion or multiple loading."
msgstr ""
"El módulo *debe* existir en :data:`sys.modules` antes de que el cargador "
"ejecute el código del módulo, para evitar la recursividad sin límites o la "
"carga múltiple."
#: ../Doc/reference/import.rst:467
msgid ""
"If loading fails, the loader must remove any modules it has inserted into :"
"data:`sys.modules`, but it must remove **only** the failing module(s), and "
"only if the loader itself has loaded the module(s) explicitly."
msgstr ""
"Si se produce un error en la carga, el cargador debe quitar los módulos que "
"ha insertado en :data:`sys.modules`, pero debe quitar **solo** los módulos "
"con errores, y solo si el propio cargador ha cargado los módulos "
"explícitamente."
#: ../Doc/reference/import.rst:472
msgid ""
"A :exc:`DeprecationWarning` is raised when ``exec_module()`` is defined but "
"``create_module()`` is not."
msgstr ""
"A :exc:`DeprecationWarning` se genera cuando se define ``exec_module()`` "
"pero ``create_module()`` no lo es."
#: ../Doc/reference/import.rst:476
msgid ""
"An :exc:`ImportError` is raised when ``exec_module()`` is defined but "
"``create_module()`` is not."
msgstr ""
"Un :exc:`ImportError` se genera cuando ``exec_module()`` está definido, pero "
"``create_module()`` no lo es."
#: ../Doc/reference/import.rst:480
msgid "Use of ``load_module()`` will raise :exc:`ImportWarning`."
msgstr "El uso de ``load_module()`` lanzará :exc:`ImportWarning`."
#: ../Doc/reference/import.rst:484
msgid "Submodules"
msgstr "Submódulos"
#: ../Doc/reference/import.rst:486
msgid ""
"When a submodule is loaded using any mechanism (e.g. ``importlib`` APIs, the "
"``import`` or ``import-from`` statements, or built-in ``__import__()``) a "
"binding is placed in the parent module's namespace to the submodule object. "
"For example, if package ``spam`` has a submodule ``foo``, after importing "
"``spam.foo``, ``spam`` will have an attribute ``foo`` which is bound to the "
"submodule. Let's say you have the following directory structure::"
msgstr ""
"Cuando se carga un submódulo mediante cualquier mecanismo (por ejemplo, API "
"``importlib``, las instrucciones ``import`` o ``import-from``, o "
"``__import__()``) integradas, se coloca un enlace en el espacio de nombres "
"del módulo primario al objeto submodule. Por ejemplo, si el paquete ``spam`` "
"tiene un submódulo ``foo``, después de importar ``spam.foo``, ``spam`` "
"tendrá un atributo ``foo`` que está enlazado al submódulo. Supongamos que "
"tiene la siguiente estructura de directorios:"