-
Notifications
You must be signed in to change notification settings - Fork 380
/
functools.po
930 lines (840 loc) · 42.7 KB
/
functools.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
# 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: 2023-10-12 19:43+0200\n"
"PO-Revision-Date: 2021-12-12 12:55-0500\n"
"Last-Translator: Adolfo Hristo David Roque Gámez <aroquega@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.13.0\n"
#: ../Doc/library/functools.rst:2
msgid ""
":mod:`functools` --- Higher-order functions and operations on callable "
"objects"
msgstr ""
":mod:`functools` --- Funciones de orden superior y operaciones sobre objetos "
"invocables"
#: ../Doc/library/functools.rst:14
msgid "**Source code:** :source:`Lib/functools.py`"
msgstr "**Código fuente:** :source:`Lib/functools.py`"
#: ../Doc/library/functools.rst:23
msgid ""
"The :mod:`functools` module is for higher-order functions: functions that "
"act on or return other functions. In general, any callable object can be "
"treated as a function for the purposes of this module."
msgstr ""
"El módulo :mod:`functools` es para funciones de orden superior: funciones "
"que actúan o retornan otras funciones. En general, cualquier objeto "
"invocable puede ser tratado como una función para los propósitos de este "
"módulo."
#: ../Doc/library/functools.rst:27
msgid "The :mod:`functools` module defines the following functions:"
msgstr "El módulo :mod:`functools` define las siguientes funciones:"
#: ../Doc/library/functools.rst:31
msgid ""
"Simple lightweight unbounded function cache. Sometimes called `\"memoize\" "
"<https://en.wikipedia.org/wiki/Memoization>`_."
msgstr ""
"Caché de funciones ilimitado, ligero y simple. Aveces llamado "
"`\"memoización\" <https://es.wikipedia.org/wiki/Memoizaci%C3%B3n>`_."
#: ../Doc/library/functools.rst:34
msgid ""
"Returns the same as ``lru_cache(maxsize=None)``, creating a thin wrapper "
"around a dictionary lookup for the function arguments. Because it never "
"needs to evict old values, this is smaller and faster than :func:"
"`lru_cache()` with a size limit."
msgstr ""
"Retorna lo mismo que ``lru_cache(maxsize=None)``, creando una envoltura "
"delgada alrededor de una búsqueda de diccionario para los argumentos de la "
"función. Debido a que nunca necesita desalojar los valores antiguos, esto es "
"más pequeño y más rápido que :func:`lru_cache()` con un límite de tamaño."
#: ../Doc/library/functools.rst:39 ../Doc/library/functools.rst:291
msgid "For example::"
msgstr "Por ejemplo::"
#: ../Doc/library/functools.rst:52 ../Doc/library/functools.rst:158
msgid ""
"The cache is threadsafe so that the wrapped function can be used in multiple "
"threads. This means that the underlying data structure will remain coherent "
"during concurrent updates."
msgstr ""
#: ../Doc/library/functools.rst:56 ../Doc/library/functools.rst:162
msgid ""
"It is possible for the wrapped function to be called more than once if "
"another thread makes an additional call before the initial call has been "
"completed and cached."
msgstr ""
#: ../Doc/library/functools.rst:65
msgid ""
"Transform a method of a class into a property whose value is computed once "
"and then cached as a normal attribute for the life of the instance. Similar "
"to :func:`property`, with the addition of caching. Useful for expensive "
"computed properties of instances that are otherwise effectively immutable."
msgstr ""
"Transforma un método de una clase en una propiedad cuyo valor se computa una "
"vez y luego se almacena como un atributo normal durante la vida de la "
"instancia. Similar a :func:`property`, con la adición de caching. Útil para "
"propiedades calculadas costosas de instancias que de otra manera son "
"efectivamente inmutables."
#: ../Doc/library/functools.rst:70 ../Doc/library/functools.rst:142
#: ../Doc/library/functools.rst:383
msgid "Example::"
msgstr "Ejemplo::"
#: ../Doc/library/functools.rst:81
msgid ""
"The mechanics of :func:`cached_property` are somewhat different from :func:"
"`property`. A regular property blocks attribute writes unless a setter is "
"defined. In contrast, a *cached_property* allows writes."
msgstr ""
"La mecánica de :func:`cached_property` es algo diferente de :func:"
"`property`. Un atributo de bloques de propiedad normal escribe a menos que "
"se defina un establecedor. Por el contrario, *cached_property* permite "
"escrituras."
#: ../Doc/library/functools.rst:85
msgid ""
"The *cached_property* decorator only runs on lookups and only when an "
"attribute of the same name doesn't exist. When it does run, the "
"*cached_property* writes to the attribute with the same name. Subsequent "
"attribute reads and writes take precedence over the *cached_property* method "
"and it works like a normal attribute."
msgstr ""
"El decorador *cached_property* solo se ejecuta en búsquedas y solo cuando no "
"existe un atributo con el mismo nombre. Cuando se ejecuta, *cached_property* "
"escribe en el atributo con el mismo nombre. Las lecturas y escrituras de "
"atributos posteriores tienen prioridad sobre el método *cached_property* y "
"funciona como un atributo normal."
#: ../Doc/library/functools.rst:91
msgid ""
"The cached value can be cleared by deleting the attribute. This allows the "
"*cached_property* method to run again."
msgstr ""
"El valor en caché se puede borrar eliminando el atributo. Esto permite que "
"el método *cached_property* se ejecute nuevamente."
#: ../Doc/library/functools.rst:94
msgid ""
"The *cached_property* does not prevent a possible race condition in multi-"
"threaded usage. The getter function could run more than once on the same "
"instance, with the latest run setting the cached value. If the cached "
"property is idempotent or otherwise not harmful to run more than once on an "
"instance, this is fine. If synchronization is needed, implement the "
"necessary locking inside the decorated getter function or around the cached "
"property access."
msgstr ""
#: ../Doc/library/functools.rst:102
msgid ""
"Note, this decorator interferes with the operation of :pep:`412` key-sharing "
"dictionaries. This means that instance dictionaries can take more space "
"than usual."
msgstr ""
"Tenga en cuenta que este decorador interfiere con el funcionamiento de "
"diccionarios de intercambio de claves :pep:`412`. Esto significa que los "
"diccionarios de instancias pueden ocupar más espacio de lo habitual."
#: ../Doc/library/functools.rst:106
msgid ""
"Also, this decorator requires that the ``__dict__`` attribute on each "
"instance be a mutable mapping. This means it will not work with some types, "
"such as metaclasses (since the ``__dict__`` attributes on type instances are "
"read-only proxies for the class namespace), and those that specify "
"``__slots__`` without including ``__dict__`` as one of the defined slots (as "
"such classes don't provide a ``__dict__`` attribute at all)."
msgstr ""
"Además, este decorador requiere que el atributo ``__dict__`` en cada "
"instancia sea un mapeo mutable. Esto significa que no funcionará con algunos "
"tipos, como las metaclases (ya que los atributos ``__dict__`` en las "
"instancias de tipos son proxies de solo lectura para el espacio de nombres "
"de la clase) y aquellos que especifican ``__slots__`` sin incluir "
"``__dict__`` como una de las ranuras definidas (ya que tales clases no "
"proporcionan un atributo ``__dict__`` en absoluto)."
#: ../Doc/library/functools.rst:113
#, fuzzy
msgid ""
"If a mutable mapping is not available or if space-efficient key sharing is "
"desired, an effect similar to :func:`cached_property` can also be achieved "
"by stacking :func:`property` on top of :func:`lru_cache`. See :ref:`faq-"
"cache-method-calls` for more details on how this differs from :func:"
"`cached_property`."
msgstr ""
"Si un mapeo mutable no está disponible o si se desea compartir claves con "
"espacio eficiente, se puede lograr un efecto similar a :func:"
"`cached_property` apilando :func:`property` encima de :func:`cache`::"
#: ../Doc/library/functools.rst:120
msgid ""
"Prior to Python 3.12, ``cached_property`` included an undocumented lock to "
"ensure that in multi-threaded usage the getter function was guaranteed to "
"run only once per instance. However, the lock was per-property, not per-"
"instance, which could result in unacceptably high lock contention. In Python "
"3.12+ this locking is removed."
msgstr ""
#: ../Doc/library/functools.rst:130
msgid ""
"Transform an old-style comparison function to a :term:`key function`. Used "
"with tools that accept key functions (such as :func:`sorted`, :func:`min`, :"
"func:`max`, :func:`heapq.nlargest`, :func:`heapq.nsmallest`, :func:"
"`itertools.groupby`). This function is primarily used as a transition tool "
"for programs being converted from Python 2 which supported the use of "
"comparison functions."
msgstr ""
"Transformar una función de comparación de estilo antiguo en una :term:`key "
"function`. Se utiliza con herramientas que aceptan funciones clave (como :"
"func:`sorted`, :func:`min`, :func:`max`, :func:`heapq.nlargest`, :func:"
"`heapq.nsmallest`, :func:`itertools.groupby`). Esta función se utiliza "
"principalmente como una herramienta de transición para los programas que se "
"están convirtiendo a partir de Python 2, que soportaba el uso de funciones "
"de comparación."
#: ../Doc/library/functools.rst:137
msgid ""
"A comparison function is any callable that accepts two arguments, compares "
"them, and returns a negative number for less-than, zero for equality, or a "
"positive number for greater-than. A key function is a callable that accepts "
"one argument and returns another value to be used as the sort key."
msgstr ""
"Una función de comparación es cualquier invocable que acepta dos argumentos, "
"los compara y devuelve un número negativo para menor que, cero para igualdad "
"o un número positivo para mayor que. Una función clave es una función "
"invocable que acepta un argumento y devuelve otro valor para usar como clave "
"de ordenación."
#: ../Doc/library/functools.rst:146
msgid ""
"For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`."
msgstr ""
"Para ejemplos de clasificación y un breve tutorial de clasificación, ver :"
"ref:`sortinghowto`."
#: ../Doc/library/functools.rst:154
msgid ""
"Decorator to wrap a function with a memoizing callable that saves up to the "
"*maxsize* most recent calls. It can save time when an expensive or I/O "
"bound function is periodically called with the same arguments."
msgstr ""
"Decorador para envolver una función con un memorizador invocable que guarda "
"hasta el *maxsize* de las llamadas más recientes. Puede salvar el tiempo "
"cuando una función costosa o de E/S es llamada periódicamente con los mismos "
"argumentos."
#: ../Doc/library/functools.rst:166
#, fuzzy
msgid ""
"Since a dictionary is used to cache results, the positional and keyword "
"arguments to the function must be :term:`hashable`."
msgstr ""
"Dado que se utiliza un diccionario para guardar los resultados, los "
"argumentos posicionales y de las palabras clave de la función deben ser "
"hashable."
#: ../Doc/library/functools.rst:169
msgid ""
"Distinct argument patterns may be considered to be distinct calls with "
"separate cache entries. For example, ``f(a=1, b=2)`` and ``f(b=2, a=1)`` "
"differ in their keyword argument order and may have two separate cache "
"entries."
msgstr ""
"Los patrones de argumentos distintos pueden considerarse llamadas distintas "
"con entradas de memoria caché separadas. Por ejemplo, ``f(a=1, b=2)`` y "
"``f(b=2, a=1)`` difieren en el orden de sus argumentos de palabras clave y "
"pueden tener dos entradas de caché separadas."
#: ../Doc/library/functools.rst:174
msgid ""
"If *user_function* is specified, it must be a callable. This allows the "
"*lru_cache* decorator to be applied directly to a user function, leaving the "
"*maxsize* at its default value of 128::"
msgstr ""
"Si se especifica *user_function*, debe ser una llamada. Esto permite que el "
"decorador *lru_cache* se aplique directamente a una función de usuario, "
"dejando el *maxsize* en su valor por defecto de 128::"
#: ../Doc/library/functools.rst:182
msgid ""
"If *maxsize* is set to ``None``, the LRU feature is disabled and the cache "
"can grow without bound."
msgstr ""
"Si *maxsize* está configurado como ``None``, la función LRU está desactivada "
"y la caché puede crecer sin límites."
#: ../Doc/library/functools.rst:185
msgid ""
"If *typed* is set to true, function arguments of different types will be "
"cached separately. If *typed* is false, the implementation will usually "
"regard them as equivalent calls and only cache a single result. (Some types "
"such as *str* and *int* may be cached separately even when *typed* is false.)"
msgstr ""
"Si *typed* se establece en verdadero, los argumentos de función de "
"diferentes tipos se almacenarán en caché por separado. Si *typed* es falso, "
"la implementación generalmente las considerará como llamadas equivalentes y "
"solo almacenará en caché un único resultado. (Algunos tipos como *str* y "
"*int* pueden almacenarse en caché por separado incluso cuando *typed* es "
"falso)."
#: ../Doc/library/functools.rst:191
msgid ""
"Note, type specificity applies only to the function's immediate arguments "
"rather than their contents. The scalar arguments, ``Decimal(42)`` and "
"``Fraction(42)`` are be treated as distinct calls with distinct results. In "
"contrast, the tuple arguments ``('answer', Decimal(42))`` and ``('answer', "
"Fraction(42))`` are treated as equivalent."
msgstr ""
"Tenga en cuenta que la especificidad de tipo se aplica solo a los argumentos "
"inmediatos de la función en lugar de a su contenido. Los argumentos "
"escalares, ``Decimal(42)`` y ``Fraction(42)`` se tratan como llamadas "
"distintas con resultados distintos. Por el contrario, los argumentos de "
"tupla ``('answer', Decimal(42))`` y ``('answer', Fraction(42))`` se tratan "
"como equivalentes."
#: ../Doc/library/functools.rst:197
msgid ""
"The wrapped function is instrumented with a :func:`cache_parameters` "
"function that returns a new :class:`dict` showing the values for *maxsize* "
"and *typed*. This is for information purposes only. Mutating the values "
"has no effect."
msgstr ""
"La función envuelta está instrumentada con una función :func:"
"`cache_parameters` que retorna un nuevo :class:`dict` que muestra los "
"valores para *maxsize* y *typed*. Esto es solo para fines informativos. La "
"mutación de los valores no tiene ningún efecto."
#: ../Doc/library/functools.rst:202
msgid ""
"To help measure the effectiveness of the cache and tune the *maxsize* "
"parameter, the wrapped function is instrumented with a :func:`cache_info` "
"function that returns a :term:`named tuple` showing *hits*, *misses*, "
"*maxsize* and *currsize*."
msgstr ""
"Para ayudar a medir la efectividad de la caché y afinar el parámetro "
"*maxsize*, la función envolvente está instrumentada con una función :func:"
"`cache_info` que retorna un :term:`named tuple` mostrando *hits*, *misses*, "
"*maxsize* y *currsize*."
#: ../Doc/library/functools.rst:207
msgid ""
"The decorator also provides a :func:`cache_clear` function for clearing or "
"invalidating the cache."
msgstr ""
"El decorador también proporciona una función :func:`cache_clear` para "
"limpiar o invalidar la caché."
#: ../Doc/library/functools.rst:210
msgid ""
"The original underlying function is accessible through the :attr:"
"`__wrapped__` attribute. This is useful for introspection, for bypassing "
"the cache, or for rewrapping the function with a different cache."
msgstr ""
"La función subyacente original es accesible a través del atributo :attr:"
"`__wrapped__`. Esto es útil para la introspección, para evitar el caché, o "
"para volver a envolver la función con un caché diferente."
#: ../Doc/library/functools.rst:214
msgid ""
"The cache keeps references to the arguments and return values until they age "
"out of the cache or until the cache is cleared."
msgstr ""
"La caché mantiene referencias de los argumentos y retorna los valores hasta "
"que se caduquen de la caché o hasta que se borre la caché."
#: ../Doc/library/functools.rst:217
msgid ""
"If a method is cached, the ``self`` instance argument is included in the "
"cache. See :ref:`faq-cache-method-calls`"
msgstr ""
"Si un método se almacena en caché, el argumento de la instancia ``self`` se "
"incluye en el caché. Ver :ref:`faq-cache-method-calls`"
#: ../Doc/library/functools.rst:220
msgid ""
"An `LRU (least recently used) cache <https://en.wikipedia.org/wiki/"
"Cache_replacement_policies#Least_recently_used_(LRU)>`_ works best when the "
"most recent calls are the best predictors of upcoming calls (for example, "
"the most popular articles on a news server tend to change each day). The "
"cache's size limit assures that the cache does not grow without bound on "
"long-running processes such as web servers."
msgstr ""
"Un `caché LRU (menos usado recientemente) <https://es.wikipedia.org/wiki/"
"Algoritmo_de_cach%C3%A9#Menos_usado_recientemente_(LRU)>`_ funciona mejor "
"cuando las llamadas más recientes son los mejores predictores de las "
"próximas llamadas (por ejemplo, el los artículos más populares en un "
"servidor de noticias tienden a cambiar cada día). El límite de tamaño de la "
"caché asegura que la caché no crezca sin límites en procesos de larga "
"ejecución como servidores web."
#: ../Doc/library/functools.rst:227
#, fuzzy
msgid ""
"In general, the LRU cache should only be used when you want to reuse "
"previously computed values. Accordingly, it doesn't make sense to cache "
"functions with side-effects, functions that need to create distinct mutable "
"objects on each call (such as generators and async functions), or impure "
"functions such as time() or random()."
msgstr ""
"En general, la caché de la LRU sólo debe utilizarse cuando se desea "
"reutilizar valores previamente calculados. Por consiguiente, no tiene "
"sentido almacenar en la caché funciones con efectos secundarios, funciones "
"que necesitan crear distintos objetos mutables en cada llamada, o funciones "
"impuras como time() o random()."
#: ../Doc/library/functools.rst:233
msgid "Example of an LRU cache for static web content::"
msgstr "Ejemplo de un caché de la LRU para contenido web estático::"
#: ../Doc/library/functools.rst:252
msgid ""
"Example of efficiently computing `Fibonacci numbers <https://en.wikipedia."
"org/wiki/Fibonacci_number>`_ using a cache to implement a `dynamic "
"programming <https://en.wikipedia.org/wiki/Dynamic_programming>`_ technique::"
msgstr ""
"Ejemplo de computar eficientemente los `números de Fibonacci <https://en."
"wikipedia.org/wiki/Fibonacci_number>`_ usando una memoria caché para "
"implementar una técnica de `programación dinámica <https://en.wikipedia.org/"
"wiki/Dynamic_programming>`_::"
#: ../Doc/library/functools.rst:272
msgid "Added the *typed* option."
msgstr "Añadida la opción *typed* option."
#: ../Doc/library/functools.rst:275
msgid "Added the *user_function* option."
msgstr "Añadida la opción *user_function*."
#: ../Doc/library/functools.rst:278
msgid "Added the function :func:`cache_parameters`"
msgstr "Añadida la función :func:`cache_parameters`"
#: ../Doc/library/functools.rst:283
msgid ""
"Given a class defining one or more rich comparison ordering methods, this "
"class decorator supplies the rest. This simplifies the effort involved in "
"specifying all of the possible rich comparison operations:"
msgstr ""
"Dada una clase que define uno o más métodos de ordenamiento de comparación "
"ricos, este decorador de clase suministra el resto. Esto simplifica el "
"esfuerzo de especificar todas las posibles operaciones de comparación rica:"
#: ../Doc/library/functools.rst:287
msgid ""
"The class must define one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, "
"or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` "
"method."
msgstr ""
"La clase debe definir uno de :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, "
"o :meth:`__ge__`. Además, la clase debe suministrar un método :meth:"
"`__eq__`. Dada una clase que define uno o más métodos de ordenamiento de "
"comparación ricos, este decorador de clase suministra el resto. Esto "
"simplifica el esfuerzo de especificar todas las posibles operaciones de "
"comparación rica."
#: ../Doc/library/functools.rst:311
msgid ""
"While this decorator makes it easy to create well behaved totally ordered "
"types, it *does* come at the cost of slower execution and more complex stack "
"traces for the derived comparison methods. If performance benchmarking "
"indicates this is a bottleneck for a given application, implementing all six "
"rich comparison methods instead is likely to provide an easy speed boost."
msgstr ""
"Mientras que este decorador facilita la creación de tipos bien comportados y "
"totalmente ordenados, *does* a costa de una ejecución más lenta y de trazos "
"de pila (*stack traces*) más complejos para los métodos de comparación "
"derivados. Si la evaluación comparativa del rendimiento indica que se trata "
"de un cuello de botella para una aplicación determinada, la aplicación de "
"los seis métodos de comparación ricos en su lugar es probable que "
"proporcione un fácil aumento de la velocidad."
#: ../Doc/library/functools.rst:320
msgid ""
"This decorator makes no attempt to override methods that have been declared "
"in the class *or its superclasses*. Meaning that if a superclass defines a "
"comparison operator, *total_ordering* will not implement it again, even if "
"the original method is abstract."
msgstr ""
"Este decorador no intenta anular métodos que han sido declarados en la clase "
"*sus superclases*. Lo que significa que si una superclase define un operador "
"de comparación, *total_ordering* no lo implementará de nuevo, incluso si el "
"método original es abstracto."
#: ../Doc/library/functools.rst:327
msgid ""
"Returning NotImplemented from the underlying comparison function for "
"unrecognised types is now supported."
msgstr ""
"Retornando NotImplemented de la función de comparación subyacente para los "
"tipos no reconocidos está ahora soportado."
#: ../Doc/library/functools.rst:333
msgid ""
"Return a new :ref:`partial object<partial-objects>` which when called will "
"behave like *func* called with the positional arguments *args* and keyword "
"arguments *keywords*. If more arguments are supplied to the call, they are "
"appended to *args*. If additional keyword arguments are supplied, they "
"extend and override *keywords*. Roughly equivalent to::"
msgstr ""
"Retorna un nuevo :ref:`partial object<partial-objects>` que cuando sea "
"llamado se comportará como *func* llamado con los argumentos posicionales "
"*args* y los argumentos de palabras clave *keywords*. Si se suministran más "
"argumentos a la llamada, se añaden a *args*. Si se suministran más "
"argumentos de palabras clave, se extienden y anulan las *keywords*. "
"Aproximadamente equivalente a::"
#: ../Doc/library/functools.rst:349
msgid ""
"The :func:`partial` is used for partial function application which "
"\"freezes\" some portion of a function's arguments and/or keywords resulting "
"in a new object with a simplified signature. For example, :func:`partial` "
"can be used to create a callable that behaves like the :func:`int` function "
"where the *base* argument defaults to two:"
msgstr ""
"El :func:`partial` se utiliza para la aplicación de funciones parciales que "
"\"congela\" (*freezes*) alguna porción de los argumentos y/o palabras clave "
"de una función dando como resultado un nuevo objeto con una firma "
"simplificada. Por ejemplo, :func:`partial` puede usarse para crear una "
"llamada que se comporte como la función :func:`int` donde el argumento "
"*base* tiene un valor por defecto de dos:"
#: ../Doc/library/functools.rst:364
msgid ""
"Return a new :class:`partialmethod` descriptor which behaves like :class:"
"`partial` except that it is designed to be used as a method definition "
"rather than being directly callable."
msgstr ""
"Retorna un nuevo descriptor :class:`partialmethod` que se comporta como :"
"class:`partial` excepto que está diseñado para ser usado como una definición "
"de método en lugar de ser directamente invocable."
#: ../Doc/library/functools.rst:368
msgid ""
"*func* must be a :term:`descriptor` or a callable (objects which are both, "
"like normal functions, are handled as descriptors)."
msgstr ""
"*func* debe ser un :term:`descriptor` o un invocable (los objetos que son "
"ambos, como las funciones normales, se manejan como descriptores)."
#: ../Doc/library/functools.rst:371
msgid ""
"When *func* is a descriptor (such as a normal Python function, :func:"
"`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another "
"instance of :class:`partialmethod`), calls to ``__get__`` are delegated to "
"the underlying descriptor, and an appropriate :ref:`partial object<partial-"
"objects>` returned as the result."
msgstr ""
"Cuando *func* es un descriptor (como una función Python normal, :func:"
"`classmethod`, :func:`staticmethod`, :func:`abstractmethod` u otra instancia "
"de :class:`partialmethod`), las llamadas a ``__get__`` se delegan al "
"descriptor subyacente, y se retorna un :ref:`partial object<partial-"
"objects>` apropiado como resultado."
#: ../Doc/library/functools.rst:377
msgid ""
"When *func* is a non-descriptor callable, an appropriate bound method is "
"created dynamically. This behaves like a normal Python function when used as "
"a method: the *self* argument will be inserted as the first positional "
"argument, even before the *args* and *keywords* supplied to the :class:"
"`partialmethod` constructor."
msgstr ""
"Cuando *func* es una llamada no descriptiva, se crea dinámicamente un método "
"de unión apropiado. Esto se comporta como una función Python normal cuando "
"se usa como método: el argumento *self* se insertará como el primer "
"argumento posicional, incluso antes de las *args* y *keywords* suministradas "
"al constructor :class:`partialmethod`."
#: ../Doc/library/functools.rst:408
msgid ""
"Apply *function* of two arguments cumulatively to the items of *iterable*, "
"from left to right, so as to reduce the iterable to a single value. For "
"example, ``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` calculates "
"``((((1+2)+3)+4)+5)``. The left argument, *x*, is the accumulated value and "
"the right argument, *y*, is the update value from the *iterable*. If the "
"optional *initializer* is present, it is placed before the items of the "
"iterable in the calculation, and serves as a default when the iterable is "
"empty. If *initializer* is not given and *iterable* contains only one item, "
"the first item is returned."
msgstr ""
"Aplicar una *función* de dos argumentos acumulativos a los elementos de "
"*iterable*, de izquierda a derecha, para reducir los itables a un solo "
"valor. Por ejemplo, ``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` calcula "
"``((((1+2)+3)+4)+5)``. El argumento de la izquierda, *x*, es el valor "
"acumulado y el de la derecha, *y*, es el valor de actualización del "
"*iterable*. Si el *initializer* opcional está presente, se coloca antes de "
"los ítems de la iterable en el cálculo, y sirve como predeterminado cuando "
"la *iterable* está vacía. Si no se da el *initializer* y el *iterable* "
"contiene sólo un elemento, se retorna el primer elemento."
#: ../Doc/library/functools.rst:417
msgid "Roughly equivalent to::"
msgstr "Aproximadamente equivalente a::"
#: ../Doc/library/functools.rst:429
msgid ""
"See :func:`itertools.accumulate` for an iterator that yields all "
"intermediate values."
msgstr ""
"Ver :func:`itertools.accumulate` para un iterador que produce todos los "
"valores intermedios."
#: ../Doc/library/functools.rst:434
msgid ""
"Transform a function into a :term:`single-dispatch <single dispatch>` :term:"
"`generic function`."
msgstr ""
"Transformar una función en una :term:`single-dispatch <single dispatch>` :"
"term:`generic function`."
#: ../Doc/library/functools.rst:437
msgid ""
"To define a generic function, decorate it with the ``@singledispatch`` "
"decorator. When defining a function using ``@singledispatch``, note that the "
"dispatch happens on the type of the first argument::"
msgstr ""
"Para definir una función genérica, decórala con el decorador "
"``@singledispatch``. Al definir una función usando ``@singledispatch``, "
"tenga en cuenta que el envío ocurre en el tipo del primer argumento:"
#: ../Doc/library/functools.rst:448
msgid ""
"To add overloaded implementations to the function, use the :func:`register` "
"attribute of the generic function, which can be used as a decorator. For "
"functions annotated with types, the decorator will infer the type of the "
"first argument automatically::"
msgstr ""
"Para agregar implementaciones sobrecargadas a la función, use el atributo :"
"func:`register` de la función genérica, que se puede usar como decorador. "
"Para las funciones anotadas con tipos, el decorador inferirá automáticamente "
"el tipo del primer argumento:"
#: ../Doc/library/functools.rst:466
msgid ":data:`types.UnionType` and :data:`typing.Union` can also be used::"
msgstr ""
"También se pueden utilizar :data:`types.UnionType` y :data:`typing.Union`:"
#: ../Doc/library/functools.rst:483
msgid ""
"For code which doesn't use type annotations, the appropriate type argument "
"can be passed explicitly to the decorator itself::"
msgstr ""
"Para el código que no utiliza anotaciones de tipo, el argumento de tipo "
"apropiado puede ser pasado explícitamente al propio decorador::"
#: ../Doc/library/functools.rst:494
msgid ""
"To enable registering :term:`lambdas<lambda>` and pre-existing functions, "
"the :func:`register` attribute can also be used in a functional form::"
msgstr ""
"Para habilitar el registro de :term:`lambdas<lambda>` y funciones "
"preexistentes, el atributo :func:`register` también se puede utilizar de "
"forma funcional:"
#: ../Doc/library/functools.rst:502
msgid ""
"The :func:`register` attribute returns the undecorated function. This "
"enables decorator stacking, :mod:`pickling<pickle>`, and the creation of "
"unit tests for each variant independently::"
msgstr ""
"El atributo :func:`register` devuelve la función sin decorar. Esto permite "
"el apilamiento de decoradores, :mod:`pickling<pickle>`, y la creación de "
"pruebas unitarias para cada variante de forma independiente:"
#: ../Doc/library/functools.rst:516
msgid ""
"When called, the generic function dispatches on the type of the first "
"argument::"
msgstr ""
"Cuando se llama, la función genérica despacha sobre el tipo del primer "
"argumento::"
#: ../Doc/library/functools.rst:536
msgid ""
"Where there is no registered implementation for a specific type, its method "
"resolution order is used to find a more generic implementation. The original "
"function decorated with ``@singledispatch`` is registered for the base :"
"class:`object` type, which means it is used if no better implementation is "
"found."
msgstr ""
"Cuando no hay una implementación registrada para un tipo específico, se usa "
"su orden de resolución de métodos para encontrar una implementación más "
"genérica. La función original decorada con ``@singledispatch`` está "
"registrada para el tipo base :class:`object`, lo que significa que se usa si "
"no se encuentra una implementación mejor."
#: ../Doc/library/functools.rst:542
msgid ""
"If an implementation is registered to an :term:`abstract base class`, "
"virtual subclasses of the base class will be dispatched to that "
"implementation::"
msgstr ""
"Si una implementación está registrada en un :term:`abstract base class`, las "
"subclases virtuales de la clase base se enviarán a esa implementación:"
#: ../Doc/library/functools.rst:557
msgid ""
"To check which implementation the generic function will choose for a given "
"type, use the ``dispatch()`` attribute::"
msgstr ""
"Para verificar qué implementación elegirá la función genérica para un tipo "
"dado, use el atributo ``dispatch()``:"
#: ../Doc/library/functools.rst:565
msgid ""
"To access all registered implementations, use the read-only ``registry`` "
"attribute::"
msgstr ""
"Para acceder a todas las implementaciones registradas, utilice el atributo "
"``registry`` de sólo lectura::"
#: ../Doc/library/functools.rst:579
msgid "The :func:`register` attribute now supports using type annotations."
msgstr ""
"El atributo :func:`register` ahora admite el uso de anotaciones de tipo."
#: ../Doc/library/functools.rst:582
msgid ""
"The :func:`register` attribute now supports :data:`types.UnionType` and :"
"data:`typing.Union` as type annotations."
msgstr ""
"El atributo :func:`register` ahora admite :data:`types.UnionType` y :data:"
"`typing.Union` como anotaciones de tipo."
#: ../Doc/library/functools.rst:589
msgid ""
"Transform a method into a :term:`single-dispatch <single dispatch>` :term:"
"`generic function`."
msgstr ""
"Transformar un método en un :term:`single-dispatch <single dispatch>` :term:"
"`generic function`."
#: ../Doc/library/functools.rst:592
msgid ""
"To define a generic method, decorate it with the ``@singledispatchmethod`` "
"decorator. When defining a function using ``@singledispatchmethod``, note "
"that the dispatch happens on the type of the first non-*self* or non-*cls* "
"argument::"
msgstr ""
"Para definir un método genérico, decóralo con el decorador "
"``@singledispatchmethod``. Al definir una función usando "
"``@singledispatchmethod``, tenga en cuenta que el envío ocurre en el tipo "
"del primer argumento no *self* o no *cls*:"
#: ../Doc/library/functools.rst:610
msgid ""
"``@singledispatchmethod`` supports nesting with other decorators such as :"
"func:`@classmethod<classmethod>`. Note that to allow for ``dispatcher."
"register``, ``singledispatchmethod`` must be the *outer most* decorator. "
"Here is the ``Negator`` class with the ``neg`` methods bound to the class, "
"rather than an instance of the class::"
msgstr ""
"``@singledispatchmethod`` admite la anidación con otros decoradores como :"
"func:`@classmethod<classmethod>`. Tenga en cuenta que para permitir "
"``dispatcher.register``, ``singledispatchmethod`` debe ser el decorador *más "
"externo*. Aquí está la clase ``Negator`` con los métodos ``neg`` vinculados "
"a la clase, en lugar de una instancia de la clase:"
#: ../Doc/library/functools.rst:632
msgid ""
"The same pattern can be used for other similar decorators: :func:"
"`@staticmethod<staticmethod>`, :func:`@abstractmethod<abc.abstractmethod>`, "
"and others."
msgstr ""
"El mismo patrón se puede utilizar para otros decoradores similares: :func:"
"`@staticmethod<staticmethod>`, :func:`@abstractmethod<abc.abstractmethod>` y "
"otros."
#: ../Doc/library/functools.rst:641
msgid ""
"Update a *wrapper* function to look like the *wrapped* function. The "
"optional arguments are tuples to specify which attributes of the original "
"function are assigned directly to the matching attributes on the wrapper "
"function and which attributes of the wrapper function are updated with the "
"corresponding attributes from the original function. The default values for "
"these arguments are the module level constants ``WRAPPER_ASSIGNMENTS`` "
"(which assigns to the wrapper function's ``__module__``, ``__name__``, "
"``__qualname__``, ``__annotations__`` and ``__doc__``, the documentation "
"string) and ``WRAPPER_UPDATES`` (which updates the wrapper function's "
"``__dict__``, i.e. the instance dictionary)."
msgstr ""
"Actualiza una función *wrapper* para que se parezca a la función *wrapped*. "
"Los argumentos opcionales son tuplas para especificar qué atributos de la "
"función original se asignan directamente a los atributos coincidentes en la "
"función contenedora y qué atributos de la función contenedora se actualizan "
"con los atributos correspondientes de la función original. Los valores "
"predeterminados para estos argumentos son las constantes de nivel de módulo "
"``WRAPPER_ASSIGNMENTS`` (que se asigna a la función contenedora "
"``__module__``, ``__name__``, ``__qualname__``, ``__annotations__`` y "
"``__doc__``, la cadena de caracteres de documentación) y ``WRAPPER_UPDATES`` "
"(que actualiza el ``__dict__`` de la función contenedora, es decir, el "
"diccionario de instancia)."
#: ../Doc/library/functools.rst:651
msgid ""
"To allow access to the original function for introspection and other "
"purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), "
"this function automatically adds a ``__wrapped__`` attribute to the wrapper "
"that refers to the function being wrapped."
msgstr ""
"Para permitir el acceso a la función original para la introspección y otros "
"propósitos (por ejemplo, evitando un decorador de caché como :func:"
"`lru_cache`), esta función añade automáticamente un atributo ``__wrapped__`` "
"al envoltorio que se refiere a la función que se está envolviendo."
#: ../Doc/library/functools.rst:656
msgid ""
"The main intended use for this function is in :term:`decorator` functions "
"which wrap the decorated function and return the wrapper. If the wrapper "
"function is not updated, the metadata of the returned function will reflect "
"the wrapper definition rather than the original function definition, which "
"is typically less than helpful."
msgstr ""
"El principal uso previsto para esta función es en :term:`decorator` "
"functions que envuelven la función decorada y retornan el envoltorio. Si la "
"función de envoltura no se actualiza, los metadatos de la función retornada "
"reflejarán la definición de la envoltura en lugar de la definición de la "
"función original, lo que normalmente no es de gran ayuda."
#: ../Doc/library/functools.rst:662
msgid ""
":func:`update_wrapper` may be used with callables other than functions. Any "
"attributes named in *assigned* or *updated* that are missing from the object "
"being wrapped are ignored (i.e. this function will not attempt to set them "
"on the wrapper function). :exc:`AttributeError` is still raised if the "
"wrapper function itself is missing any attributes named in *updated*."
msgstr ""
":func:`update_wrapper` puede ser usado con otros invocables que no sean "
"funciones. Cualquier atributo nombrado en *assigned* o *updated* que falte "
"en el objeto que se está invoca se ignora (es decir, esta función no "
"intentará establecerlos en la función de envoltura (*wrapper*)). :exc:"
"`AttributeError` sigue apareciendo si la propia función de envoltura no "
"tiene ningún atributo nombrado en *updated*."
#: ../Doc/library/functools.rst:668
msgid "Automatic addition of the ``__wrapped__`` attribute."
msgstr "Adición automática de ``__wrapped__`` attribute."
#: ../Doc/library/functools.rst:671
msgid "Copying of the ``__annotations__`` attribute by default."
msgstr "Copia del atributo ``__annotations__`` por defecto."
#: ../Doc/library/functools.rst:674
msgid "Missing attributes no longer trigger an :exc:`AttributeError`."
msgstr "Los atributos faltantes ya no desencadenan un :exc:`AtributoError`."
#: ../Doc/library/functools.rst:677
msgid ""
"The ``__wrapped__`` attribute now always refers to the wrapped function, "
"even if that function defined a ``__wrapped__`` attribute. (see :issue:"
"`17482`)"
msgstr ""
"El atributo ``__wrapped__`` ahora siempre se refiere a la función envuelta, "
"incluso si esa función definió un atributo ``__wrapped__``. (see :issue:"
"`17482`)"
#: ../Doc/library/functools.rst:685
msgid ""
"This is a convenience function for invoking :func:`update_wrapper` as a "
"function decorator when defining a wrapper function. It is equivalent to "
"``partial(update_wrapper, wrapped=wrapped, assigned=assigned, "
"updated=updated)``. For example::"
msgstr ""
"Esta es una función conveniente para invocar :func:`update_wrapper` como "
"decorador de la función cuando se define una función de envoltura "
"(*wrapper*). Es equivalente a ``partial(update_wrapper, wrapped=wrapped, "
"assigned=assigned, updated=updated)``. Por ejemplo::"
#: ../Doc/library/functools.rst:711
msgid ""
"Without the use of this decorator factory, the name of the example function "
"would have been ``'wrapper'``, and the docstring of the original :func:"
"`example` would have been lost."
msgstr ""
"Sin el uso de esta fábrica de decoradores, el nombre de la función de "
"ejemplo habría sido ``'wrapper'``, y el docstring de la :func:`example` se "
"habría perdido."
#: ../Doc/library/functools.rst:719
msgid ":class:`partial` Objects"
msgstr ":class:`partial` Objetos"
#: ../Doc/library/functools.rst:721
msgid ""
":class:`partial` objects are callable objects created by :func:`partial`. "
"They have three read-only attributes:"
msgstr ""
"Los objetos :class:`partial` son objetos invocables creados por :func:"
"`partial`. Tienen tres atributos de sólo lectura:"
#: ../Doc/library/functools.rst:727
msgid ""
"A callable object or function. Calls to the :class:`partial` object will be "
"forwarded to :attr:`func` with new arguments and keywords."
msgstr ""
"Un objeto o función invocable. Las llamadas al objeto :class:`partial` "
"serán reenviadas a :attr:`func` con nuevos argumentos y palabras clave."
#: ../Doc/library/functools.rst:733
msgid ""
"The leftmost positional arguments that will be prepended to the positional "
"arguments provided to a :class:`partial` object call."
msgstr ""
"Los argumentos posicionales de la izquierda que se prepararán para los "
"argumentos posicionales proporcionados un llamado al objeto :class:`partial`."
#: ../Doc/library/functools.rst:739
msgid ""
"The keyword arguments that will be supplied when the :class:`partial` object "
"is called."
msgstr ""
"Los argumentos de la palabra clave que se suministrarán cuando se llame al "
"objeto :class:`partial`."
#: ../Doc/library/functools.rst:742
msgid ""
":class:`partial` objects are like :class:`function` objects in that they are "
"callable, weak referencable, and can have attributes. There are some "
"important differences. For instance, the :attr:`~definition.__name__` and :"
"attr:`__doc__` attributes are not created automatically. Also, :class:"
"`partial` objects defined in classes behave like static methods and do not "
"transform into bound methods during instance attribute look-up."
msgstr ""
"Los objetos :class:`partial` son como los objetos :class:`function` que son "
"invocables, de referencia débil y pueden tener atributos. Hay algunas "
"diferencias importantes. Por ejemplo, los atributos :attr:`~definition."
"__name__` y :attr:`__doc__` no se crean automáticamente. Además, los "
"objetos :class:`partial` definidos en las clases se comportan como métodos "
"estáticos y no se transforman en métodos vinculados durante la búsqueda de "
"atributos de la instancia."