diff --git a/TRANSLATORS b/TRANSLATORS index bf00c37ed9..4bf488c9cc 100644 --- a/TRANSLATORS +++ b/TRANSLATORS @@ -5,23 +5,26 @@ Jhonatan Barrera (@iam3mer) Héctor Canto (@hectorcanto_dev) Carlos Crespo (@cacrespo) Raúl Cumplido (@raulcd) -Carlos Joel Delgado Pizarro (@c0x6a) +Javier Daza (@javierdaza) +Sergio Delgado Quintero (@sdelquin) Nicolás Demarchi (@gilgamezh) Xavi Francisco (@srxavi) Manuel Kaufmann (@humitos) +Pablo Lobariñas (@Qkolnek) Alvar Maciel (@alvarmaciel @amaciel) Cristián Maureira-Fredes (@cmaureir) Darwing Medina Lacayo (@darwing1210) Claudia Millán Nebot (@clacri @cheshireminima) +Carlos Joel Delgado Pizarro (@c0x6a) María José Molina Contreras (@mjmolina) -María Andrea Vignau (@mavignau @marian-vignau) Marco Richetta (@marcorichetta) Elisabeth Ortega (@draentropia) Cristian Rengifo (@ingrengifo) Pablo Lobariñas (@Qkolnek) Sergio Delgado Quintero (@sdelquin) Silvina Tamburini (@silvinabt87) -Javier Daza (@javierdaza) +David Trigo Chávez (@dtrinf) Agustina Quiros (@qagustina) +María Andrea Vignau (@mavignau @marian-vignau) Leonardo Gomez (@gomezgleonardob) José Miguel Hernández Cabrera (@miguelheca) diff --git a/dict b/dict index 624f83dd6b..e0bdb7ab4b 100644 --- a/dict +++ b/dict @@ -23,6 +23,16 @@ Cameron Chapman Circus Cocoa +Tim +Peters +Algorithms +sec +faltantes +nsec +usec +msec +pass +timeit Comos Compaq Conceptualmente diff --git a/library/timeit.po b/library/timeit.po index f4c41545cf..5179a7b92b 100644 --- a/library/timeit.po +++ b/library/timeit.po @@ -6,27 +6,31 @@ # Check https://github.com/PyCampES/python-docs-es/blob/3.8/TRANSLATORS to # get the list of volunteers # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-05 12:54+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2020-05-24 12:05+0200\n" "Language-Team: python-doc-es\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.8.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Last-Translator: \n" +"Language: es\n" +"X-Generator: Poedit 2.3.1\n" #: ../Doc/library/timeit.rst:2 msgid ":mod:`timeit` --- Measure execution time of small code snippets" msgstr "" +":mod:`timeit` --- Mide el tiempo de ejecución de pequeños fragmentos de " +"código" #: ../Doc/library/timeit.rst:7 msgid "**Source code:** :source:`Lib/timeit.py`" -msgstr "" +msgstr "**Código fuente:** :source:`Lib/timeit.py`" #: ../Doc/library/timeit.rst:15 msgid "" @@ -36,24 +40,32 @@ msgid "" "execution times. See also Tim Peters' introduction to the \"Algorithms\" " "chapter in the *Python Cookbook*, published by O'Reilly." msgstr "" +"Este módulo proporciona una manera sencilla de cronometrar pequeños bits de " +"código Python. Tiene un :ref:`timeit-command-line-interface` así como un :" +"ref:`callable `. Evita una serie de trampas comunes para " +"medir los tiempos de ejecución. Véase también la introducción de Tim Peters " +"al capítulo \"Algorithms\" en el libro *Python Cookbook*, publicado por " +"O'Reilly." #: ../Doc/library/timeit.rst:23 msgid "Basic Examples" -msgstr "" +msgstr "Ejemplos básicos" #: ../Doc/library/timeit.rst:25 msgid "" "The following example shows how the :ref:`timeit-command-line-interface` can " "be used to compare three different expressions:" msgstr "" +"En el ejemplo siguiente se muestra cómo se puede utilizar :ref:`timeit-" +"command-line-interface` para comparar tres expresiones diferentes:" #: ../Doc/library/timeit.rst:37 msgid "This can be achieved from the :ref:`python-interface` with::" -msgstr "" +msgstr "Esto se puede lograr desde :ref:`python-interface` con::" #: ../Doc/library/timeit.rst:47 msgid "A callable can also be passed from the :ref:`python-interface`::" -msgstr "" +msgstr "Un invocable también se puede pasar desde el :ref:`python-interface`::" #: ../Doc/library/timeit.rst:52 msgid "" @@ -61,14 +73,18 @@ msgid "" "repetitions only when the command-line interface is used. In the :ref:" "`timeit-examples` section you can find more advanced examples." msgstr "" +"Sin embargo, tenga en cuenta que :func:`.timeit` determinará automáticamente " +"el número de repeticiones solo cuando se utiliza la interfaz de línea de " +"comandos. En la sección :ref:`timeit-examples` puede encontrar ejemplos más " +"avanzados." #: ../Doc/library/timeit.rst:60 msgid "Python Interface" -msgstr "" +msgstr "Interfaz de Python" #: ../Doc/library/timeit.rst:62 msgid "The module defines three convenience functions and a public class:" -msgstr "" +msgstr "El módulo define tres funciones de conveniencia y una clase pública:" #: ../Doc/library/timeit.rst:67 msgid "" @@ -77,35 +93,47 @@ msgid "" "executions. The optional *globals* argument specifies a namespace in which " "to execute the code." msgstr "" +"Cree una instancia de :class:`Timer` con la instrucción dada, el código " +"*setup* y la función *timer* y ejecute su método :meth:`.timeit` con las " +"ejecuciones *number*. El argumento *globals* opcional especifica un espacio " +"de nombres en el que se ejecutará el código." #: ../Doc/library/timeit.rst:72 ../Doc/library/timeit.rst:83 #: ../Doc/library/timeit.rst:120 msgid "The optional *globals* parameter was added." -msgstr "" +msgstr "El parámetro opcional *globals* fue añadido." +# No estoy seguro cómo organizar los argumentos "repeat" y "number" #: ../Doc/library/timeit.rst:78 +#, fuzzy msgid "" "Create a :class:`Timer` instance with the given statement, *setup* code and " "*timer* function and run its :meth:`.repeat` method with the given *repeat* " "count and *number* executions. The optional *globals* argument specifies a " "namespace in which to execute the code." msgstr "" +"Crea una instancia de :class:`Timer` con la instrucción dada, el código " +"*setup* y la función *timer* y ejecuta su método :meth:`.repeat` con las " +"ejecuciones *repeat* y *number* dadas. El argumento *globals* opcional " +"especifica un espacio de nombres en el que se ejecutará el código." #: ../Doc/library/timeit.rst:86 ../Doc/library/timeit.rst:181 msgid "Default value of *repeat* changed from 3 to 5." -msgstr "" +msgstr "El valor por defecto para *repeat* cambió de 3 a 5." #: ../Doc/library/timeit.rst:91 msgid "The default timer, which is always :func:`time.perf_counter`." -msgstr "" +msgstr "El temporizador por defecto, que es siempre :func:`time.perf_counter`." #: ../Doc/library/timeit.rst:93 msgid ":func:`time.perf_counter` is now the default timer." -msgstr "" +msgstr ":func:`time.perf_counter` es ahora el temporizador por defecto." #: ../Doc/library/timeit.rst:99 msgid "Class for timing execution speed of small code snippets." msgstr "" +"Clase para la velocidad de tiempo de ejecución de pequeños fragmentos de " +"código." #: ../Doc/library/timeit.rst:101 msgid "" @@ -117,6 +145,15 @@ msgid "" "will by default be executed within timeit's namespace; this behavior can be " "controlled by passing a namespace to *globals*." msgstr "" +"El constructor toma una instrucción que se cronometra, una instrucción " +"adicional utilizada para la instalación, y una función de temporizador. " +"Ambas instrucciones tienen como valor predeterminado ``'pass'``; la función " +"del temporizador depende de la plataforma (consulte la cadena *doc* del " +"módulo). *stmt* y *setup* también pueden contener varias instrucciones " +"separadas por ``;`` o líneas nuevas, siempre y cuando no contengan literales " +"de cadena de varias líneas. La instrucción se ejecutará de forma " +"predeterminada dentro del espacio de nombres timeit; este comportamiento se " +"puede controlar pasando un espacio de nombres a *globals*." #: ../Doc/library/timeit.rst:109 msgid "" @@ -124,12 +161,17 @@ msgid "" "timeit` method. The :meth:`.repeat` and :meth:`.autorange` methods are " "convenience methods to call :meth:`.timeit` multiple times." msgstr "" +"Para medir el tiempo de ejecución de la primera instrucción, utilice el " +"método :meth:`.timeit`. Los métodos :meth:`.repeat` y :meth:`.autorange` " +"son métodos de conveniencia para llamar al método :meth:`.timeit` varias " +"veces." #: ../Doc/library/timeit.rst:113 msgid "" "The execution time of *setup* is excluded from the overall timed execution " "run." msgstr "" +"El tiempo de ejecución de *setup* se excluye de la ejecución de tiempo total." #: ../Doc/library/timeit.rst:115 msgid "" @@ -138,6 +180,11 @@ msgid "" "will then be executed by :meth:`.timeit`. Note that the timing overhead is " "a little larger in this case because of the extra function calls." msgstr "" +"Los parámetros *stmt* y *setup* también pueden tomar objetos a los que se " +"puede llamar sin argumentos. Esto embebe llamadas a ellos en una función de " +"temporizador que luego será ejecutada por :meth:`.timeit`. Tenga en cuenta " +"que la sobrecarga de tiempo es un poco mayor en este caso debido a las " +"llamadas de función adicionales." #: ../Doc/library/timeit.rst:125 msgid "" @@ -148,6 +195,12 @@ msgid "" "statement, the setup statement and the timer function to be used are passed " "to the constructor." msgstr "" +"Tiempo *number* ejecuciones de la instrucción principal. Esto ejecuta la " +"instrucción *setup* una vez y, a continuación, devuelve el tiempo que se " +"tarda en ejecutar la instrucción principal varias veces, medida en segundos " +"como un float. El argumento es el número de veces que se ejecuta el bucle, " +"por defecto a un millón. La instrucción principal, la instrucción *setup* y " +"la función *timer* que se va a utilizar se pasan al constructor." #: ../Doc/library/timeit.rst:134 msgid "" @@ -158,10 +211,16 @@ msgid "" "so, GC can be re-enabled as the first statement in the *setup* string. For " "example::" msgstr "" +"De forma predeterminada, :meth:`.timeit` desactiva temporalmente :term:" +"`garbage collection` durante la medición. La ventaja de este enfoque es que " +"hace que los tiempos independientes sean más comparables. La desventaja es " +"que GC puede ser un componente importante del rendimiento de la función que " +"se está midiendo. Si es así, GC se puede volver a habilitar como la primera " +"instrucción en la cadena *setup*. Por ejemplo::" #: ../Doc/library/timeit.rst:146 msgid "Automatically determine how many times to call :meth:`.timeit`." -msgstr "" +msgstr "Determina automáticamente cuántas veces llamar a :meth:`.timeit`." #: ../Doc/library/timeit.rst:148 msgid "" @@ -171,16 +230,24 @@ msgid "" "numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the time taken is " "at least 0.2 second." msgstr "" +"Esta es una función de conveniencia que llama a :meth:`.timeit` " +"repetidamente para que el tiempo total >= 0,2 segundos, devolviendo el " +"eventual (número de bucles, tiempo tomado para ese número de bucles). Este " +"método llama a :meth:`.timeit` con números crecientes de la secuencia 1, 2, " +"5, 10, 20, 50, ... hasta que el tiempo necesario sea de al menos 0.2 " +"segundos." #: ../Doc/library/timeit.rst:154 msgid "" "If *callback* is given and is not ``None``, it will be called after each " "trial with two arguments: ``callback(number, time_taken)``." msgstr "" +"Si *callback* se da y no es ``None``, se llamará después de cada prueba con " +"dos argumentos: ``callback(number, time_taken)``." #: ../Doc/library/timeit.rst:162 msgid "Call :meth:`.timeit` a few times." -msgstr "" +msgstr "Llama a :meth:`.timeit` algunas veces." #: ../Doc/library/timeit.rst:164 msgid "" @@ -189,6 +256,10 @@ msgid "" "call :meth:`.timeit`. The second argument specifies the *number* argument " "for :meth:`.timeit`." msgstr "" +"Esta es una función de conveniencia que llama a :meth:`.timeit` " +"repetidamente, devolviendo una lista de resultados. El primer argumento " +"especifica cuántas veces se debe llamar a :meth:`.timeit`. El segundo " +"argumento especifica el argumento *number* para :meth:`.timeit`." #: ../Doc/library/timeit.rst:171 msgid "" @@ -201,14 +272,24 @@ msgid "" "only number you should be interested in. After that, you should look at the " "entire vector and apply common sense rather than statistics." msgstr "" +"Es tentador calcular la media y la desviación estándar del vector de " +"resultados e informar de estos. Sin embargo, esto no es muy útil. En un " +"caso típico, el valor más bajo proporciona un límite inferior para la " +"rapidez con la que el equipo puede ejecutar el fragmento de código " +"especificado; valores más altos en el vector de resultado normalmente no son " +"causados por la variabilidad en la velocidad de Python, sino por otros " +"procesos que interfieren con su precisión de sincronización. Así que el :" +"func:`min` del resultado es probablemente el único número que debería estar " +"interesado en. Después de eso, usted debe mirar todo el vector y aplicar el " +"sentido común en lugar de las estadísticas." #: ../Doc/library/timeit.rst:187 msgid "Helper to print a traceback from the timed code." -msgstr "" +msgstr "Ayudante para imprimir un seguimiento desde el código cronometrado." #: ../Doc/library/timeit.rst:189 msgid "Typical use::" -msgstr "" +msgstr "Uso típico::" #: ../Doc/library/timeit.rst:197 msgid "" @@ -216,50 +297,63 @@ msgid "" "compiled template will be displayed. The optional *file* argument directs " "where the traceback is sent; it defaults to :data:`sys.stderr`." msgstr "" +"La ventaja sobre el seguimiento estándar es que se mostrarán las líneas de " +"origen de la plantilla compilada. El argumento opcional *file* dirige dónde " +"se envía el seguimiento; por defecto a :data:`sys.stderr`." #: ../Doc/library/timeit.rst:205 msgid "Command-Line Interface" -msgstr "" +msgstr "Interfaz de línea de comandos" #: ../Doc/library/timeit.rst:207 msgid "" "When called as a program from the command line, the following form is used::" msgstr "" +"Cuando se llama como un programa desde la línea de comandos, se utiliza el " +"siguiente formulario:" #: ../Doc/library/timeit.rst:211 msgid "Where the following options are understood:" -msgstr "" +msgstr "Cuando las siguientes opciones son entendidas:" #: ../Doc/library/timeit.rst:217 msgid "how many times to execute 'statement'" -msgstr "" +msgstr "cuantas veces para ejecutar '*statement*'" #: ../Doc/library/timeit.rst:221 msgid "how many times to repeat the timer (default 5)" -msgstr "" +msgstr "cuantas veces se va a repetir el temporizador (predeterminado 5)" #: ../Doc/library/timeit.rst:225 msgid "statement to be executed once initially (default ``pass``)" msgstr "" +"instrucción a ser ejecutada una vez inicialmente (por defecto ``pass``)" #: ../Doc/library/timeit.rst:229 msgid "" "measure process time, not wallclock time, using :func:`time.process_time` " "instead of :func:`time.perf_counter`, which is the default" msgstr "" +"mide el tiempo de proceso, no el tiempo total de ejecución, utilizando :func:" +"`time.process_time` en lugar de :func:`time.perf_counter`, que es el valor " +"predeterminado" #: ../Doc/library/timeit.rst:236 msgid "" "specify a time unit for timer output; can select nsec, usec, msec, or sec" msgstr "" +"especifica una unidad de tiempo para la salida del temporizador; puede ser " +"nsec, usec, msec o sec" #: ../Doc/library/timeit.rst:242 msgid "print raw timing results; repeat for more digits precision" msgstr "" +"imprime los resultados de tiempo en bruto; repetir para más dígitos de " +"precisión" #: ../Doc/library/timeit.rst:246 msgid "print a short usage message and exit" -msgstr "" +msgstr "imprime un mensaje de uso corto y sale" #: ../Doc/library/timeit.rst:248 msgid "" @@ -268,6 +362,10 @@ msgid "" "quotes and using leading spaces. Multiple :option:`-s` options are treated " "similarly." msgstr "" +"Se puede dar una instrucción de varias líneas especificando cada línea como " +"un argumento de instrucción independiente; Las líneas con sangría son " +"posibles entrecomillando un argumento y utilizando espacios iniciales. " +"Múltiples opciones :option:`s` se tratan de forma similar." #: ../Doc/library/timeit.rst:253 msgid "" @@ -275,6 +373,9 @@ msgid "" "trying increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until " "the total time is at least 0.2 seconds." msgstr "" +"Si no se da :option:`-n`, se calcula un número adecuado de bucles intentando " +"aumentar los números de la secuencia 1, 2, 5, 10, 20, 50, ... hasta que el " +"tiempo total sea de al menos 0.2 segundos." #: ../Doc/library/timeit.rst:257 msgid "" @@ -285,6 +386,13 @@ msgid "" "probably enough in most cases. You can use :func:`time.process_time` to " "measure CPU time." msgstr "" +"Las mediciones de :func:`default_timer` pueden verse afectadas por otros " +"programas que se ejecutan en la misma máquina, por lo que lo mejor que se " +"puede hacer cuando es necesario una medición de tiempo precisa es repetir la " +"medición un par de veces y utilizar el mejor tiempo. La opción :option:`-r` " +"es buena para esto; el valor predeterminado de 5 repeticiones es " +"probablemente suficiente en la mayoría de los casos. Puede usar :func:`time." +"process_time` para medir el tiempo de CPU." #: ../Doc/library/timeit.rst:265 msgid "" @@ -293,20 +401,26 @@ msgid "" "it. The baseline overhead can be measured by invoking the program without " "arguments, and it might differ between Python versions." msgstr "" +"Hay una cierta sobrecarga de línea base asociada con la ejecución de una " +"instrucción pass. El código aquí no intenta ocultarlo, pero debe ser " +"consciente de ello. La sobrecarga de línea base se puede medir invocando el " +"programa sin argumentos y puede diferir entre versiones de Python." #: ../Doc/library/timeit.rst:274 msgid "Examples" -msgstr "" +msgstr "Ejemplos" #: ../Doc/library/timeit.rst:276 msgid "" "It is possible to provide a setup statement that is executed only once at " "the beginning:" msgstr "" +"Es posible proporcionar una instrucción *setup* que se ejecuta solo una vez " +"al inicio:" #: ../Doc/library/timeit.rst:293 msgid "The same can be done using the :class:`Timer` class and its methods::" -msgstr "" +msgstr "Se puede hacer lo mismo usando la clase :class:`Timer` y sus métodos::" #: ../Doc/library/timeit.rst:303 msgid "" @@ -314,12 +428,18 @@ msgid "" "lines. Here we compare the cost of using :func:`hasattr` vs. :keyword:`try`/:" "keyword:`except` to test for missing and present object attributes:" msgstr "" +"En los ejemplos siguientes se muestra cómo cronometrar expresiones que " +"contienen varias líneas. Aquí comparamos el coste de usar :func:`hasattr` " +"frente a :keyword:`try`/:keyword:`except` para probar los atributos de " +"objeto faltantes y presentes:" #: ../Doc/library/timeit.rst:349 msgid "" "To give the :mod:`timeit` module access to functions you define, you can " "pass a *setup* parameter which contains an import statement::" msgstr "" +"Para dar al módulo :mod:`timeit` acceso a las funciones que defina, puede " +"pasar un parámetro *setup* que contenga una instrucción import::" #: ../Doc/library/timeit.rst:360 msgid "" @@ -327,3 +447,6 @@ msgid "" "will cause the code to be executed within your current global namespace. " "This can be more convenient than individually specifying imports::" msgstr "" +"Otra opción es pasar :func:`globals` al parámetro *globals*, lo que hará que " +"el código se ejecute dentro del espacio de nombres global actual. Esto " +"puede ser más conveniente que especificar individualmente las importaciones::"