-
Notifications
You must be signed in to change notification settings - Fork 395
/
Copy pathmodule.po
1154 lines (1022 loc) · 46.2 KB
/
module.po
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: 2021-12-09 10:51+0800\n"
"Last-Translator: Rodrigo Tobar <rtobarc@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/c-api/module.rst:6
msgid "Module Objects"
msgstr "Objetos módulo"
#: ../Doc/c-api/module.rst:15
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python module type. "
"This is exposed to Python programs as ``types.ModuleType``."
msgstr ""
"Esta instancia de :c:type:`PyTypeObject` representa el tipo de módulo "
"Python. Esto está expuesto a los programas de Python como ``types."
"ModuleType``."
#: ../Doc/c-api/module.rst:21
msgid ""
"Return true if *p* is a module object, or a subtype of a module object. This "
"function always succeeds."
msgstr ""
"Retorna verdadero si *p* es un objeto de módulo o un subtipo de un objeto de "
"módulo. Esta función siempre finaliza con éxito."
#: ../Doc/c-api/module.rst:27
msgid ""
"Return true if *p* is a module object, but not a subtype of :c:data:"
"`PyModule_Type`. This function always succeeds."
msgstr ""
"Retorna verdadero si *p* es un objeto módulo, pero no un subtipo de :c:data:"
"`PyModule_Type`. Esta función siempre finaliza con éxito."
#: ../Doc/c-api/module.rst:40
msgid ""
"Return a new module object with the :attr:`__name__` attribute set to "
"*name*. The module's :attr:`__name__`, :attr:`__doc__`, :attr:`__package__`, "
"and :attr:`__loader__` attributes are filled in (all but :attr:`__name__` "
"are set to ``None``); the caller is responsible for providing a :attr:"
"`__file__` attribute."
msgstr ""
"Retorna un nuevo objeto módulo con el atributo :attr:`__name__` establecido "
"en *name*. Los atributos del módulo :attr:`__name__`, :attr:`__doc__`, :attr:"
"`__package__`, y :attr:`__loader__` se completan (todos menos :attr:"
"`__name__` están configurados en ``None``); quien llama es responsable de "
"proporcionar un atributo :attr:`__file__`."
#: ../Doc/c-api/module.rst:46 ../Doc/c-api/module.rst:270
#: ../Doc/c-api/module.rst:472
msgid "Return ``NULL`` with an exception set on error."
msgstr ""
#: ../Doc/c-api/module.rst:50
msgid ":attr:`__package__` and :attr:`__loader__` are set to ``None``."
msgstr ""
":attr:`__package__` y :attr:`__loader__` están configurados en ``None``."
#: ../Doc/c-api/module.rst:56
msgid ""
"Similar to :c:func:`PyModule_NewObject`, but the name is a UTF-8 encoded "
"string instead of a Unicode object."
msgstr ""
"Similar a :c:func:`PyModule_NewObject`, pero el nombre es una cadena de "
"caracteres codificada UTF-8 en lugar de un objeto Unicode."
#: ../Doc/c-api/module.rst:64
msgid ""
"Return the dictionary object that implements *module*'s namespace; this "
"object is the same as the :attr:`~object.__dict__` attribute of the module "
"object. If *module* is not a module object (or a subtype of a module "
"object), :exc:`SystemError` is raised and ``NULL`` is returned."
msgstr ""
"Retorna el objeto del diccionario que implementa el espacio de nombres de "
"*module*; este objeto es el mismo que el atributo :attr:`~object.__dict__` "
"del objeto módulo. Si *module* no es un objeto módulo (o un subtipo de un "
"objeto de módulo), se lanza :exc:`SystemError` y se retorna ``NULL``."
#: ../Doc/c-api/module.rst:69
#, fuzzy
msgid ""
"It is recommended extensions use other ``PyModule_*`` and ``PyObject_*`` "
"functions rather than directly manipulate a module's :attr:`~object."
"__dict__`."
msgstr ""
"Se recomienda que las extensiones utilicen otras funciones :c:func:"
"`PyModule_\\*` y :c:func:`PyObject_\\*` en lugar de manipular directamente "
"el módulo :attr:`~object.__dict__`."
#: ../Doc/c-api/module.rst:80
msgid ""
"Return *module*'s :attr:`__name__` value. If the module does not provide "
"one, or if it is not a string, :exc:`SystemError` is raised and ``NULL`` is "
"returned."
msgstr ""
"Retorna el valor :attr:`__name__` del *module*. Si el módulo no proporciona "
"uno, o si no es una cadena de caracteres, :exc:`SystemError` se lanza y se "
"retorna ``NULL``."
#: ../Doc/c-api/module.rst:88
msgid ""
"Similar to :c:func:`PyModule_GetNameObject` but return the name encoded to "
"``'utf-8'``."
msgstr ""
"Similar a :c:func:`PyModule_GetNameObject` pero retorna el nombre codificado "
"a ``'utf-8'``."
#: ../Doc/c-api/module.rst:93
msgid ""
"Return the \"state\" of the module, that is, a pointer to the block of "
"memory allocated at module creation time, or ``NULL``. See :c:member:"
"`PyModuleDef.m_size`."
msgstr ""
"Retorna el \"estado\" del módulo, es decir, un puntero al bloque de memoria "
"asignado en el momento de la creación del módulo, o ``NULL``. Ver :c:member:"
"`PyModuleDef.m_size`."
#: ../Doc/c-api/module.rst:100
msgid ""
"Return a pointer to the :c:type:`PyModuleDef` struct from which the module "
"was created, or ``NULL`` if the module wasn't created from a definition."
msgstr ""
"Retorna un puntero a la estructura :c:type:`PyModuleDef` a partir de la cual "
"se creó el módulo, o ``NULL`` si el módulo no se creó a partir de una "
"definición."
#: ../Doc/c-api/module.rst:110
msgid ""
"Return the name of the file from which *module* was loaded using *module*'s :"
"attr:`__file__` attribute. If this is not defined, or if it is not a "
"unicode string, raise :exc:`SystemError` and return ``NULL``; otherwise "
"return a reference to a Unicode object."
msgstr ""
"Retorna el nombre del archivo desde el cual *module* se cargó utilizando el "
"atributo :attr:`__file__` del *module*. Si esto no está definido, o si no es "
"una cadena de caracteres unicode, lanza :exc:`SystemError` y retornar "
"``NULL``; de lo contrario, retorna una referencia a un objeto Unicode."
#: ../Doc/c-api/module.rst:120
msgid ""
"Similar to :c:func:`PyModule_GetFilenameObject` but return the filename "
"encoded to 'utf-8'."
msgstr ""
"Similar a :c:func:`PyModule_GetFilenameObject` pero retorna el nombre de "
"archivo codificado a 'utf-8'."
#: ../Doc/c-api/module.rst:123
#, fuzzy
msgid ""
":c:func:`PyModule_GetFilename` raises :exc:`UnicodeEncodeError` on "
"unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead."
msgstr ""
":c:func:`PyModule_GetFilename` lanza :c:type:`UnicodeEncodeError` en nombres "
"de archivo no codificables, use :c:func:`PyModule_GetFilenameObject` en su "
"lugar."
#: ../Doc/c-api/module.rst:131
msgid "Initializing C modules"
msgstr "Inicializando módulos en C"
#: ../Doc/c-api/module.rst:133
msgid ""
"Modules objects are usually created from extension modules (shared libraries "
"which export an initialization function), or compiled-in modules (where the "
"initialization function is added using :c:func:`PyImport_AppendInittab`). "
"See :ref:`building` or :ref:`extending-with-embedding` for details."
msgstr ""
"Los objetos módulos generalmente se crean a partir de módulos de extensión "
"(bibliotecas compartidas que exportan una función de inicialización) o "
"módulos compilados (donde la función de inicialización se agrega usando :c:"
"func:`PyImport_AppendInittab`). Consulte :ref:`building` o :ref:`extendiendo "
"con incrustación <extending-with-embedding>` para más detalles."
#: ../Doc/c-api/module.rst:138
msgid ""
"The initialization function can either pass a module definition instance to :"
"c:func:`PyModule_Create`, and return the resulting module object, or request "
"\"multi-phase initialization\" by returning the definition struct itself."
msgstr ""
"La función de inicialización puede pasar una instancia de definición de "
"módulo a :c:func:`PyModule_Create`, y retornar el objeto módulo resultante, "
"o solicitar una \"inicialización de múltiples fases\" retornando la "
"estructura de definición."
#: ../Doc/c-api/module.rst:144
msgid ""
"The module definition struct, which holds all information needed to create a "
"module object. There is usually only one statically initialized variable of "
"this type for each module."
msgstr ""
"La estructura de definición de módulo, que contiene toda la información "
"necesaria para crear un objeto módulo. Por lo general, solo hay una variable "
"estáticamente inicializada de este tipo para cada módulo."
#: ../Doc/c-api/module.rst:150
#, fuzzy
msgid "Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`."
msgstr "Siempre inicialice este miembro a :const:`PyModuleDef_HEAD_INIT`."
#: ../Doc/c-api/module.rst:154
msgid "Name for the new module."
msgstr "Nombre para el nuevo módulo."
#: ../Doc/c-api/module.rst:158
msgid ""
"Docstring for the module; usually a docstring variable created with :c:macro:"
"`PyDoc_STRVAR` is used."
msgstr ""
"Docstring para el módulo; por lo general, se usa una variable docstring "
"creada con :c:macro:`PyDoc_STRVAR`."
#: ../Doc/c-api/module.rst:163
msgid ""
"Module state may be kept in a per-module memory area that can be retrieved "
"with :c:func:`PyModule_GetState`, rather than in static globals. This makes "
"modules safe for use in multiple sub-interpreters."
msgstr ""
"El estado del módulo se puede mantener en un área de memoria por módulo que "
"se puede recuperar con :c:func:`PyModule_GetState`, en lugar de en globales "
"estáticos. Esto hace que los módulos sean seguros para su uso en múltiples "
"sub-interpretadores."
#: ../Doc/c-api/module.rst:167
#, fuzzy
msgid ""
"This memory area is allocated based on *m_size* on module creation, and "
"freed when the module object is deallocated, after the :c:member:"
"`~PyModuleDef.m_free` function has been called, if present."
msgstr ""
"Esta área de memoria se asigna en base a *m_size* en la creación del módulo, "
"y se libera cuando el objeto del módulo se desasigna, después de que se haya "
"llamado a la función :c:member:`m_free`, si está presente."
#: ../Doc/c-api/module.rst:171
msgid ""
"Setting ``m_size`` to ``-1`` means that the module does not support sub-"
"interpreters, because it has global state."
msgstr ""
"Establecer ``m_size`` en ``-1`` significa que el módulo no admite sub-"
"interpretadores, porque tiene un estado global."
#: ../Doc/c-api/module.rst:174
msgid ""
"Setting it to a non-negative value means that the module can be re-"
"initialized and specifies the additional amount of memory it requires for "
"its state. Non-negative ``m_size`` is required for multi-phase "
"initialization."
msgstr ""
"Establecerlo en un valor no negativo significa que el módulo se puede "
"reinicializar y especifica la cantidad adicional de memoria que requiere "
"para su estado. Se requiere ``m_size`` no negativo para la inicialización de "
"múltiples fases."
#: ../Doc/c-api/module.rst:179
msgid "See :PEP:`3121` for more details."
msgstr "Ver :PEP:`3121` para más detalles."
#: ../Doc/c-api/module.rst:183
msgid ""
"A pointer to a table of module-level functions, described by :c:type:"
"`PyMethodDef` values. Can be ``NULL`` if no functions are present."
msgstr ""
"Un puntero a una tabla de funciones de nivel de módulo, descrito por "
"valores :c:type:`PyMethodDef`. Puede ser ``NULL`` si no hay funciones "
"presentes."
#: ../Doc/c-api/module.rst:188
msgid ""
"An array of slot definitions for multi-phase initialization, terminated by a "
"``{0, NULL}`` entry. When using single-phase initialization, *m_slots* must "
"be ``NULL``."
msgstr ""
"Un conjunto de definiciones de ranura para la inicialización de múltiples "
"fases, terminadas por una entrada ``{0, NULL}``. Cuando se utiliza la "
"inicialización monofásica, *m_slots* debe ser ``NULL``."
#: ../Doc/c-api/module.rst:194
msgid ""
"Prior to version 3.5, this member was always set to ``NULL``, and was "
"defined as:"
msgstr ""
"Antes de la versión 3.5, este miembro siempre estaba configurado en ``NULL`` "
"y se definía como:"
#: ../Doc/c-api/module.rst:201
msgid ""
"A traversal function to call during GC traversal of the module object, or "
"``NULL`` if not needed."
msgstr ""
"Una función transversal para llamar durante el recorrido GC del objeto del "
"módulo, o ``NULL`` si no es necesario."
#: ../Doc/c-api/module.rst:204 ../Doc/c-api/module.rst:219
#: ../Doc/c-api/module.rst:240
#, fuzzy
msgid ""
"This function is not called if the module state was requested but is not "
"allocated yet. This is the case immediately after the module is created and "
"before the module is executed (:c:data:`Py_mod_exec` function). More "
"precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is "
"greater than 0 and the module state (as returned by :c:func:"
"`PyModule_GetState`) is ``NULL``."
msgstr ""
"Esta función no se llama si se solicitó el estado del módulo pero aún no se "
"asignó. Este es el caso inmediatamente después de que se crea el módulo y "
"antes de que se ejecute (la función :c:data:`Py_mod_exec`). Más "
"precisamente, esta función no se llama si :c:member:`m_size` es mayor que 0 "
"y el estado del módulo (como lo retorna :c:func:`PyModule_GetState`) es "
"``NULL``."
#: ../Doc/c-api/module.rst:211 ../Doc/c-api/module.rst:232
#: ../Doc/c-api/module.rst:247
msgid "No longer called before the module state is allocated."
msgstr "Ya no se llama antes de que se asigne el estado del módulo."
#: ../Doc/c-api/module.rst:216
msgid ""
"A clear function to call during GC clearing of the module object, or "
"``NULL`` if not needed."
msgstr ""
"Una función clara para llamar durante la limpieza GC del objeto del módulo, "
"o ``NULL`` si no es necesario."
#: ../Doc/c-api/module.rst:226
msgid ""
"Like :c:member:`PyTypeObject.tp_clear`, this function is not *always* called "
"before a module is deallocated. For example, when reference counting is "
"enough to determine that an object is no longer used, the cyclic garbage "
"collector is not involved and :c:member:`~PyModuleDef.m_free` is called "
"directly."
msgstr ""
"Tal como :c:member:`PyTypeObject.tp_clear`, esta función no *siempre* es "
"llamada antes de la designación de un módulo. Por ejemplo, cuando el "
"recuento de referencias está listo para determinar que un objeto no se usa "
"más, la recolección de basura cíclica no se involucra y se llama a :c:member:"
"`~PyModuleDef.m_free` directamente."
#: ../Doc/c-api/module.rst:237
msgid ""
"A function to call during deallocation of the module object, or ``NULL`` if "
"not needed."
msgstr ""
"Una función para llamar durante la desasignación del objeto del módulo, o "
"``NULL`` si no es necesario."
#: ../Doc/c-api/module.rst:251
msgid "Single-phase initialization"
msgstr "Inicialización monofásica"
#: ../Doc/c-api/module.rst:253
msgid ""
"The module initialization function may create and return the module object "
"directly. This is referred to as \"single-phase initialization\", and uses "
"one of the following two module creation functions:"
msgstr ""
"La función de inicialización del módulo puede crear y retornar el objeto "
"módulo directamente. Esto se conoce como \"inicialización monofásica\" y "
"utiliza una de las siguientes funciones de creación de dos módulos:"
#: ../Doc/c-api/module.rst:259
#, fuzzy
msgid ""
"Create a new module object, given the definition in *def*. This behaves "
"like :c:func:`PyModule_Create2` with *module_api_version* set to :c:macro:"
"`PYTHON_API_VERSION`."
msgstr ""
"Crea un nuevo objeto módulo, dada la definición en *def*. Esto se comporta "
"como :c:func:`PyModule_Create2` con *module_api_version* establecido en :"
"const:`PYTHON_API_VERSION`."
#: ../Doc/c-api/module.rst:266
msgid ""
"Create a new module object, given the definition in *def*, assuming the API "
"version *module_api_version*. If that version does not match the version of "
"the running interpreter, a :exc:`RuntimeWarning` is emitted."
msgstr ""
"Crea un nuevo objeto de módulo, dada la definición en *def*, asumiendo la "
"versión de API *module_api_version*. Si esa versión no coincide con la "
"versión del intérprete en ejecución, se emite un :exc:`RuntimeWarning`."
#: ../Doc/c-api/module.rst:274
msgid ""
"Most uses of this function should be using :c:func:`PyModule_Create` "
"instead; only use this if you are sure you need it."
msgstr ""
"La mayoría de los usos de esta función deberían usar :c:func:"
"`PyModule_Create` en su lugar; solo use esto si está seguro de que lo "
"necesita."
#: ../Doc/c-api/module.rst:277
msgid ""
"Before it is returned from in the initialization function, the resulting "
"module object is typically populated using functions like :c:func:"
"`PyModule_AddObjectRef`."
msgstr ""
"Antes de que se retorne desde la función de inicialización, el objeto del "
"módulo resultante normalmente se llena utilizando funciones como :c:func:"
"`PyModule_AddObjectRef`."
#: ../Doc/c-api/module.rst:283
msgid "Multi-phase initialization"
msgstr "Inicialización multifase"
#: ../Doc/c-api/module.rst:285
#, fuzzy
msgid ""
"An alternate way to specify extensions is to request \"multi-phase "
"initialization\". Extension modules created this way behave more like Python "
"modules: the initialization is split between the *creation phase*, when the "
"module object is created, and the *execution phase*, when it is populated. "
"The distinction is similar to the :py:meth:`!__new__` and :py:meth:`!"
"__init__` methods of classes."
msgstr ""
"Una forma alternativa de especificar extensiones es solicitar una "
"\"inicialización de múltiples fases\". Los módulos de extensión creados de "
"esta manera se comportan más como los módulos de Python: la inicialización "
"se divide entre la fase de creación (*creation phase*), cuando se crea el "
"objeto módulo, y la fase de ejecución (*execution phase*), cuando se llena. "
"La distinción es similar a los métodos de clases :py:meth:`__new__` y :py:"
"meth:`__init__`."
#: ../Doc/c-api/module.rst:292
#, fuzzy
msgid ""
"Unlike modules created using single-phase initialization, these modules are "
"not singletons: if the *sys.modules* entry is removed and the module is re-"
"imported, a new module object is created, and the old module is subject to "
"normal garbage collection -- as with Python modules. By default, multiple "
"modules created from the same definition should be independent: changes to "
"one should not affect the others. This means that all state should be "
"specific to the module object (using e.g. using :c:func:"
"`PyModule_GetState`), or its contents (such as the module's :attr:`~object."
"__dict__` or individual classes created with :c:func:`PyType_FromSpec`)."
msgstr ""
"A diferencia de los módulos creados con la inicialización monofásica, estos "
"módulos no son singletons: si se elimina la entrada *sys.modules* y el "
"módulo se vuelve a importar, se crea un nuevo objeto módulo y el módulo "
"anterior está sujeto a la recolección normal de basura -- Al igual que con "
"los módulos de Python. Por defecto, los módulos múltiples creados a partir "
"de la misma definición deberían ser independientes: los cambios en uno no "
"deberían afectar a los demás. Esto significa que todo el estado debe ser "
"específico para el objeto del módulo (usando, por ejemplo, usando :c:func:"
"`PyModule_GetState`), o su contenido (como el módulo :attr:`__dict__` o "
"clases individuales creadas con :c:func:`PyType_FromSpec`)."
#: ../Doc/c-api/module.rst:302
msgid ""
"All modules created using multi-phase initialization are expected to "
"support :ref:`sub-interpreters <sub-interpreter-support>`. Making sure "
"multiple modules are independent is typically enough to achieve this."
msgstr ""
"Se espera que todos los módulos creados mediante la inicialización de "
"múltiples fases admitan :ref:`sub-interpretadores <sub-interpreter-"
"support>`. Asegurándose de que varios módulos sean independientes suele ser "
"suficiente para lograr esto."
#: ../Doc/c-api/module.rst:306
msgid ""
"To request multi-phase initialization, the initialization function "
"(PyInit_modulename) returns a :c:type:`PyModuleDef` instance with non-empty :"
"c:member:`~PyModuleDef.m_slots`. Before it is returned, the ``PyModuleDef`` "
"instance must be initialized with the following function:"
msgstr ""
"Para solicitar la inicialización de múltiples fases, la función de "
"inicialización (*PyInit_modulename*) retorna una instancia de :c:type:"
"`PyModuleDef` con un :c:member:`~PyModuleDef.m_slots` no vacío. Antes de que "
"se retorna, la instancia ``PyModuleDef`` debe inicializarse con la siguiente "
"función:"
#: ../Doc/c-api/module.rst:313
msgid ""
"Ensures a module definition is a properly initialized Python object that "
"correctly reports its type and reference count."
msgstr ""
"Asegura que la definición de un módulo sea un objeto Python correctamente "
"inicializado que informe correctamente su tipo y conteo de referencias."
#: ../Doc/c-api/module.rst:316
msgid "Returns *def* cast to ``PyObject*``, or ``NULL`` if an error occurred."
msgstr ""
"Retorna *def* convertido a ``PyObject*`` o ``NULL`` si se produjo un error."
#: ../Doc/c-api/module.rst:320
msgid ""
"The *m_slots* member of the module definition must point to an array of "
"``PyModuleDef_Slot`` structures:"
msgstr ""
"El miembro *m_slots* de la definición del módulo debe apuntar a un arreglo "
"de estructuras ``PyModuleDef_Slot``:"
#: ../Doc/c-api/module.rst:327
msgid "A slot ID, chosen from the available values explained below."
msgstr ""
"Una ranura ID, elegida entre los valores disponibles que se explican a "
"continuación."
#: ../Doc/c-api/module.rst:331
msgid "Value of the slot, whose meaning depends on the slot ID."
msgstr "Valor de la ranura, cuyo significado depende de la ID de la ranura."
#: ../Doc/c-api/module.rst:335
msgid "The *m_slots* array must be terminated by a slot with id 0."
msgstr "El arreglo *m_slots* debe estar terminada por una ranura con id 0."
#: ../Doc/c-api/module.rst:337
msgid "The available slot types are:"
msgstr "Los tipos de ranura disponibles son:"
#: ../Doc/c-api/module.rst:341
msgid ""
"Specifies a function that is called to create the module object itself. The "
"*value* pointer of this slot must point to a function of the signature:"
msgstr ""
"Especifica una función que se llama para crear el objeto del módulo en sí. "
"El puntero *value* de este espacio debe apuntar a una función de la firma:"
#: ../Doc/c-api/module.rst:348
msgid ""
"The function receives a :py:class:`~importlib.machinery.ModuleSpec` "
"instance, as defined in :PEP:`451`, and the module definition. It should "
"return a new module object, or set an error and return ``NULL``."
msgstr ""
"La función recibe una instancia de :py:class:`~importlib.machinery."
"ModuleSpec`, como se define en :PEP:`451`, y la definición del módulo. "
"Debería retornar un nuevo objeto de módulo, o establecer un error y retornar "
"``NULL``."
#: ../Doc/c-api/module.rst:353
msgid ""
"This function should be kept minimal. In particular, it should not call "
"arbitrary Python code, as trying to import the same module again may result "
"in an infinite loop."
msgstr ""
"Esta función debe mantenerse mínima. En particular, no debería llamar a "
"código arbitrario de Python, ya que intentar importar el mismo módulo "
"nuevamente puede dar como resultado un bucle infinito."
#: ../Doc/c-api/module.rst:357
msgid ""
"Multiple ``Py_mod_create`` slots may not be specified in one module "
"definition."
msgstr ""
"Múltiples ranuras ``Py_mod_create`` no pueden especificarse en una "
"definición de módulo."
#: ../Doc/c-api/module.rst:360
msgid ""
"If ``Py_mod_create`` is not specified, the import machinery will create a "
"normal module object using :c:func:`PyModule_New`. The name is taken from "
"*spec*, not the definition, to allow extension modules to dynamically adjust "
"to their place in the module hierarchy and be imported under different names "
"through symlinks, all while sharing a single module definition."
msgstr ""
"Si no se especifica ``Py_mod_create``, la maquinaria de importación creará "
"un objeto de módulo normal usando :c:func:`PyModule_New`. El nombre se toma "
"de *spec*, no de la definición, para permitir que los módulos de extensión "
"se ajusten dinámicamente a su lugar en la jerarquía de módulos y se importen "
"bajo diferentes nombres a través de enlaces simbólicos, todo mientras se "
"comparte una definición de módulo único."
#: ../Doc/c-api/module.rst:366
msgid ""
"There is no requirement for the returned object to be an instance of :c:type:"
"`PyModule_Type`. Any type can be used, as long as it supports setting and "
"getting import-related attributes. However, only ``PyModule_Type`` instances "
"may be returned if the ``PyModuleDef`` has non-``NULL`` ``m_traverse``, "
"``m_clear``, ``m_free``; non-zero ``m_size``; or slots other than "
"``Py_mod_create``."
msgstr ""
"No es necesario que el objeto retornado sea una instancia de :c:type:"
"`PyModule_Type`. Se puede usar cualquier tipo, siempre que admita la "
"configuración y la obtención de atributos relacionados con la importación. "
"Sin embargo, solo se pueden retornar instancias ``PyModule_Type`` si el "
"``PyModuleDef`` no tiene ``NULL`` ``m_traverse``, ``m_clear``, ``m_free``; "
"``m_size`` distinto de cero; o ranuras que no sean ``Py_mod_create``."
#: ../Doc/c-api/module.rst:375
msgid ""
"Specifies a function that is called to *execute* the module. This is "
"equivalent to executing the code of a Python module: typically, this "
"function adds classes and constants to the module. The signature of the "
"function is:"
msgstr ""
"Especifica una función que se llama para ejecutar (*execute*) el módulo. "
"Esto es equivalente a ejecutar el código de un módulo Python: por lo "
"general, esta función agrega clases y constantes al módulo. La firma de la "
"función es:"
#: ../Doc/c-api/module.rst:384
msgid ""
"If multiple ``Py_mod_exec`` slots are specified, they are processed in the "
"order they appear in the *m_slots* array."
msgstr ""
"Si se especifican varias ranuras ``Py_mod_exec``, se procesan en el orden en "
"que aparecen en el arreglo *m_slots*."
#: ../Doc/c-api/module.rst:389 ../Doc/c-api/module.rst:422
msgid "Specifies one of the following values:"
msgstr ""
#: ../Doc/c-api/module.rst:395
msgid "The module does not support being imported in subinterpreters."
msgstr ""
#: ../Doc/c-api/module.rst:399
msgid ""
"The module supports being imported in subinterpreters, but only when they "
"share the main interpreter's GIL. (See :ref:`isolating-extensions-howto`.)"
msgstr ""
#: ../Doc/c-api/module.rst:405
msgid ""
"The module supports being imported in subinterpreters, even when they have "
"their own GIL. (See :ref:`isolating-extensions-howto`.)"
msgstr ""
#: ../Doc/c-api/module.rst:409
msgid ""
"This slot determines whether or not importing this module in a "
"subinterpreter will fail."
msgstr ""
#: ../Doc/c-api/module.rst:412
#, fuzzy
msgid ""
"Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one "
"module definition."
msgstr ""
"Múltiples ranuras ``Py_mod_create`` no pueden especificarse en una "
"definición de módulo."
#: ../Doc/c-api/module.rst:415
msgid ""
"If ``Py_mod_multiple_interpreters`` is not specified, the import machinery "
"defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED``."
msgstr ""
#: ../Doc/c-api/module.rst:428
msgid ""
"The module depends on the presence of the global interpreter lock (GIL), and "
"may access global state without synchronization."
msgstr ""
#: ../Doc/c-api/module.rst:433
msgid "The module is safe to run without an active GIL."
msgstr ""
#: ../Doc/c-api/module.rst:435
msgid ""
"This slot is ignored by Python builds not configured with :option:`--disable-"
"gil`. Otherwise, it determines whether or not importing this module will "
"cause the GIL to be automatically enabled. See :ref:`whatsnew313-free-"
"threaded-cpython` for more detail."
msgstr ""
#: ../Doc/c-api/module.rst:440
#, fuzzy
msgid ""
"Multiple ``Py_mod_gil`` slots may not be specified in one module definition."
msgstr ""
"Múltiples ranuras ``Py_mod_create`` no pueden especificarse en una "
"definición de módulo."
#: ../Doc/c-api/module.rst:442
msgid ""
"If ``Py_mod_gil`` is not specified, the import machinery defaults to "
"``Py_MOD_GIL_USED``."
msgstr ""
#: ../Doc/c-api/module.rst:447
msgid "See :PEP:`489` for more details on multi-phase initialization."
msgstr ""
"Ver :PEP:`489` para más detalles sobre la inicialización de múltiples fases."
#: ../Doc/c-api/module.rst:450
msgid "Low-level module creation functions"
msgstr "Funciones de creación de módulos de bajo nivel"
#: ../Doc/c-api/module.rst:452
msgid ""
"The following functions are called under the hood when using multi-phase "
"initialization. They can be used directly, for example when creating module "
"objects dynamically. Note that both ``PyModule_FromDefAndSpec`` and "
"``PyModule_ExecDef`` must be called to fully initialize a module."
msgstr ""
"Las siguientes funciones se invocan en segundo plano cuando se utiliza la "
"inicialización de múltiples fases. Se pueden usar directamente, por ejemplo, "
"al crear objetos de módulo de forma dinámica. Tenga en cuenta que tanto "
"``PyModule_FromDefAndSpec`` como ``PyModule_ExecDef`` deben llamarse para "
"inicializar completamente un módulo."
#: ../Doc/c-api/module.rst:459
#, fuzzy
msgid ""
"Create a new module object, given the definition in *def* and the ModuleSpec "
"*spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` with "
"*module_api_version* set to :c:macro:`PYTHON_API_VERSION`."
msgstr ""
"Cree un nuevo objeto módulo, dada la definición en *module* y ModuleSpec "
"*spec*. Esto se comporta como :c:func:`PyModule_FromDefAndSpec2` con "
"*module_api_version* establecido en :const:`PYTHON_API_VERSION`."
#: ../Doc/c-api/module.rst:467
#, fuzzy
msgid ""
"Create a new module object, given the definition in *def* and the ModuleSpec "
"*spec*, assuming the API version *module_api_version*. If that version does "
"not match the version of the running interpreter, a :exc:`RuntimeWarning` is "
"emitted."
msgstr ""
"Cree un nuevo objeto módulo, dada la definición en *module* y ModuleSpec "
"*spec*, asumiendo la versión de API *module_api_version*. Si esa versión no "
"coincide con la versión del intérprete en ejecución, se emite un :exc:"
"`RuntimeWarning`."
#: ../Doc/c-api/module.rst:476
msgid ""
"Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` "
"instead; only use this if you are sure you need it."
msgstr ""
"La mayoría de los usos de esta función deberían usar :c:func:"
"`PyModule_FromDefAndSpec` en su lugar; solo use esto si está seguro de que "
"lo necesita."
#: ../Doc/c-api/module.rst:483
msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*."
msgstr ""
"Procesa cualquier ranura de ejecución (:c:data:`Py_mod_exec`) dado en *def*."
#: ../Doc/c-api/module.rst:489
msgid ""
"Set the docstring for *module* to *docstring*. This function is called "
"automatically when creating a module from ``PyModuleDef``, using either "
"``PyModule_Create`` or ``PyModule_FromDefAndSpec``."
msgstr ""
"Establece la cadena de caracteres de documentación para *module* en "
"*docstring*. Esta función se llama automáticamente cuando se crea un módulo "
"desde ``PyModuleDef``, usando ``PyModule_Create`` o "
"``PyModule_FromDefAndSpec``."
#: ../Doc/c-api/module.rst:498
msgid ""
"Add the functions from the ``NULL`` terminated *functions* array to "
"*module*. Refer to the :c:type:`PyMethodDef` documentation for details on "
"individual entries (due to the lack of a shared module namespace, module "
"level \"functions\" implemented in C typically receive the module as their "
"first parameter, making them similar to instance methods on Python classes). "
"This function is called automatically when creating a module from "
"``PyModuleDef``, using either ``PyModule_Create`` or "
"``PyModule_FromDefAndSpec``."
msgstr ""
"Agrega las funciones del arreglo *functions* terminadas en ``NULL`` a "
"*module*. Consulte la documentación de :c:type:`PyMethodDef` para obtener "
"detalles sobre entradas individuales (debido a la falta de un espacio de "
"nombres de módulo compartido, las \"funciones\" de nivel de módulo "
"implementadas en C generalmente reciben el módulo como su primer parámetro, "
"haciéndolos similares a la instancia métodos en clases de Python). Esta "
"función se llama automáticamente cuando se crea un módulo desde "
"``PyModuleDef``, usando ``PyModule_Create`` o ``PyModule_FromDefAndSpec``."
#: ../Doc/c-api/module.rst:510
msgid "Support functions"
msgstr "Funciones de soporte"
#: ../Doc/c-api/module.rst:512
msgid ""
"The module initialization function (if using single phase initialization) or "
"a function called from a module execution slot (if using multi-phase "
"initialization), can use the following functions to help initialize the "
"module state:"
msgstr ""
"La función de inicialización del módulo (si usa la inicialización de fase "
"única) o una función llamada desde un intervalo de ejecución del módulo (si "
"usa la inicialización de múltiples fases), puede usar las siguientes "
"funciones para ayudar a inicializar el estado del módulo:"
#: ../Doc/c-api/module.rst:519
msgid ""
"Add an object to *module* as *name*. This is a convenience function which "
"can be used from the module's initialization function."
msgstr ""
"Agrega un objeto a *module* como *name*. Esta es una función de conveniencia "
"que se puede usar desde la función de inicialización del módulo."
#: ../Doc/c-api/module.rst:522
msgid ""
"On success, return ``0``. On error, raise an exception and return ``-1``."
msgstr ""
"En caso de éxito, retorna ``0``. En caso de error, lanza una excepción y "
"retorna ``-1``."
#: ../Doc/c-api/module.rst:524
#, fuzzy
msgid ""
"Return ``-1`` if *value* is ``NULL``. It must be called with an exception "
"raised in this case."
msgstr ""
"Retorna ``NULL`` si *value* es ``NULL``. Debe llamarse lanzando una "
"excepción en este caso."
#: ../Doc/c-api/module.rst:527 ../Doc/c-api/module.rst:574
#: ../Doc/c-api/module.rst:601
msgid "Example usage::"
msgstr "Ejemplo de uso ::"
#: ../Doc/c-api/module.rst:529
msgid ""
"static int\n"
"add_spam(PyObject *module, int value)\n"
"{\n"
" PyObject *obj = PyLong_FromLong(value);\n"
" if (obj == NULL) {\n"
" return -1;\n"
" }\n"
" int res = PyModule_AddObjectRef(module, \"spam\", obj);\n"
" Py_DECREF(obj);\n"
" return res;\n"
" }"
msgstr ""
#: ../Doc/c-api/module.rst:541
msgid ""
"The example can also be written without checking explicitly if *obj* is "
"``NULL``::"
msgstr ""
"El ejemplo puede también ser escrito sin verificar explicitamente si *obj* "
"es ``NULL``::"
#: ../Doc/c-api/module.rst:544
msgid ""
"static int\n"
"add_spam(PyObject *module, int value)\n"
"{\n"
" PyObject *obj = PyLong_FromLong(value);\n"
" int res = PyModule_AddObjectRef(module, \"spam\", obj);\n"
" Py_XDECREF(obj);\n"
" return res;\n"
" }"
msgstr ""
#: ../Doc/c-api/module.rst:553
msgid ""
"Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this "
"case, since *obj* can be ``NULL``."
msgstr ""
"Note que ``Py_XDECREF()`` debería ser usado en vez de ``Py_DECREF()`` en "
"este caso, ya que *obj* puede ser ``NULL``."
#: ../Doc/c-api/module.rst:556
msgid ""
"The number of different *name* strings passed to this function should be "
"kept small, usually by only using statically allocated strings as *name*. "
"For names that aren't known at compile time, prefer calling :c:func:"
"`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` directly. For more "
"details, see :c:func:`PyUnicode_InternFromString`, which may be used "
"internally to create a key object."
msgstr ""
#: ../Doc/c-api/module.rst:569
msgid ""
"Similar to :c:func:`PyModule_AddObjectRef`, but \"steals\" a reference to "
"*value*. It can be called with a result of function that returns a new "
"reference without bothering to check its result or even saving it to a "
"variable."
msgstr ""
#: ../Doc/c-api/module.rst:576
msgid ""
"if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n"
" goto error;\n"
"}"
msgstr ""
#: ../Doc/c-api/module.rst:585
msgid ""
"Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to "
"*value* on success (if it returns ``0``)."
msgstr ""
"Similar a :c:func:`PyModule_AddObjectRef`, pero roba una referencia a "
"*value* en caso de éxito (en este caso retorna ``0``)."
#: ../Doc/c-api/module.rst:588
#, fuzzy
msgid ""
"The new :c:func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions "
"are recommended, since it is easy to introduce reference leaks by misusing "
"the :c:func:`PyModule_AddObject` function."
msgstr ""
"Se recomienda la nueva función :c:func:`PyModule_AddObjectRef`, ya que es "
"sencillo introducir fugas de referencias por un uso incorrecto de la "
"función :c:func:`PyModule_AddObject`."
#: ../Doc/c-api/module.rst:595
#, fuzzy
msgid ""
"Unlike other functions that steal references, ``PyModule_AddObject()`` only "
"releases the reference to *value* **on success**."
msgstr ""
"A diferencia de otras funciones que roban referencias, "
"``PyModule_AddObject()`` solo disminuye el conteo de referencias de *value* "
"**en caso de éxito**."
#: ../Doc/c-api/module.rst:598
#, fuzzy
msgid ""
"This means that its return value must be checked, and calling code must :c:"
"func:`Py_XDECREF` *value* manually on error."
msgstr ""
"Esto significa que su valor de retorno debe ser verificado, y el código de "
"llamada debe :c:func:`Py_DECREF` *value* manualmente en caso de error."
#: ../Doc/c-api/module.rst:603
msgid ""
"PyObject *obj = PyBytes_FromString(value);\n"
"if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n"
" // If 'obj' is not NULL and PyModule_AddObject() failed,\n"
" // 'obj' strong reference must be deleted with Py_XDECREF().\n"
" // If 'obj' is NULL, Py_XDECREF() does nothing.\n"
" Py_XDECREF(obj);\n"
" goto error;\n"
"}\n"
"// PyModule_AddObject() stole a reference to obj:\n"
"// Py_XDECREF(obj) is not needed here."
msgstr ""
#: ../Doc/c-api/module.rst:616
msgid ":c:func:`PyModule_AddObject` is :term:`soft deprecated`."
msgstr ""
#: ../Doc/c-api/module.rst:621
#, fuzzy
msgid ""
"Add an integer constant to *module* as *name*. This convenience function "
"can be used from the module's initialization function. Return ``-1`` with an "
"exception set on error, ``0`` on success."
msgstr ""
"Agrega una constante entera a *module* como *name*. Esta función de "
"conveniencia se puede usar desde la función de inicialización del módulo. "
"Retorna ``-1`` en caso de error, ``0`` en caso de éxito."
#: ../Doc/c-api/module.rst:625
msgid ""
"This is a convenience function that calls :c:func:`PyLong_FromLong` and :c:"
"func:`PyModule_AddObjectRef`; see their documentation for details."
msgstr ""
#: ../Doc/c-api/module.rst:631
#, fuzzy
msgid ""
"Add a string constant to *module* as *name*. This convenience function can "
"be used from the module's initialization function. The string *value* must "
"be ``NULL``-terminated. Return ``-1`` with an exception set on error, ``0`` "
"on success."
msgstr ""
"Agrega una constante de cadena a *module* como *name*. Esta función de "
"conveniencia se puede usar desde la función de inicialización del módulo. La "
"cadena de caracteres *value* debe estar terminada en ``NULL``. Retorna "
"``-1`` en caso de error, ``0`` en caso de éxito."
#: ../Doc/c-api/module.rst:636
msgid ""
"This is a convenience function that calls :c:func:"
"`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; see their "
"documentation for details."
msgstr ""
#: ../Doc/c-api/module.rst:643
#, fuzzy
msgid ""
"Add an int constant to *module*. The name and the value are taken from "
"*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int "
"constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` "
"with an exception set on error, ``0`` on success."
msgstr ""
"Agrega una constante int a *module*. El nombre y el valor se toman de "
"*macro*. Por ejemplo, ``PyModule_AddIntMacro(module, AF_INET)`` agrega la "
"constante int *AF_INET* con el valor de *AF_INET* a *module*. Retorna ``-1`` "
"en caso de error, ``0`` en caso de éxito."
#: ../Doc/c-api/module.rst:651
msgid "Add a string constant to *module*."
msgstr "Agrega una constante de cadena de caracteres a *module*."