/
2.3.po
3503 lines (3179 loc) · 171 KB
/
2.3.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: 2021-10-16 21:42+0200\n"
"PO-Revision-Date: 2021-09-25 10:30+0100\n"
"Last-Translator: Claudia Millan <clmilneb@gmail.com>\n"
"Language-Team: python-doc-es\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"Generated-By: Babel 2.9.1\n"
#: ../Doc/whatsnew/2.3.rst:3
msgid "What's New in Python 2.3"
msgstr "Qué hay de nuevo en Python 2.3"
#: ../Doc/whatsnew/2.3.rst
msgid "Author"
msgstr "Autor"
#: ../Doc/whatsnew/2.3.rst:5
msgid "A.M. Kuchling"
msgstr "A.M. Kuchling"
#: ../Doc/whatsnew/2.3.rst:11
msgid ""
"This article explains the new features in Python 2.3. Python 2.3 was "
"released on July 29, 2003."
msgstr ""
"Este artículo explica las nuevas características de Python 2.3. Python 2.3 "
"se publicó el 29 de julio de 2003."
#: ../Doc/whatsnew/2.3.rst:14
msgid ""
"The main themes for Python 2.3 are polishing some of the features added in "
"2.2, adding various small but useful enhancements to the core language, and "
"expanding the standard library. The new object model introduced in the "
"previous version has benefited from 18 months of bugfixes and from "
"optimization efforts that have improved the performance of new-style "
"classes. A few new built-in functions have been added such as :func:`sum` "
"and :func:`enumerate`. The :keyword:`in` operator can now be used for "
"substring searches (e.g. ``\"ab\" in \"abc\"`` returns :const:`True`)."
msgstr ""
"Los temas principales de Python 2.3 son el pulido de algunas de las "
"características añadidas en la 2.2, la adición de varias mejoras pequeñas "
"pero útiles al núcleo del lenguaje y la ampliación de la biblioteca "
"estándar. El nuevo modelo de objetos introducido en la versión anterior se "
"ha beneficiado de 18 meses de correcciones de errores y de esfuerzos de "
"optimización que han mejorado el rendimiento de las clases de nuevo estilo. "
"Se han añadido algunas funciones incorporadas, como :func:`sum` y :func:"
"`enumerate`. El operador :keyword:`in` puede utilizarse ahora para "
"búsquedas de subcadenas (por ejemplo, ``\"ab\" en \"abc\"`` retorna :const:"
"`True`)."
#: ../Doc/whatsnew/2.3.rst:23
msgid ""
"Some of the many new library features include Boolean, set, heap, and date/"
"time data types, the ability to import modules from ZIP-format archives, "
"metadata support for the long-awaited Python catalog, an updated version of "
"IDLE, and modules for logging messages, wrapping text, parsing CSV files, "
"processing command-line options, using BerkeleyDB databases... the list of "
"new and enhanced modules is lengthy."
msgstr ""
"Algunas de las nuevas características de la biblioteca son los tipos de "
"datos booleanos, de conjunto, de montón y de fecha/hora, la posibilidad de "
"importar módulos desde archivos con formato ZIP, el soporte de metadatos "
"para el tan esperado catálogo de Python, una versión actualizada de IDLE y "
"módulos para registrar mensajes, envolver texto, analizar archivos CSV, "
"procesar opciones de línea de comandos, utilizar bases de datos "
"BerkeleyDB... la lista de módulos nuevos y mejorados es larga."
#: ../Doc/whatsnew/2.3.rst:30
msgid ""
"This article doesn't attempt to provide a complete specification of the new "
"features, but instead provides a convenient overview. For full details, you "
"should refer to the documentation for Python 2.3, such as the Python Library "
"Reference and the Python Reference Manual. If you want to understand the "
"complete implementation and design rationale, refer to the PEP for a "
"particular new feature."
msgstr ""
"Este artículo no pretende proporcionar una especificación completa de las "
"nuevas características, sino que proporciona una visión general "
"conveniente. Para obtener todos los detalles, debes consultar la "
"documentación de Python 2.3, como la Referencia de la Biblioteca de Python y "
"el Manual de Referencia de Python. Si quieres entender la implementación "
"completa y los fundamentos del diseño, consulta el PEP de una nueva "
"característica en particular."
#: ../Doc/whatsnew/2.3.rst:41
msgid "PEP 218: A Standard Set Datatype"
msgstr "PEP 218: Un tipo de datos de conjunto estándar"
#: ../Doc/whatsnew/2.3.rst:43
msgid ""
"The new :mod:`sets` module contains an implementation of a set datatype. "
"The :class:`Set` class is for mutable sets, sets that can have members added "
"and removed. The :class:`ImmutableSet` class is for sets that can't be "
"modified, and instances of :class:`ImmutableSet` can therefore be used as "
"dictionary keys. Sets are built on top of dictionaries, so the elements "
"within a set must be hashable."
msgstr ""
"El nuevo módulo :mod:`sets` contiene una implementación de un tipo de datos "
"de conjuntos. La clase :class:`Set` es para conjuntos mutables, conjuntos a "
"los que se les pueden añadir y eliminar miembros. La clase :class:"
"`ImmutableSet` es para los conjuntos que no pueden ser modificados, y las "
"instancias de :class:`ImmutableSet` pueden por lo tanto ser utilizadas como "
"claves de diccionario. Los conjuntos se construyen sobre diccionarios, por "
"lo que los elementos de un conjunto deben ser hashables."
#: ../Doc/whatsnew/2.3.rst:50
msgid "Here's a simple example::"
msgstr "Aquí hay un ejemplo simple::"
#: ../Doc/whatsnew/2.3.rst:66
msgid ""
"The union and intersection of sets can be computed with the :meth:`union` "
"and :meth:`intersection` methods; an alternative notation uses the bitwise "
"operators ``&`` and ``|``. Mutable sets also have in-place versions of these "
"methods, :meth:`union_update` and :meth:`intersection_update`. ::"
msgstr ""
"La unión y la intersección de los conjuntos pueden calcularse con los "
"métodos :meth:`union` y :meth:`intersection`; una notación alternativa "
"utiliza los operadores bitácora ``&`` y ``|``. Los conjuntos mutables "
"también tienen versiones in situ de estos métodos, :meth:`union_update` y :"
"meth:`intersection_update`. ::"
#: ../Doc/whatsnew/2.3.rst:86
msgid ""
"It's also possible to take the symmetric difference of two sets. This is "
"the set of all elements in the union that aren't in the intersection. "
"Another way of putting it is that the symmetric difference contains all "
"elements that are in exactly one set. Again, there's an alternative "
"notation (``^``), and an in-place version with the ungainly name :meth:"
"`symmetric_difference_update`. ::"
msgstr ""
"También es posible tomar la diferencia simétrica de dos conjuntos. Este es "
"el conjunto de todos los elementos de la unión que no están en la "
"intersección. Otra forma de decirlo es que la diferencia simétrica contiene "
"todos los elementos que están exactamente en un conjunto. De nuevo, existe "
"una notación alternativa (``^``), y una versión in-place con el poco "
"agraciado nombre :meth:`symmetric_difference_update`. ::"
#: ../Doc/whatsnew/2.3.rst:100
msgid ""
"There are also :meth:`issubset` and :meth:`issuperset` methods for checking "
"whether one set is a subset or superset of another::"
msgstr ""
"También hay métodos :meth:`issubset` y :meth:`issuperset` para comprobar si "
"un conjunto es subconjunto o superconjunto de otro::"
#: ../Doc/whatsnew/2.3.rst:117
msgid ":pep:`218` - Adding a Built-In Set Object Type"
msgstr ":pep:`218` - Añadiendo un tipo de objeto de conjunto incorporado"
#: ../Doc/whatsnew/2.3.rst:117
msgid ""
"PEP written by Greg V. Wilson. Implemented by Greg V. Wilson, Alex Martelli, "
"and GvR."
msgstr ""
"PEP escrito por Greg V. Wilson. Implementado por Greg V. Wilson, Alex "
"Martelli y GvR."
#: ../Doc/whatsnew/2.3.rst:126
msgid "PEP 255: Simple Generators"
msgstr "PEP 255: Generadores simples"
#: ../Doc/whatsnew/2.3.rst:128
msgid ""
"In Python 2.2, generators were added as an optional feature, to be enabled "
"by a ``from __future__ import generators`` directive. In 2.3 generators no "
"longer need to be specially enabled, and are now always present; this means "
"that :keyword:`yield` is now always a keyword. The rest of this section is "
"a copy of the description of generators from the \"What's New in Python "
"2.2\" document; if you read it back when Python 2.2 came out, you can skip "
"the rest of this section."
msgstr ""
"En Python 2.2, los generadores se añadieron como una característica "
"opcional, que se activaba mediante una directiva ``from __future__ import "
"generators``. En 2.3 los generadores ya no necesitan ser habilitados "
"especialmente, y ahora están siempre presentes; esto significa que :keyword:"
"`yield` es ahora siempre una palabra clave. El resto de esta sección es una "
"copia de la descripción de los generadores del documento \"What's New in "
"Python 2.2\"; si lo leíste cuando salió Python 2.2, puedes saltarte el resto "
"de esta sección."
#: ../Doc/whatsnew/2.3.rst:136
msgid ""
"You're doubtless familiar with how function calls work in Python or C. When "
"you call a function, it gets a private namespace where its local variables "
"are created. When the function reaches a :keyword:`return` statement, the "
"local variables are destroyed and the resulting value is returned to the "
"caller. A later call to the same function will get a fresh new set of local "
"variables. But, what if the local variables weren't thrown away on exiting a "
"function? What if you could later resume the function where it left off? "
"This is what generators provide; they can be thought of as resumable "
"functions."
msgstr ""
"Sin duda estás familiarizado con cómo funcionan las llamadas a funciones en "
"Python o C. Cuando llamas a una función, ésta obtiene un espacio de nombres "
"privado donde se crean sus variables locales. Cuando la función llega a una "
"declaración :keyword:`return`, las variables locales se destruyen y el valor "
"resultante se retorna a quien la llamó. Una llamada posterior a la misma "
"función obtendrá un nuevo conjunto de variables locales. Pero, ¿qué pasaría "
"si las variables locales no se tiraran al salir de una función? ¿Qué pasaría "
"si pudieras reanudar la función donde la dejaste? Esto es lo que "
"proporcionan los generadores; se puede pensar en ellos como funciones "
"reanudables."
#: ../Doc/whatsnew/2.3.rst:145
msgid "Here's the simplest example of a generator function::"
msgstr "Este es el ejemplo más sencillo de una función generadora::"
#: ../Doc/whatsnew/2.3.rst:151
msgid ""
"A new keyword, :keyword:`yield`, was introduced for generators. Any "
"function containing a :keyword:`!yield` statement is a generator function; "
"this is detected by Python's bytecode compiler which compiles the function "
"specially as a result."
msgstr ""
"Se ha introducido una nueva palabra clave, :keyword:`yield`, para los "
"generadores. Cualquier función que contenga una declaración :keyword:`!"
"yield` es una función generadora; esto es detectado por el compilador de "
"código de bits de Python que compila la función especialmente como resultado."
#: ../Doc/whatsnew/2.3.rst:156
msgid ""
"When you call a generator function, it doesn't return a single value; "
"instead it returns a generator object that supports the iterator protocol. "
"On executing the :keyword:`yield` statement, the generator outputs the value "
"of ``i``, similar to a :keyword:`return` statement. The big difference "
"between :keyword:`!yield` and a :keyword:`!return` statement is that on "
"reaching a :keyword:`!yield` the generator's state of execution is suspended "
"and local variables are preserved. On the next call to the generator's ``."
"next()`` method, the function will resume executing immediately after the :"
"keyword:`!yield` statement. (For complicated reasons, the :keyword:`!yield` "
"statement isn't allowed inside the :keyword:`try` block of a :keyword:`!"
"try`...\\ :keyword:`!finally` statement; read :pep:`255` for a full "
"explanation of the interaction between :keyword:`!yield` and exceptions.)"
msgstr ""
"Cuando se llama a una función generadora, ésta no retorna un único valor, "
"sino que retorna un objeto generador que soporta el protocolo de los "
"iteradores. Al ejecutar la sentencia :keyword:`yield`, el generador retorna "
"el valor de ``i``, de forma similar a una sentencia :keyword:`return`. La "
"gran diferencia entre :keyword:`!yield` y una sentencia :keyword:`!return` "
"es que al llegar a una sentencia :keyword:`!yield` se suspende el estado de "
"ejecución del generador y se conservan las variables locales. En la "
"siguiente llamada al método ``.next()`` del generador, la función se "
"reanudará la ejecución inmediatamente después de la sentencia :keyword:`!"
"yield`. (Por razones complicadas, la sentencia :keyword:`!yield` no está "
"permitida dentro del bloque :keyword:`try` de una sentencia :keyword:`!"
"try`...`; lea :pep:`255` para una explicación completa de la interacción "
"entre :keyword:`!yield` y las excepciones)"
#: ../Doc/whatsnew/2.3.rst:169
msgid "Here's a sample usage of the :func:`generate_ints` generator::"
msgstr "Este es un ejemplo de uso del generador :func:`generate_ints`::"
#: ../Doc/whatsnew/2.3.rst:186
msgid ""
"You could equally write ``for i in generate_ints(5)``, or ``a,b,c = "
"generate_ints(3)``."
msgstr ""
"También podrías escribir ``for i in generate_ints(5)``, o ``a,b,c = "
"generate_ints(3)``."
#: ../Doc/whatsnew/2.3.rst:189
msgid ""
"Inside a generator function, the :keyword:`return` statement can only be "
"used without a value, and signals the end of the procession of values; "
"afterwards the generator cannot return any further values. :keyword:`!"
"return` with a value, such as ``return 5``, is a syntax error inside a "
"generator function. The end of the generator's results can also be "
"indicated by raising :exc:`StopIteration` manually, or by just letting the "
"flow of execution fall off the bottom of the function."
msgstr ""
"Dentro de una función generadora, la expresión :keyword:`return` sólo puede "
"usarse sin un valor, y señala el final de la procesión de valores; después "
"el generador no puede retornar más valores. :keyword:`!return` con un valor, "
"como ``return 5``, es un error de sintaxis dentro de una función "
"generadora. El final de los resultados del generador también puede "
"indicarse levantando manualmente :exc:`StopIteration`, o simplemente dejando "
"que el flujo de ejecución caiga en el fondo de la función."
#: ../Doc/whatsnew/2.3.rst:197
msgid ""
"You could achieve the effect of generators manually by writing your own "
"class and storing all the local variables of the generator as instance "
"variables. For example, returning a list of integers could be done by "
"setting ``self.count`` to 0, and having the :meth:`next` method increment "
"``self.count`` and return it. However, for a moderately complicated "
"generator, writing a corresponding class would be much messier. :file:`Lib/"
"test/test_generators.py` contains a number of more interesting examples. "
"The simplest one implements an in-order traversal of a tree using generators "
"recursively. ::"
msgstr ""
"Puedes conseguir el efecto de los generadores manualmente escribiendo tu "
"propia clase y almacenando todas las variables locales del generador como "
"variables de instancia. Por ejemplo, la devolución de una lista de enteros "
"podría hacerse estableciendo ``self.count`` a 0, y haciendo que el método :"
"meth:`next` incremente ``self.count`` y lo retorne. Sin embargo, para un "
"generador medianamente complicado, escribir la clase correspondiente sería "
"mucho más complicado. :file:`Lib/test/test_generators.py` contiene varios "
"ejemplos más interesantes. El más sencillo implementa un recorrido en orden "
"de un árbol utilizando generadores de forma recursiva ::"
#: ../Doc/whatsnew/2.3.rst:215
msgid ""
"Two other examples in :file:`Lib/test/test_generators.py` produce solutions "
"for the N-Queens problem (placing $N$ queens on an $NxN$ chess board so that "
"no queen threatens another) and the Knight's Tour (a route that takes a "
"knight to every square of an $NxN$ chessboard without visiting any square "
"twice)."
msgstr ""
"Otros dos ejemplos en :file:`Lib/test/test_generators.py` producen "
"soluciones para el problema de las N reinas (colocar $N$ reinas en un "
"tablero de ajedrez $NxN$ de forma que ninguna reina amenace a otra) y el "
"recorrido del caballero (una ruta que lleva a un caballo a cada casilla de "
"un tablero de ajedrez $NxN$ sin visitar ninguna casilla dos veces)."
#: ../Doc/whatsnew/2.3.rst:220
msgid ""
"The idea of generators comes from other programming languages, especially "
"Icon (https://www.cs.arizona.edu/icon/), where the idea of generators is "
"central. In Icon, every expression and function call behaves like a "
"generator. One example from \"An Overview of the Icon Programming Language"
"\" at https://www.cs.arizona.edu/icon/docs/ipd266.htm gives an idea of what "
"this looks like::"
msgstr ""
"La idea de los generadores proviene de otros lenguajes de programación, "
"especialmente de Icon (https://www.cs.arizona.edu/icon/), donde la idea de "
"los generadores es fundamental. En Icon, cada expresión y llamada a una "
"función se comporta como un generador. Un ejemplo de \"*An Overview of the "
"Icon Programming Language*\" en https://www.cs.arizona.edu/icon/docs/ipd266."
"htm da una idea de cómo es esto::"
#: ../Doc/whatsnew/2.3.rst:230
msgid ""
"In Icon the :func:`find` function returns the indexes at which the substring "
"\"or\" is found: 3, 23, 33. In the :keyword:`if` statement, ``i`` is first "
"assigned a value of 3, but 3 is less than 5, so the comparison fails, and "
"Icon retries it with the second value of 23. 23 is greater than 5, so the "
"comparison now succeeds, and the code prints the value 23 to the screen."
msgstr ""
"En Icon la función :func:`find` retorna los índices en los que se encuentra "
"la subcadena \"o\": 3, 23, 33. En la expresión :keyword:`if`, a ``i`` se le "
"asigna primero un valor de 3, pero 3 es menor que 5, por lo que la "
"comparación falla, e Icon la reintenta con el segundo valor de 23. 23 es "
"mayor que 5, por lo que la comparación ahora tiene éxito, y el código "
"imprime el valor 23 en la pantalla."
#: ../Doc/whatsnew/2.3.rst:236
msgid ""
"Python doesn't go nearly as far as Icon in adopting generators as a central "
"concept. Generators are considered part of the core Python language, but "
"learning or using them isn't compulsory; if they don't solve any problems "
"that you have, feel free to ignore them. One novel feature of Python's "
"interface as compared to Icon's is that a generator's state is represented "
"as a concrete object (the iterator) that can be passed around to other "
"functions or stored in a data structure."
msgstr ""
"Python no va tan lejos como Icon en la adopción de generadores como concepto "
"central. Los generadores se consideran parte del núcleo del lenguaje "
"Python, pero aprenderlos o utilizarlos no es obligatorio; si no resuelven "
"ningún problema que tengas, siéntete libre de ignorarlos. Una característica "
"novedosa de la interfaz de Python en comparación con la de Icon es que el "
"estado de un generador se representa como un objeto concreto (el iterador) "
"que puede pasarse a otras funciones o almacenarse en una estructura de datos."
#: ../Doc/whatsnew/2.3.rst:248
msgid ":pep:`255` - Simple Generators"
msgstr ":pep:`255` - Generadores simples"
#: ../Doc/whatsnew/2.3.rst:248
msgid ""
"Written by Neil Schemenauer, Tim Peters, Magnus Lie Hetland. Implemented "
"mostly by Neil Schemenauer and Tim Peters, with other fixes from the Python "
"Labs crew."
msgstr ""
"Escrito por Neil Schemenauer, Tim Peters, Magnus Lie Hetland. Implementado "
"principalmente por Neil Schemenauer y Tim Peters, con otras correcciones del "
"equipo de Python Labs."
#: ../Doc/whatsnew/2.3.rst:257
msgid "PEP 263: Source Code Encodings"
msgstr "PEP 263: Codificación del código fuente"
#: ../Doc/whatsnew/2.3.rst:259
msgid ""
"Python source files can now be declared as being in different character set "
"encodings. Encodings are declared by including a specially formatted "
"comment in the first or second line of the source file. For example, a "
"UTF-8 file can be declared with::"
msgstr ""
"Los archivos fuente de Python ahora pueden declararse con diferentes "
"codificaciones de conjuntos de caracteres. Las codificaciones se declaran "
"incluyendo un comentario con formato especial en la primera o segunda línea "
"del archivo fuente. Por ejemplo, un archivo UTF-8 puede declararse con::"
#: ../Doc/whatsnew/2.3.rst:267
msgid ""
"Without such an encoding declaration, the default encoding used is 7-bit "
"ASCII. Executing or importing modules that contain string literals with 8-"
"bit characters and have no encoding declaration will result in a :exc:"
"`DeprecationWarning` being signalled by Python 2.3; in 2.4 this will be a "
"syntax error."
msgstr ""
"Sin esta declaración de codificación, la codificación por defecto utilizada "
"es ASCII de 7 bits. Ejecutar o importar módulos que contengan literales de "
"cadena con caracteres de 8 bits y que no tengan una declaración de "
"codificación dará lugar a un :exc:`DeprecationWarning` señalado por Python "
"2.3; en 2.4 será un error de sintaxis."
#: ../Doc/whatsnew/2.3.rst:273
msgid ""
"The encoding declaration only affects Unicode string literals, which will be "
"converted to Unicode using the specified encoding. Note that Python "
"identifiers are still restricted to ASCII characters, so you can't have "
"variable names that use characters outside of the usual alphanumerics."
msgstr ""
"La declaración de codificación sólo afecta a los literales de cadena "
"Unicode, que se convertirán a Unicode utilizando la codificación "
"especificada. Ten en cuenta que los identificadores de Python siguen "
"restringidos a caracteres ASCII, por lo que no puedes tener nombres de "
"variables que utilicen caracteres fuera de los alfanuméricos habituales."
#: ../Doc/whatsnew/2.3.rst:282
msgid ":pep:`263` - Defining Python Source Code Encodings"
msgstr ""
":pep:`263` - Definición de las codificaciones del código fuente de Python"
#: ../Doc/whatsnew/2.3.rst:282
msgid ""
"Written by Marc-André Lemburg and Martin von Löwis; implemented by Suzuki "
"Hisao and Martin von Löwis."
msgstr ""
"Escrito por Marc-André Lemburg y Martin von Löwis; realizado por Suzuki "
"Hisao y Martin von Löwis."
#: ../Doc/whatsnew/2.3.rst:289
msgid "PEP 273: Importing Modules from ZIP Archives"
msgstr "PEP 273: Importar módulos desde archivos ZIP"
#: ../Doc/whatsnew/2.3.rst:291
msgid ""
"The new :mod:`zipimport` module adds support for importing modules from a "
"ZIP-format archive. You don't need to import the module explicitly; it will "
"be automatically imported if a ZIP archive's filename is added to ``sys."
"path``. For example:"
msgstr ""
"El nuevo módulo :mod:`zipimport` añade soporte para importar módulos desde "
"un archivo en formato ZIP. No es necesario importar el módulo "
"explícitamente; se importará automáticamente si se añade el nombre de un "
"archivo ZIP a ``sys.path``. Por ejemplo:"
#: ../Doc/whatsnew/2.3.rst:314
msgid ""
"An entry in ``sys.path`` can now be the filename of a ZIP archive. The ZIP "
"archive can contain any kind of files, but only files named :file:`\\*.py`, :"
"file:`\\*.pyc`, or :file:`\\*.pyo` can be imported. If an archive only "
"contains :file:`\\*.py` files, Python will not attempt to modify the archive "
"by adding the corresponding :file:`\\*.pyc` file, meaning that if a ZIP "
"archive doesn't contain :file:`\\*.pyc` files, importing may be rather slow."
msgstr ""
"Una entrada en ``sys.path`` puede ser ahora el nombre de un archivo ZIP. El "
"archivo ZIP puede contener cualquier tipo de ficheros, pero sólo se pueden "
"importar los ficheros llamados :file:`\\*.py`, :file:`\\*.pyc`, o :file:`\\*."
"pyo`. Si un archivo sólo contiene ficheros :file:`\\*.py`, Python no "
"intentará modificar el archivo añadiendo el correspondiente fichero :file:`"
"\\*.pyc`, lo que significa que si un archivo ZIP no contiene ficheros :file:`"
"\\*.pyc`, la importación puede ser bastante lenta."
#: ../Doc/whatsnew/2.3.rst:321
msgid ""
"A path within the archive can also be specified to only import from a "
"subdirectory; for example, the path :file:`/tmp/example.zip/lib/` would only "
"import from the :file:`lib/` subdirectory within the archive."
msgstr ""
"También se puede especificar una ruta dentro del archivo para importar sólo "
"de un subdirectorio; por ejemplo, la ruta :file:`/tmp/example.zip/lib/` sólo "
"importaría del subdirectorio :file:`lib/` dentro del archivo."
#: ../Doc/whatsnew/2.3.rst:331
msgid ":pep:`273` - Import Modules from Zip Archives"
msgstr ":pep:`273` - Importación de módulos desde archivos Zip"
#: ../Doc/whatsnew/2.3.rst:329
msgid ""
"Written by James C. Ahlstrom, who also provided an implementation. Python "
"2.3 follows the specification in :pep:`273`, but uses an implementation "
"written by Just van Rossum that uses the import hooks described in :pep:"
"`302`. See section :ref:`section-pep302` for a description of the new import "
"hooks."
msgstr ""
"Escrito por James C. Ahlstrom, que también proporcionó una implementación. "
"Python 2.3 sigue la especificación en :pep:`273`, pero utiliza una "
"implementación escrita por Just van Rossum que utiliza los ganchos de "
"importación descritos en :pep:`302`. Vea la sección :ref:`section-pep302` "
"para una descripción de los nuevos ganchos de importación."
#: ../Doc/whatsnew/2.3.rst:338
msgid "PEP 277: Unicode file name support for Windows NT"
msgstr "PEP 277: Soporte de nombres de archivo Unicode para Windows NT"
#: ../Doc/whatsnew/2.3.rst:340
msgid ""
"On Windows NT, 2000, and XP, the system stores file names as Unicode "
"strings. Traditionally, Python has represented file names as byte strings, "
"which is inadequate because it renders some file names inaccessible."
msgstr ""
"En Windows NT, 2000 y XP, el sistema almacena los nombres de archivo como "
"cadenas Unicode. Tradicionalmente, Python ha representado los nombres de "
"archivo como cadenas de bytes, lo cual es inadecuado porque hace que algunos "
"nombres de archivo sean inaccesibles."
#: ../Doc/whatsnew/2.3.rst:344
msgid ""
"Python now allows using arbitrary Unicode strings (within the limitations of "
"the file system) for all functions that expect file names, most notably the :"
"func:`open` built-in function. If a Unicode string is passed to :func:`os."
"listdir`, Python now returns a list of Unicode strings. A new function, :"
"func:`os.getcwdu`, returns the current directory as a Unicode string."
msgstr ""
"Python permite ahora utilizar cadenas Unicode arbitrarias (dentro de las "
"limitaciones del sistema de archivos) para todas las funciones que esperan "
"nombres de archivos, sobre todo la función incorporada :func:`open`. Si se "
"pasa una cadena Unicode a :func:`os.listdir`, Python retorna ahora una lista "
"de cadenas Unicode. Una nueva función, :func:`os.getcwdu`, retorna el "
"directorio actual como una cadena Unicode."
#: ../Doc/whatsnew/2.3.rst:350
msgid ""
"Byte strings still work as file names, and on Windows Python will "
"transparently convert them to Unicode using the ``mbcs`` encoding."
msgstr ""
"Las cadenas de bytes siguen funcionando como nombres de archivo, y en "
"Windows Python las convertirá de forma transparente a Unicode utilizando la "
"codificación ``mbcs``."
#: ../Doc/whatsnew/2.3.rst:353
msgid ""
"Other systems also allow Unicode strings as file names but convert them to "
"byte strings before passing them to the system, which can cause a :exc:"
"`UnicodeError` to be raised. Applications can test whether arbitrary Unicode "
"strings are supported as file names by checking :attr:`os.path."
"supports_unicode_filenames`, a Boolean value."
msgstr ""
"Otros sistemas también permiten cadenas Unicode como nombres de archivo, "
"pero las convierten en cadenas de bytes antes de pasarlas al sistema, lo que "
"puede provocar un :exc:`UnicodeError`. Las aplicaciones pueden comprobar si "
"se admiten cadenas Unicode arbitrarias como nombres de archivo comprobando :"
"attr:`os.path.supports_unicode_filenames`, un valor booleano."
#: ../Doc/whatsnew/2.3.rst:359
msgid "Under MacOS, :func:`os.listdir` may now return Unicode filenames."
msgstr ""
"En MacOS, :func:`os.listdir` ahora puede retornar nombres de archivo Unicode."
#: ../Doc/whatsnew/2.3.rst:365
msgid ":pep:`277` - Unicode file name support for Windows NT"
msgstr ":pep:`277` - Soporte de nombres de archivo Unicode para Windows NT"
#: ../Doc/whatsnew/2.3.rst:365
msgid ""
"Written by Neil Hodgson; implemented by Neil Hodgson, Martin von Löwis, and "
"Mark Hammond."
msgstr ""
"Escrito por Neil Hodgson; realizado por Neil Hodgson, Martin von Löwis y "
"Mark Hammond."
#: ../Doc/whatsnew/2.3.rst:375
msgid "PEP 278: Universal Newline Support"
msgstr "PEP 278: Soporte universal de nuevas líneas"
#: ../Doc/whatsnew/2.3.rst:377
msgid ""
"The three major operating systems used today are Microsoft Windows, Apple's "
"Macintosh OS, and the various Unix derivatives. A minor irritation of cross-"
"platform work is that these three platforms all use different characters to "
"mark the ends of lines in text files. Unix uses the linefeed (ASCII "
"character 10), MacOS uses the carriage return (ASCII character 13), and "
"Windows uses a two-character sequence of a carriage return plus a newline."
msgstr ""
"Los tres principales sistemas operativos que se utilizan hoy en día son "
"Microsoft Windows, el sistema operativo Macintosh de Apple y los diversos "
"derivados de Unix. Una pequeña molestia del trabajo entre plataformas es "
"que estas tres plataformas utilizan diferentes caracteres para marcar el "
"final de las líneas en los archivos de texto. Unix utiliza el salto de "
"línea (carácter ASCII 10), MacOS utiliza el retorno de carro (carácter ASCII "
"13), y Windows utiliza una secuencia de dos caracteres de un retorno de "
"carro más una nueva línea."
#: ../Doc/whatsnew/2.3.rst:384
msgid ""
"Python's file objects can now support end of line conventions other than the "
"one followed by the platform on which Python is running. Opening a file with "
"the mode ``'U'`` or ``'rU'`` will open a file for reading in :term:"
"`universal newlines` mode. All three line ending conventions will be "
"translated to a ``'\\n'`` in the strings returned by the various file "
"methods such as :meth:`read` and :meth:`readline`."
msgstr ""
"Los objetos de archivo de Python pueden ahora soportar convenciones de fin "
"de línea distintas de la que sigue la plataforma en la que se ejecuta "
"Python. Al abrir un archivo con el modo ``'U`` o ``'rU`` se abrirá un "
"archivo para su lectura en modo :term:`universal newlines`. Las tres "
"convenciones de final de línea se traducirán a un ``'\\n'`` en las cadenas "
"retornadas por los distintos métodos de archivo como :meth:`read` y :meth:"
"`readline`."
#: ../Doc/whatsnew/2.3.rst:391
msgid ""
"Universal newline support is also used when importing modules and when "
"executing a file with the :func:`execfile` function. This means that Python "
"modules can be shared between all three operating systems without needing to "
"convert the line-endings."
msgstr ""
"El soporte universal de nuevas líneas también se utiliza al importar módulos "
"y al ejecutar un archivo con la función :func:`execfile`. Esto significa "
"que los módulos de Python pueden ser compartidos entre los tres sistemas "
"operativos sin necesidad de convertir los finales de línea."
#: ../Doc/whatsnew/2.3.rst:396
msgid ""
"This feature can be disabled when compiling Python by specifying the :option:"
"`!--without-universal-newlines` switch when running Python's :program:"
"`configure` script."
msgstr ""
"Esta función puede desactivarse al compilar Python especificando la opción :"
"option:`!--without-universal-newlines` al ejecutar el script :program:"
"`configure` de Python."
#: ../Doc/whatsnew/2.3.rst:403
msgid ":pep:`278` - Universal Newline Support"
msgstr ":pep:`278` - Soporte universal de nuevas líneas"
#: ../Doc/whatsnew/2.3.rst:404
msgid "Written and implemented by Jack Jansen."
msgstr "Escrito y ejecutado por Jack Jansen."
#: ../Doc/whatsnew/2.3.rst:412
msgid "PEP 279: enumerate()"
msgstr "PEP 279: enumerate()"
#: ../Doc/whatsnew/2.3.rst:414
msgid ""
"A new built-in function, :func:`enumerate`, will make certain loops a bit "
"clearer. ``enumerate(thing)``, where *thing* is either an iterator or a "
"sequence, returns an iterator that will return ``(0, thing[0])``, ``(1, "
"thing[1])``, ``(2, thing[2])``, and so forth."
msgstr ""
"Una nueva función incorporada, :func:`enumerate`, hará que ciertos bucles "
"sean un poco más claros. ``enumerate(cosa)``, donde *cosa* es un iterador o "
"una secuencia, retorna un iterador que retornará ``(0, cosa[0])``, ``(1, "
"cosa[1])``, ``(2, cosa[2])``, y así sucesivamente."
#: ../Doc/whatsnew/2.3.rst:419
msgid "A common idiom to change every element of a list looks like this::"
msgstr ""
"Un modismo común para cambiar cada elemento de una lista tiene el siguiente "
"aspecto::"
#: ../Doc/whatsnew/2.3.rst:426
msgid "This can be rewritten using :func:`enumerate` as::"
msgstr "Esto se puede reescribir usando :func:`enumerate` como::"
#: ../Doc/whatsnew/2.3.rst:435
msgid ":pep:`279` - The enumerate() built-in function"
msgstr ":pep:`279` - La función incorporada enumerate()"
#: ../Doc/whatsnew/2.3.rst:436
msgid "Written and implemented by Raymond D. Hettinger."
msgstr "Escrito y ejecutado por Raymond D. Hettinger."
#: ../Doc/whatsnew/2.3.rst:442
msgid "PEP 282: The logging Package"
msgstr "PEP 282: El paquete de registro"
#: ../Doc/whatsnew/2.3.rst:444
msgid ""
"A standard package for writing logs, :mod:`logging`, has been added to "
"Python 2.3. It provides a powerful and flexible mechanism for generating "
"logging output which can then be filtered and processed in various ways. A "
"configuration file written in a standard format can be used to control the "
"logging behavior of a program. Python includes handlers that will write log "
"records to standard error or to a file or socket, send them to the system "
"log, or even e-mail them to a particular address; of course, it's also "
"possible to write your own handler classes."
msgstr ""
"Se ha añadido a Python 2.3 un paquete estándar para escribir registros, :mod:"
"`logging`. Proporciona un mecanismo potente y flexible para generar salidas "
"de registro que pueden ser filtradas y procesadas de varias maneras. Se "
"puede utilizar un archivo de configuración escrito en un formato estándar "
"para controlar el comportamiento de registro de un programa. Python incluye "
"manejadores que escribirán los registros en el error estándar o en un "
"archivo o socket, los enviarán al registro del sistema, o incluso los "
"enviarán por correo electrónico a una dirección particular; por supuesto, "
"también es posible escribir tus propias clases de manejadores."
#: ../Doc/whatsnew/2.3.rst:453
msgid ""
"The :class:`Logger` class is the primary class. Most application code will "
"deal with one or more :class:`Logger` objects, each one used by a particular "
"subsystem of the application. Each :class:`Logger` is identified by a name, "
"and names are organized into a hierarchy using ``.`` as the component "
"separator. For example, you might have :class:`Logger` instances named "
"``server``, ``server.auth`` and ``server.network``. The latter two "
"instances are below ``server`` in the hierarchy. This means that if you "
"turn up the verbosity for ``server`` or direct ``server`` messages to a "
"different handler, the changes will also apply to records logged to ``server."
"auth`` and ``server.network``. There's also a root :class:`Logger` that's "
"the parent of all other loggers."
msgstr ""
"La clase :class:`Logger` es la clase principal. La mayoría del código de la "
"aplicación tratará con uno o más objetos :class:`Logger`, cada uno utilizado "
"por un subsistema particular de la aplicación. Cada :class:`Logger` se "
"identifica con un nombre, y los nombres se organizan en una jerarquía "
"utilizando ``.`` como separador de componentes. Por ejemplo, puedes tener "
"instancias de :class:`Logger` llamadas ``servidor``, ``servidor.auth`` y "
"``servidor.network``. Estas dos últimas instancias están por debajo de "
"``servidor`` en la jerarquía. Esto significa que si aumentas la verbosidad "
"de ``servidor`` o diriges los mensajes de ``servidor`` a un gestor "
"diferente, los cambios también se aplicarán a los registros de ``servidor."
"auth`` y ``servidor.network``. También hay un :class:`Logger` raíz que es el "
"padre de todos los demás loggers."
#: ../Doc/whatsnew/2.3.rst:464
msgid ""
"For simple uses, the :mod:`logging` package contains some convenience "
"functions that always use the root log::"
msgstr ""
"Para usos sencillos, el paquete :mod:`logging` contiene algunas funciones de "
"conveniencia que siempre utilizan la raíz log::"
#: ../Doc/whatsnew/2.3.rst:475 ../Doc/whatsnew/2.3.rst:500
msgid "This produces the following output::"
msgstr "Esto produce la siguiente salida::"
#: ../Doc/whatsnew/2.3.rst:481
msgid ""
"In the default configuration, informational and debugging messages are "
"suppressed and the output is sent to standard error. You can enable the "
"display of informational and debugging messages by calling the :meth:"
"`setLevel` method on the root logger."
msgstr ""
"En la configuración por defecto, los mensajes informativos y de depuración "
"se suprimen y la salida se envía al error estándar. Puede habilitar la "
"visualización de mensajes informativos y de depuración llamando al método :"
"meth:`setLevel` del registrador raíz."
#: ../Doc/whatsnew/2.3.rst:486
msgid ""
"Notice the :func:`warning` call's use of string formatting operators; all of "
"the functions for logging messages take the arguments ``(msg, arg1, "
"arg2, ...)`` and log the string resulting from ``msg % (arg1, arg2, ...)``."
msgstr ""
"Observe que la llamada :func:`warning` utiliza operadores de formato de "
"cadena; todas las funciones para el registro de mensajes toman los "
"argumentos ``(msg, arg1, arg2, ...)`` y registran la cadena resultante de "
"``msg % (arg1, arg2, ...)``."
#: ../Doc/whatsnew/2.3.rst:490
msgid ""
"There's also an :func:`exception` function that records the most recent "
"traceback. Any of the other functions will also record the traceback if you "
"specify a true value for the keyword argument *exc_info*. ::"
msgstr ""
"También hay una función :func:`exception` que registra el rastro más "
"reciente. Cualquiera de las otras funciones también registrará el rastro si "
"se especifica un valor verdadero para el argumento de la palabra clave "
"*exc_info*. ::"
#: ../Doc/whatsnew/2.3.rst:508
msgid ""
"Slightly more advanced programs will use a logger other than the root "
"logger. The ``getLogger(name)`` function is used to get a particular log, "
"creating it if it doesn't exist yet. ``getLogger(None)`` returns the root "
"logger. ::"
msgstr ""
"Los programas un poco más avanzados utilizarán un logger distinto del logger "
"raíz. La función ``getLogger(nombre)`` se utiliza para obtener un registro "
"en particular, creándolo si aún no existe. ``getLogger(None)`` retorna el "
"logger raíz. ::"
#: ../Doc/whatsnew/2.3.rst:519
msgid ""
"Log records are usually propagated up the hierarchy, so a message logged to "
"``server.auth`` is also seen by ``server`` and ``root``, but a :class:"
"`Logger` can prevent this by setting its :attr:`propagate` attribute to :"
"const:`False`."
msgstr ""
"Los registros se suelen propagar hacia arriba en la jerarquía, por lo que un "
"mensaje registrado en ``servidor.auth`` también es visto por ``servidor`` y "
"``root``, pero un :class:`Logger` puede evitar esto estableciendo su "
"atributo :attr:`propagate` a :const:`False`."
#: ../Doc/whatsnew/2.3.rst:523
msgid ""
"There are more classes provided by the :mod:`logging` package that can be "
"customized. When a :class:`Logger` instance is told to log a message, it "
"creates a :class:`LogRecord` instance that is sent to any number of "
"different :class:`Handler` instances. Loggers and handlers can also have an "
"attached list of filters, and each filter can cause the :class:`LogRecord` "
"to be ignored or can modify the record before passing it along. When "
"they're finally output, :class:`LogRecord` instances are converted to text "
"by a :class:`Formatter` class. All of these classes can be replaced by your "
"own specially-written classes."
msgstr ""
"Hay más clases proporcionadas por el paquete :mod:`logging` que pueden ser "
"personalizadas. Cuando una instancia de :class:`Logger` recibe la orden de "
"registrar un mensaje, crea una instancia de :class:`LogRecord` que se envía "
"a cualquier número de instancias de :class:`Handler` diferentes. Los "
"loggers y handlers también pueden tener una lista adjunta de filtros, y cada "
"filtro puede hacer que el :class:`LogRecord` sea ignorado o puede modificar "
"el registro antes de pasarlo. Cuando finalmente se emiten, las instancias "
"de :class:`LogRecord` se convierten en texto mediante una clase :class:"
"`Formatter`. Todas estas clases pueden ser reemplazadas por tus propias "
"clases especialmente escritas."
#: ../Doc/whatsnew/2.3.rst:533
msgid ""
"With all of these features the :mod:`logging` package should provide enough "
"flexibility for even the most complicated applications. This is only an "
"incomplete overview of its features, so please see the package's reference "
"documentation for all of the details. Reading :pep:`282` will also be "
"helpful."
msgstr ""
"Con todas estas características, el paquete :mod:`logging` debería "
"proporcionar suficiente flexibilidad incluso para las aplicaciones más "
"complicadas. Esto es sólo un resumen incompleto de sus características, así "
"que por favor consulte la documentación de referencia del paquete para todos "
"los detalles. La lectura de :pep:`282` también será útil."
#: ../Doc/whatsnew/2.3.rst:541
msgid ":pep:`282` - A Logging System"
msgstr ":pep:`282` - Un sistema de registro"
#: ../Doc/whatsnew/2.3.rst:542
msgid "Written by Vinay Sajip and Trent Mick; implemented by Vinay Sajip."
msgstr "Escrito por Vinay Sajip y Trent Mick; implementado por Vinay Sajip."
#: ../Doc/whatsnew/2.3.rst:550
msgid "PEP 285: A Boolean Type"
msgstr "PEP 285: Un tipo booleano"
#: ../Doc/whatsnew/2.3.rst:552
msgid ""
"A Boolean type was added to Python 2.3. Two new constants were added to "
"the :mod:`__builtin__` module, :const:`True` and :const:`False`. (:const:"
"`True` and :const:`False` constants were added to the built-ins in Python "
"2.2.1, but the 2.2.1 versions are simply set to integer values of 1 and 0 "
"and aren't a different type.)"
msgstr ""
"Se ha añadido un tipo booleano a Python 2.3. Se añadieron dos nuevas "
"constantes al módulo :mod:`__builtin__`, :const:`True` y :const:`False`. "
"(Las constantes :const:`True` y :const:`False` se añadieron a los módulos "
"incorporados en Python 2.2.1, pero las versiones de 2.2.1 se ajustan "
"simplemente a valores enteros de 1 y 0 y no son un tipo diferente)"
#: ../Doc/whatsnew/2.3.rst:558
msgid ""
"The type object for this new type is named :class:`bool`; the constructor "
"for it takes any Python value and converts it to :const:`True` or :const:"
"`False`. ::"
msgstr ""
"El objeto de tipo para este nuevo tipo se denomina :class:`bool`; su "
"constructor toma cualquier valor de Python y lo convierte en :const:`True` "
"o :const:`False`. ::"
#: ../Doc/whatsnew/2.3.rst:570
msgid ""
"Most of the standard library modules and built-in functions have been "
"changed to return Booleans. ::"
msgstr ""
"La mayoría de los módulos de la biblioteca estándar y las funciones "
"incorporadas se han modificado para retornar booleanos. ::"
#: ../Doc/whatsnew/2.3.rst:581
msgid ""
"Python's Booleans were added with the primary goal of making code clearer. "
"For example, if you're reading a function and encounter the statement "
"``return 1``, you might wonder whether the ``1`` represents a Boolean truth "
"value, an index, or a coefficient that multiplies some other quantity. If "
"the statement is ``return True``, however, the meaning of the return value "
"is quite clear."
msgstr ""
"Los booleanos de Python se añadieron con el objetivo principal de hacer el "
"código más claro. Por ejemplo, si estás leyendo una función y te encuentras "
"con la sentencia ``return 1``, podrías preguntarte si el ``1`` representa un "
"valor de verdad booleano, un índice o un coeficiente que multiplica alguna "
"otra cantidad. Sin embargo, si la sentencia es ``return True``, el "
"significado del valor de retorno es bastante claro."
#: ../Doc/whatsnew/2.3.rst:587
msgid ""
"Python's Booleans were *not* added for the sake of strict type-checking. A "
"very strict language such as Pascal would also prevent you performing "
"arithmetic with Booleans, and would require that the expression in an :"
"keyword:`if` statement always evaluate to a Boolean result. Python is not "
"this strict and never will be, as :pep:`285` explicitly says. This means "
"you can still use any expression in an :keyword:`!if` statement, even ones "
"that evaluate to a list or tuple or some random object. The Boolean type is "
"a subclass of the :class:`int` class so that arithmetic using a Boolean "
"still works. ::"
msgstr ""
"Los booleanos de Python *no* se añadieron en aras de una comprobación de "
"tipos estricta. Un lenguaje muy estricto como Pascal también le impediría "
"realizar aritmética con booleanos, y requeriría que la expresión en una "
"declaración :keyword:`if` siempre se evaluara a un resultado booleano. "
"Python no es tan estricto y nunca lo será, como dice explícitamente :pep:"
"`285`. Esto significa que puede utilizar cualquier expresión en una "
"sentencia :keyword:`!if`, incluso las que se evalúan a una lista o tupla o "
"algún objeto aleatorio. El tipo Booleano es una subclase de la clase :class:"
"`int` por lo que la aritmética que utiliza un Booleano sigue funcionando. ::"
#: ../Doc/whatsnew/2.3.rst:605
msgid ""
"To sum up :const:`True` and :const:`False` in a sentence: they're "
"alternative ways to spell the integer values 1 and 0, with the single "
"difference that :func:`str` and :func:`repr` return the strings ``'True'`` "
"and ``'False'`` instead of ``'1'`` and ``'0'``."
msgstr ""
"Para resumir :const:`True` and :const:`False` en una frase: son formas "
"alternativas de deletrear los valores enteros 1 y 0, con la única diferencia "
"de que :func:`str` y :func:`repr` retornan las cadenas ``Verdadero`` y "
"``Falso`` en lugar de ``1`` y ``0``."
#: ../Doc/whatsnew/2.3.rst:613
msgid ":pep:`285` - Adding a bool type"
msgstr ":pep:`285` - Añadir un tipo booleano"
#: ../Doc/whatsnew/2.3.rst:614
msgid "Written and implemented by GvR."
msgstr "Escrito y ejecutado por GvR."
#: ../Doc/whatsnew/2.3.rst:620
msgid "PEP 293: Codec Error Handling Callbacks"
msgstr "PEP 293: Llamadas de retorno para el manejo de errores del códec"
#: ../Doc/whatsnew/2.3.rst:622
msgid ""
"When encoding a Unicode string into a byte string, unencodable characters "
"may be encountered. So far, Python has allowed specifying the error "
"processing as either \"strict\" (raising :exc:`UnicodeError`), \"ignore"
"\" (skipping the character), or \"replace\" (using a question mark in the "
"output string), with \"strict\" being the default behavior. It may be "
"desirable to specify alternative processing of such errors, such as "
"inserting an XML character reference or HTML entity reference into the "
"converted string."
msgstr ""
"Al codificar una cadena Unicode en una cadena de bytes, pueden encontrarse "
"caracteres no codificables. Hasta ahora, Python ha permitido especificar el "
"procesamiento del error como \"estricto\" (lanzando :exc:`UnicodeError`), "
"\"ignorar\" (saltando el carácter), o \"reemplazar\" (usando un signo de "
"interrogación en la cadena de salida), siendo \"estricto\" el comportamiento "
"por defecto. Puede ser deseable especificar un procesamiento alternativo de "
"tales errores, como insertar una referencia de carácter XML o una referencia "
"de entidad HTML en la cadena convertida."
#: ../Doc/whatsnew/2.3.rst:630
msgid ""
"Python now has a flexible framework to add different processing strategies. "
"New error handlers can be added with :func:`codecs.register_error`, and "
"codecs then can access the error handler with :func:`codecs.lookup_error`. "
"An equivalent C API has been added for codecs written in C. The error "
"handler gets the necessary state information such as the string being "
"converted, the position in the string where the error was detected, and the "
"target encoding. The handler can then either raise an exception or return a "
"replacement string."
msgstr ""
"Python tiene ahora un marco flexible para añadir diferentes estrategias de "
"procesamiento. Se pueden añadir nuevos manejadores de errores con :func:"
"`codecs.register_error`, y los códecs pueden acceder al manejador de errores "
"con :func:`codecs.lookup_error`. Se ha añadido una API en C equivalente para "
"los códecs escritos en C. El gestor de errores obtiene la información de "
"estado necesaria, como la cadena que se está convirtiendo, la posición en la "
"cadena donde se ha detectado el error y la codificación de destino. El "
"controlador puede entonces lanzar una excepción o retornar una cadena de "
"reemplazo."
#: ../Doc/whatsnew/2.3.rst:638
msgid ""
"Two additional error handlers have been implemented using this framework: "
"\"backslashreplace\" uses Python backslash quoting to represent unencodable "
"characters and \"xmlcharrefreplace\" emits XML character references."
msgstr ""
"Se han implementado dos manejadores de error adicionales utilizando este "
"marco: \"backslashreplace\" utiliza las comillas de barra invertida de "
"Python para representar los caracteres no codificables y \"xmlcharrefreplace"
"\" emite referencias de caracteres XML."