From 3be69704b68d9ed5384ee90768d8a8a7aea1c590 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 10:43:04 +0200 Subject: [PATCH 01/24] Tutorial PyAr submodule --- .gitmodules | 3 +++ .migration/tutorialpyar | 1 + 2 files changed, 4 insertions(+) create mode 160000 .migration/tutorialpyar diff --git a/.gitmodules b/.gitmodules index f5517ef7c9..5a46218902 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,3 +3,6 @@ url = https://github.com/python/cpython.git branch = 3.7 shallow = true +[submodule "tutorialpyar"] + path = .migration/tutorialpyar + url = https://github.com/pyar/tutorial.git diff --git a/.migration/tutorialpyar b/.migration/tutorialpyar new file mode 160000 index 0000000000..0497769a04 --- /dev/null +++ b/.migration/tutorialpyar @@ -0,0 +1 @@ +Subproject commit 0497769a0417d496393bd7a7a8f956e7551d965d From f71c1fd159edba8f95303b45f0b08336bfb10ef6 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 10:43:53 +0200 Subject: [PATCH 02/24] rst2po.py --- .migration/rst2po.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .migration/rst2po.py diff --git a/.migration/rst2po.py b/.migration/rst2po.py new file mode 100644 index 0000000000..943f6b8aca --- /dev/null +++ b/.migration/rst2po.py @@ -0,0 +1,9 @@ +# rst2po.py +# Script to migrate the Python official tutorial that we have already translated in PyAr +# (https://github.com/PyAr/tutorial) from reStructuredText to the new official translation format (.po) +# +# It parses the .rst and compare sentence/paragraph by sentence/paragraph and if the match is exact, +# and there is no translation for that sentence/paragraph it updates the .po file with the translated text +# from the .rst file. + +import polib # fades From 3951c61ca18a704ea1843efc147d407564228475 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 11:01:06 +0200 Subject: [PATCH 03/24] Skel for the rst2po.py script --- .migration/rst2po.py | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/.migration/rst2po.py b/.migration/rst2po.py index 943f6b8aca..7967dc8ad9 100644 --- a/.migration/rst2po.py +++ b/.migration/rst2po.py @@ -6,4 +6,56 @@ # and there is no translation for that sentence/paragraph it updates the .po file with the translated text # from the .rst file. +import glob +import os import polib # fades + + +PO_DIR = os.path.abspath( + os.path.join( + os.path.dirname(__file__), + '..', + )) + +RST_DIR = os.path.abspath( + os.path.join( + os.path.dirname(__file__), + 'tutorialpyar', + )) + + + +def get_rst_file(pofilename): + """Given a .po filename returns the corresponding .rst filename""" + pass + + +def get_rst_translation_text(rstfilename, text): + """Given an rstfilename an a text returns the corresponding translated text if exists""" + pass + + +def update_po_translation(pofilename, english, spanish): + """Update the pofilename with the translated spanish text""" + pass + + + +for pofilename in glob.glob(PO_DIR + '**/*.po'): + rstfilename = get_rst_file(pofilename) + if rst is None: + continue + + po = polib.pofile(pofilename) + for entry in po: + english_text = entry.msgid + spanish_text = entry.msgstr + if spanish_text: + # Do not override already translated text + continue + + translated_text = get_rst_translation_text(rstfilename, english_text) + if translated_text is None: + continue + + update_po_translation(po, english_text, translated_text) From 8cbe9ed9feb4488b83a76afd875f3ef7ae55705f Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 13:06:04 +0200 Subject: [PATCH 04/24] About to start the (english, spanish) mapping list --- .migration/rst2po.py | 54 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/.migration/rst2po.py b/.migration/rst2po.py index 7967dc8ad9..7625459778 100644 --- a/.migration/rst2po.py +++ b/.migration/rst2po.py @@ -6,6 +6,7 @@ # and there is no translation for that sentence/paragraph it updates the .po file with the translated text # from the .rst file. +import re import glob import os import polib # fades @@ -17,17 +18,55 @@ '..', )) -RST_DIR = os.path.abspath( +RST_TRADUCIDOS_DIR = os.path.abspath( os.path.join( os.path.dirname(__file__), 'tutorialpyar', + 'traducidos', + )) + +RST_ORIGINAL_DIR = os.path.abspath( + os.path.join( + os.path.dirname(__file__), + 'tutorialpyar', + 'original', )) def get_rst_file(pofilename): """Given a .po filename returns the corresponding .rst filename""" - pass + basename = os.path.basename(pofilename) + basename, ext = basename.split('.') + rstfilename = os.path.join(RST_TRADUCIDOS_DIR, f'{basename}.rst') + if os.path.exists(rstfilename): + return rstfilename + + +def get_rst_original_filename(rstfilename): + if rstfilename.endswith('real-index.rst'): + rst_original_filename = 'index.rst' + + rst_original_filename = os.path.join(RST_ORIGINAL_DIR, rst_original_filename) + if os.path.exists(rst_original_filename): + return rst_original_filename + + +def create_english_spanish_sentences(rstfilename): + """Create a tuple of (english, spanish) sentences for rstfilename""" + + # NOTE: we could use docutils and parse the rst in the correct way, but + # that will probably take more time + + with open(rstfilename) as fd: + lines = [] + for line in fd.read().splitlines(): + if re.match('^[a-zA-Z] ', line): + # keep text lines only + lines.append(line) + # make the document just one line so we can split it in sentences + document = ' '.join(lines) + import pdb; pdb.set_trace() def get_rst_translation_text(rstfilename, text): @@ -40,12 +79,13 @@ def update_po_translation(pofilename, english, spanish): pass - -for pofilename in glob.glob(PO_DIR + '**/*.po'): +for pofilename in glob.glob(PO_DIR + '**/*/*.po'): rstfilename = get_rst_file(pofilename) - if rst is None: + if rstfilename is None: continue + create_english_spanish_sentences(rstfilename) + po = polib.pofile(pofilename) for entry in po: english_text = entry.msgid @@ -58,4 +98,6 @@ def update_po_translation(pofilename, english, spanish): if translated_text is None: continue - update_po_translation(po, english_text, translated_text) + entry.msgstr = translated_text + # update_po_translation(po, english_text, translated_text) + po.save(pofilename) From 25b5aa7b8ffdea8de512fa73bbced94b7b1f7715 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 14:30:35 +0200 Subject: [PATCH 05/24] Initial working version of rst2po.py --- .migration/rst2po.py | 54 ++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 14 deletions(-) diff --git a/.migration/rst2po.py b/.migration/rst2po.py index 7625459778..044bde00ef 100644 --- a/.migration/rst2po.py +++ b/.migration/rst2po.py @@ -37,17 +37,19 @@ def get_rst_file(pofilename): """Given a .po filename returns the corresponding .rst filename""" basename = os.path.basename(pofilename) - basename, ext = basename.split('.') + basename, ext = basename.rsplit('.', 1) rstfilename = os.path.join(RST_TRADUCIDOS_DIR, f'{basename}.rst') if os.path.exists(rstfilename): return rstfilename def get_rst_original_filename(rstfilename): + rst_original_filename = '' if rstfilename.endswith('real-index.rst'): rst_original_filename = 'index.rst' - rst_original_filename = os.path.join(RST_ORIGINAL_DIR, rst_original_filename) + basename = os.path.basename(rst_original_filename or rstfilename) + rst_original_filename = os.path.join(RST_ORIGINAL_DIR, basename) if os.path.exists(rst_original_filename): return rst_original_filename @@ -55,23 +57,47 @@ def get_rst_original_filename(rstfilename): def create_english_spanish_sentences(rstfilename): """Create a tuple of (english, spanish) sentences for rstfilename""" + def get_paragraph(fd): + lines = [] + paragraph = [] + for line in fd.read().splitlines(): + # import pdb; pdb.set_trace() + if any([ + line.startswith('.. '), + line.startswith('==='), + line.startswith('---'), + line.startswith('***'), + ]): + continue + + if line == '' and not paragraph: + continue + + if line == '': + lines.append(' '.join(paragraph)) + paragraph = [] + continue + paragraph.append(line) + + return lines + # NOTE: we could use docutils and parse the rst in the correct way, but # that will probably take more time + with open(get_rst_original_filename(rstfilename)) as fd: + english = get_paragraph(fd) with open(rstfilename) as fd: - lines = [] - for line in fd.read().splitlines(): - if re.match('^[a-zA-Z] ', line): - # keep text lines only - lines.append(line) - # make the document just one line so we can split it in sentences - document = ' '.join(lines) - import pdb; pdb.set_trace() + spanish = get_paragraph(fd) + + result = list(zip(english, spanish)) + return result -def get_rst_translation_text(rstfilename, text): +def get_rst_translation_text(rstfilename, english_spanish, text): """Given an rstfilename an a text returns the corresponding translated text if exists""" - pass + for en, es in english_spanish: + if en == text: + return es def update_po_translation(pofilename, english, spanish): @@ -84,7 +110,7 @@ def update_po_translation(pofilename, english, spanish): if rstfilename is None: continue - create_english_spanish_sentences(rstfilename) + english_spanish = create_english_spanish_sentences(rstfilename) po = polib.pofile(pofilename) for entry in po: @@ -94,7 +120,7 @@ def update_po_translation(pofilename, english, spanish): # Do not override already translated text continue - translated_text = get_rst_translation_text(rstfilename, english_text) + translated_text = get_rst_translation_text(rstfilename, english_spanish, english_text) if translated_text is None: continue From 9ff4f8c28678a7c9ea2fb44389f7607de74f3b4e Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 14:35:19 +0200 Subject: [PATCH 06/24] Only save translated files --- .migration/rst2po.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.migration/rst2po.py b/.migration/rst2po.py index 044bde00ef..05273a0ae2 100644 --- a/.migration/rst2po.py +++ b/.migration/rst2po.py @@ -106,6 +106,7 @@ def update_po_translation(pofilename, english, spanish): for pofilename in glob.glob(PO_DIR + '**/*/*.po'): + translated = False rstfilename = get_rst_file(pofilename) if rstfilename is None: continue @@ -124,6 +125,10 @@ def update_po_translation(pofilename, english, spanish): if translated_text is None: continue + translated = True + entry.msgstr = translated_text # update_po_translation(po, english_text, translated_text) - po.save(pofilename) + + if translated: + po.save(pofilename) From cfb3344f870a5817cd99848f95b02c1769891a53 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 15:04:13 +0200 Subject: [PATCH 07/24] Use tutorialpyar with fixes --- .migration/tutorialpyar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.migration/tutorialpyar b/.migration/tutorialpyar index 0497769a04..b4bff8494f 160000 --- a/.migration/tutorialpyar +++ b/.migration/tutorialpyar @@ -1 +1 @@ -Subproject commit 0497769a0417d496393bd7a7a8f956e7551d965d +Subproject commit b4bff8494fee21ca49a5ca4f8391f51db8771c09 From 4a30a79c9604fa204ed55b2e7152524cbdcabb28 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 15:23:07 +0200 Subject: [PATCH 08/24] First pass reviewed All of these were migrated with the script and verified manually. --- tutorial/appendix.po | 121 ++++++++++++---- tutorial/classes.po | 223 +++++++++++++++++++++++------ tutorial/errors.po | 106 +++++++++----- tutorial/floatingpoint.po | 290 +++++++++++++++++++++++++++++--------- tutorial/interactive.po | 60 ++++++-- tutorial/modules.po | 32 +++-- tutorial/stdlib.po | 64 +++++++-- tutorial/stdlib2.po | 56 ++++++-- tutorial/venv.po | 107 ++++++++++---- tutorial/whatnow.po | 40 ++++-- 10 files changed, 838 insertions(+), 261 deletions(-) diff --git a/tutorial/appendix.po b/tutorial/appendix.po index 1491b6bef8..eae510d92d 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -18,63 +18,90 @@ msgstr "" #: ../Doc/tutorial/appendix.rst:5 msgid "Appendix" -msgstr "" +msgstr "Apéndice" #: ../Doc/tutorial/appendix.rst:11 msgid "Interactive Mode" -msgstr "" +msgstr "Modo interactivo" #: ../Doc/tutorial/appendix.rst:16 msgid "Error Handling" -msgstr "" +msgstr "Manejo de errores" #: ../Doc/tutorial/appendix.rst:18 msgid "" "When an error occurs, the interpreter prints an error message and a stack " "trace. In interactive mode, it then returns to the primary prompt; when " "input came from a file, it exits with a nonzero exit status after printing " -"the stack trace. (Exceptions handled by an :keyword:`except` clause in a :" -"keyword:`try` statement are not errors in this context.) Some errors are " -"unconditionally fatal and cause an exit with a nonzero exit; this applies to " -"internal inconsistencies and some cases of running out of memory. All error " -"messages are written to the standard error stream; normal output from " +"the stack trace. (Exceptions handled by an :keyword:`except` clause in a " +":keyword:`try` statement are not errors in this context.) Some errors are " +"unconditionally fatal and cause an exit with a nonzero exit; this applies to" +" internal inconsistencies and some cases of running out of memory. All " +"error messages are written to the standard error stream; normal output from " "executed commands is written to standard output." msgstr "" +"Cuando ocurre un error, el intérprete imprime un mensaje de error y la traza" +" del error. En el modo interactivo, luego retorna al prompt primario; " +"cuando la entrada viene de un archivo, el programa termina con código de " +"salida distinto a cero luego de imprimir la traza del error. (Las " +"excepciones manejadas por una clausula :keyword:`except` en una sentencia " +":keyword:`try` no son errores en este contexto). Algunos errores son " +"incondicionalmente fatales y causan una terminación con código de salida " +"distinto de cero; esto se debe a inconsistencias internas o a que el " +"intérprete se queda sin memoria. Todos los mensajes de error se escriben en " +"el flujo de errores estándar; las salidas normales de comandos ejecutados se" +" escriben en la salida estándar." #: ../Doc/tutorial/appendix.rst:28 msgid "" "Typing the interrupt character (usually :kbd:`Control-C` or :kbd:`Delete`) " "to the primary or secondary prompt cancels the input and returns to the " -"primary prompt. [#]_ Typing an interrupt while a command is executing raises " -"the :exc:`KeyboardInterrupt` exception, which may be handled by a :keyword:" -"`try` statement." +"primary prompt. [#]_ Typing an interrupt while a command is executing raises" +" the :exc:`KeyboardInterrupt` exception, which may be handled by a " +":keyword:`try` statement." msgstr "" +"Al ingresar el caracter de interrupción (por lo general :kbd:`Control-C` o " +":kbd:`Supr`) en el prompt primario o secundario, se cancela la entrada y " +"retorna al prompt primario. [#]_ Tipear una interrupción mientras un " +"comando se están ejecutando lanza la excepción :exc:`KeyboardInterrupt`, que" +" puede ser manejada con una sentencia :keyword:`try`." #: ../Doc/tutorial/appendix.rst:38 msgid "Executable Python Scripts" -msgstr "" +msgstr "Programas ejecutables de Python" #: ../Doc/tutorial/appendix.rst:40 msgid "" "On BSD'ish Unix systems, Python scripts can be made directly executable, " "like shell scripts, by putting the line ::" msgstr "" +"En los sistemas Unix y tipo BSD, los programas Python pueden convertirse " +"directamente en ejecutables, como programas del intérprete de comandos, " +"poniendo la linea::" #: ../Doc/tutorial/appendix.rst:45 msgid "" "(assuming that the interpreter is on the user's :envvar:`PATH`) at the " "beginning of the script and giving the file an executable mode. The ``#!`` " -"must be the first two characters of the file. On some platforms, this first " -"line must end with a Unix-style line ending (``'\\n'``), not a Windows " +"must be the first two characters of the file. On some platforms, this first" +" line must end with a Unix-style line ending (``'\\n'``), not a Windows " "(``'\\r\\n'``) line ending. Note that the hash, or pound, character, " "``'#'``, is used to start a comment in Python." msgstr "" +"...al principio del script y dándole al archivo permisos de ejecución " +"(asumiendo que el intérprete están en la variable de entorno :envvar:`PATH` " +"del usuario). ``#!`` deben ser los primeros dos caracteres del archivo. En" +" algunas plataformas, la primera línea debe terminar al estilo Unix " +"(``'\\n'``), no como en Windows (``'\\r\\n'``). Notá que el caracter " +"numeral ``'#'`` se usa en Python para comenzar un comentario." #: ../Doc/tutorial/appendix.rst:52 msgid "" -"The script can be given an executable mode, or permission, using the :" -"program:`chmod` command." +"The script can be given an executable mode, or permission, using the " +":program:`chmod` command." msgstr "" +"Se le puede dar permisos de ejecución al script usando el comando " +":program:`chmod`::" #: ../Doc/tutorial/appendix.rst:59 msgid "" @@ -84,10 +111,15 @@ msgid "" "extension can also be ``.pyw``, in that case, the console window that " "normally appears is suppressed." msgstr "" +"En sistemas Windows, no existe la noción de \"modo ejecutable\". El " +"instalador de Python asocia automáticamente la extensión ``.py`` con " +"``python.exe`` para que al hacerle doble click a un archivo Python se corra " +"el script. La extensión también puede ser ``.pyw``, en este caso se omite " +"la ventana con la consola que normalmente aparece." #: ../Doc/tutorial/appendix.rst:69 msgid "The Interactive Startup File" -msgstr "" +msgstr "El archivo de inicio interactivo" #: ../Doc/tutorial/appendix.rst:71 msgid "" @@ -97,6 +129,11 @@ msgid "" "the name of a file containing your start-up commands. This is similar to " "the :file:`.profile` feature of the Unix shells." msgstr "" +"Cuando usás Python en forma interactiva, suele ser útil que algunos comandos" +" estándar se ejecuten cada vez que el intérprete se inicia. Podés hacer " +"esto configurando la variable de entorno :envvar:`PYTHONSTARTUP` con el " +"nombre de un archivo que contenga tus comandos de inicio. Esto es similar " +"al archivo :file:`.profile` en los intérpretes de comandos de Unix." #: ../Doc/tutorial/appendix.rst:77 msgid "" @@ -104,47 +141,71 @@ msgid "" "commands from a script, and not when :file:`/dev/tty` is given as the " "explicit source of commands (which otherwise behaves like an interactive " "session). It is executed in the same namespace where interactive commands " -"are executed, so that objects that it defines or imports can be used without " -"qualification in the interactive session. You can also change the prompts " +"are executed, so that objects that it defines or imports can be used without" +" qualification in the interactive session. You can also change the prompts " "``sys.ps1`` and ``sys.ps2`` in this file." msgstr "" +"Este archivo es solo leído en las sesiones interactivas del intérprete, no " +"cuando Python lee comandos de un script ni cuando :file:`/dev/tty` se " +"explicita como una fuente de comandos (que de otro modo se comporta como una" +" sesión interactiva). Se ejecuta en el mismo espacio de nombres en el que " +"los comandos interactivos se ejecutan, entonces los objetos que define o " +"importa pueden ser usados sin cualificaciones en la sesión interactiva. En " +"este archivo también podés cambiar los prompts ``sys.ps1`` y ``sys.ps2``." #: ../Doc/tutorial/appendix.rst:85 msgid "" "If you want to read an additional start-up file from the current directory, " -"you can program this in the global start-up file using code like ``if os." -"path.isfile('.pythonrc.py'): exec(open('.pythonrc.py').read())``. If you " -"want to use the startup file in a script, you must do this explicitly in the " -"script::" +"you can program this in the global start-up file using code like ``if " +"os.path.isfile('.pythonrc.py'): exec(open('.pythonrc.py').read())``. If you " +"want to use the startup file in a script, you must do this explicitly in the" +" script::" msgstr "" +"Si querés leer un archivo de inicio adicional desde el directorio actual, " +"podés programarlo en el archivo de inicio global usando algo como ``if " +"os.path.isfile('.pythonrc.py'): exec(open('.pythonrc.py').read())``. Si " +"querés usar el archivo de inicio en un script, tenés que hacer lo siguiente " +"de forma explícita en el script::" #: ../Doc/tutorial/appendix.rst:102 msgid "The Customization Modules" -msgstr "" +msgstr "Los módulos de customización" #: ../Doc/tutorial/appendix.rst:104 msgid "" -"Python provides two hooks to let you customize it: :mod:`sitecustomize` and :" -"mod:`usercustomize`. To see how it works, you need first to find the " +"Python provides two hooks to let you customize it: :mod:`sitecustomize` and " +":mod:`usercustomize`. To see how it works, you need first to find the " "location of your user site-packages directory. Start Python and run this " "code::" msgstr "" +"Python provee dos formas para customizarlo: :mod:`sitecustomize` y " +":mod:`usercustomize`. Para ver como funciona, necesitás primero encontrar " +"dónde está tu directorio para tu usuario de paquetes del sistema. Arrancá " +"Python y ejecutá el siguiente código::" #: ../Doc/tutorial/appendix.rst:112 msgid "" "Now you can create a file named :file:`usercustomize.py` in that directory " -"and put anything you want in it. It will affect every invocation of Python, " -"unless it is started with the :option:`-s` option to disable the automatic " +"and put anything you want in it. It will affect every invocation of Python," +" unless it is started with the :option:`-s` option to disable the automatic " "import." msgstr "" +"Ahora podés crear un archivo llamado :file:`usercustomize.py` en ese " +"directorio y poner lo que quieras en él. Eso afectará cada ejecución de " +"Python, a menos que se arranque con la opción :option:`-s` para deshabilitar" +" esta importación automática." #: ../Doc/tutorial/appendix.rst:116 msgid "" ":mod:`sitecustomize` works in the same way, but is typically created by an " "administrator of the computer in the global site-packages directory, and is " -"imported before :mod:`usercustomize`. See the documentation of the :mod:" -"`site` module for more details." +"imported before :mod:`usercustomize`. See the documentation of the " +":mod:`site` module for more details." msgstr "" +":mod:`sitecustomize` funciona de la misma manera, pero normalmente lo crea " +"el administrador de la computadora en el directorio global de paquetes para " +"el sistema, y se importa antes que :mod:`usercustomize`. Para más detalles, " +"mirá la documentación del módulo :mod:`site`." #: ../Doc/tutorial/appendix.rst:123 msgid "Footnotes" diff --git a/tutorial/classes.po b/tutorial/classes.po index 4dfefff61f..d7c5c3b275 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -18,7 +18,7 @@ msgstr "" #: ../Doc/tutorial/classes.rst:5 msgid "Classes" -msgstr "" +msgstr "Clases" #: ../Doc/tutorial/classes.rst:7 msgid "" @@ -28,6 +28,11 @@ msgid "" "attributes attached to it for maintaining its state. Class instances can " "also have methods (defined by its class) for modifying its state." msgstr "" +"Las clases proveen una forma de empaquetar datos y funcionalidad juntos. Al " +"crear una nueva clase, se crea un nuevo *tipo* de objeto, permitiendo crear " +"nuevas *instancias* de ese tipo. Cada instancia de clase puede tener " +"atributos adjuntos para mantener su estado. Las instancias de clase también " +"pueden tener métodos (definidos por su clase) para modificar su estado." #: ../Doc/tutorial/classes.rst:13 msgid "" @@ -42,12 +47,23 @@ msgid "" "nature of Python: they are created at runtime, and can be modified further " "after creation." msgstr "" +"Comparado con otros lenguajes de programación, el mecanismo de clases de " +"Python agrega clases con un mínimo de nuevas sintaxis y semánticas. Es una " +"mezcla de los mecanismos de clases encontrados en C++ y Modula-3. Las " +"clases de Python proveen todas las características normales de la " +"Programación Orientada a Objetos: el mecanismo de la herencia de clases " +"permite múltiples clases base, una clase derivada puede sobre escribir " +"cualquier método de su(s) clase(s) base, y un método puede llamar al método " +"de la clase base con el mismo nombre. Los objetos pueden tener una cantidad" +" arbitraria de datos de cualquier tipo. Igual que con los módulos, las " +"clases participan de la naturaleza dinámica de Python: se crean en tiempo de" +" ejecución, y pueden modificarse luego de la creación." #: ../Doc/tutorial/classes.rst:23 msgid "" "In C++ terminology, normally class members (including the data members) are " -"*public* (except see below :ref:`tut-private`), and all member functions are " -"*virtual*. As in Modula-3, there are no shorthands for referencing the " +"*public* (except see below :ref:`tut-private`), and all member functions are" +" *virtual*. As in Modula-3, there are no shorthands for referencing the " "object's members from its methods: the method function is declared with an " "explicit first argument representing the object, which is provided " "implicitly by the call. As in Smalltalk, classes themselves are objects. " @@ -57,18 +73,34 @@ msgid "" "(arithmetic operators, subscripting etc.) can be redefined for class " "instances." msgstr "" +"En terminología de C++, normalmente los miembros de las clases (incluyendo " +"los miembros de datos), son *públicos* (excepto ver abajo :ref:`tut-" +"private`), y todas las funciones miembro son *virtuales*. Como en Modula-3," +" no hay atajos para hacer referencia a los miembros del objeto desde sus " +"métodos: la función método se declara con un primer argumento explícito que " +"representa al objeto, el cual se provee implícitamente por la llamada. Como" +" en Smalltalk, las clases mismas son objetos. Esto provee una semántica " +"para importar y renombrar. A diferencia de C++ y Modula-3, los tipos de " +"datos integrados pueden usarse como clases base para que el usuario los " +"extienda. También, como en C++ pero a diferencia de Modula-3, la mayoría de" +" los operadores integrados con sintaxis especial (operadores aritméticos, de" +" subíndice, etc.) pueden ser redefinidos por instancias de la clase." #: ../Doc/tutorial/classes.rst:34 msgid "" -"(Lacking universally accepted terminology to talk about classes, I will make " -"occasional use of Smalltalk and C++ terms. I would use Modula-3 terms, " +"(Lacking universally accepted terminology to talk about classes, I will make" +" occasional use of Smalltalk and C++ terms. I would use Modula-3 terms, " "since its object-oriented semantics are closer to those of Python than C++, " "but I expect that few readers have heard of it.)" msgstr "" +"(Sin haber una terminología universalmente aceptada sobre clases, haré uso " +"ocasional de términos de Smalltalk y C++. Usaría términos de Modula-3, ya " +"que su semántica orientada a objetos es más cercana a Python que C++, pero " +"no espero que muchos lectores hayan escuchado hablar de él)." #: ../Doc/tutorial/classes.rst:43 msgid "A Word About Names and Objects" -msgstr "" +msgstr "Unas palabras sobre nombres y objetos" #: ../Doc/tutorial/classes.rst:45 msgid "" @@ -85,10 +117,23 @@ msgid "" "the caller will see the change --- this eliminates the need for two " "different argument passing mechanisms as in Pascal." msgstr "" +"Los objetos tienen individualidad, y múltiples nombres (en muchos ámbitos) " +"pueden vincularse al mismo objeto. Esto se conoce como *aliasing* en otros " +"lenguajes. Normalmente no se aprecia esto a primera vista en Python, y " +"puede ignorarse sin problemas cuando se maneja tipos básicos inmutables " +"(números, cadenas, tuplas). Sin embargo, el *aliasing*, o renombrado, " +"tiene un efecto posiblemente sorpresivo sobre la semántica de código Python " +"que involucra objetos mutables como listas, diccionarios, y la mayoría de " +"otros tipos. Esto se usa normalmente para beneficio del programa, ya que " +"los renombres funcionan como punteros en algunos aspectos. Por ejemplo, " +"pasar un objeto es barato ya que la implementación solamente pasa el " +"puntero; y si una función modifica el objeto que fue pasado, el que la llama" +" verá el cambio; esto elimina la necesidad de tener dos formas diferentes de" +" pasar argumentos, como en Pascal." #: ../Doc/tutorial/classes.rst:61 msgid "Python Scopes and Namespaces" -msgstr "" +msgstr "Ámbitos y espacios de nombres en Python" #: ../Doc/tutorial/classes.rst:63 msgid "" @@ -98,10 +143,16 @@ msgid "" "understand what's going on. Incidentally, knowledge about this subject is " "useful for any advanced Python programmer." msgstr "" +"Antes de ver clases, primero debo decirte algo acerca de las reglas de " +"ámbito de Python. Las definiciones de clases hacen unos lindos trucos con " +"los espacios de nombres, y necesitás saber cómo funcionan los alcances y " +"espacios de nombres para entender por completo cómo es la cosa. De paso, " +"los conocimientos en este tema son útiles para cualquier programador Python " +"avanzado." #: ../Doc/tutorial/classes.rst:69 msgid "Let's begin with some definitions." -msgstr "" +msgstr "Comencemos con unas definiciones." #: ../Doc/tutorial/classes.rst:71 msgid "" @@ -110,24 +161,45 @@ msgid "" "noticeable in any way (except for performance), and it may change in the " "future. Examples of namespaces are: the set of built-in names (containing " "functions such as :func:`abs`, and built-in exception names); the global " -"names in a module; and the local names in a function invocation. In a sense " -"the set of attributes of an object also form a namespace. The important " +"names in a module; and the local names in a function invocation. In a sense" +" the set of attributes of an object also form a namespace. The important " "thing to know about namespaces is that there is absolutely no relation " "between names in different namespaces; for instance, two different modules " "may both define a function ``maximize`` without confusion --- users of the " "modules must prefix it with the module name." msgstr "" +"Un *espacio de nombres* es una relación de nombres a objetos. Muchos " +"espacios de nombres están implementados en este momento como diccionarios de" +" Python, pero eso no se nota para nada (excepto por el desempeño), y puede " +"cambiar en el futuro. Como ejemplos de espacios de nombres tenés: el " +"conjunto de nombres incluidos (conteniendo funciones como :func:`abs`, y los" +" nombres de excepciones integradas); los nombres globales en un módulo; y " +"los nombres locales en la invocación a una función. Lo que es importante " +"saber de los espacios de nombres es que no hay relación en absoluto entre " +"los nombres de espacios de nombres distintos; por ejemplo, dos módulos " +"diferentes pueden tener definidos los dos una función ``maximizar`` sin " +"confusión; los usuarios de los módulos deben usar el nombre del módulo como " +"prefijo." #: ../Doc/tutorial/classes.rst:82 msgid "" "By the way, I use the word *attribute* for any name following a dot --- for " "example, in the expression ``z.real``, ``real`` is an attribute of the " "object ``z``. Strictly speaking, references to names in modules are " -"attribute references: in the expression ``modname.funcname``, ``modname`` is " -"a module object and ``funcname`` is an attribute of it. In this case there " -"happens to be a straightforward mapping between the module's attributes and " -"the global names defined in the module: they share the same namespace! [#]_" -msgstr "" +"attribute references: in the expression ``modname.funcname``, ``modname`` is" +" a module object and ``funcname`` is an attribute of it. In this case there" +" happens to be a straightforward mapping between the module's attributes and" +" the global names defined in the module: they share the same namespace! " +"[#]_" +msgstr "" +"Por cierto, yo uso la palabra *atributo* para cualquier cosa después de un " +"punto; por ejemplo, en la expresión ``z.real``, ``real`` es un atributo del " +"objeto ``z``. Estrictamente hablando, las referencias a nombres en módulos " +"son referencias a atributos: en la expresión ``modulo.funcion``, ``modulo`` " +"es un objeto módulo y ``funcion`` es un atributo de éste. En este caso hay " +"una relación directa entre los atributos del módulo y los nombres globales " +"definidos en el módulo: ¡están compartiendo el mismo espacio de nombres! " +"[#]_" #: ../Doc/tutorial/classes.rst:90 msgid "" @@ -135,8 +207,15 @@ msgid "" "attributes is possible. Module attributes are writable: you can write " "``modname.the_answer = 42``. Writable attributes may also be deleted with " "the :keyword:`del` statement. For example, ``del modname.the_answer`` will " -"remove the attribute :attr:`the_answer` from the object named by ``modname``." +"remove the attribute :attr:`the_answer` from the object named by " +"``modname``." msgstr "" +"Los atributos pueden ser de sólo lectura, o de escritura. En el último caso" +" es posible la asignación a atributos. Los atributos de módulo pueden " +"escribirse: ``modulo.la_respuesta = 42``. Los atributos de escritura se " +"pueden borrar también con la declaración :keyword:`del`. Por ejemplo, ``del" +" modulo.la_respuesta`` va a eliminar el atributo :attr:`la_respuesta` del " +"objeto con nombre ``modulo``." #: ../Doc/tutorial/classes.rst:96 msgid "" @@ -146,33 +225,55 @@ msgid "" "module is created when the module definition is read in; normally, module " "namespaces also last until the interpreter quits. The statements executed " "by the top-level invocation of the interpreter, either read from a script " -"file or interactively, are considered part of a module called :mod:" -"`__main__`, so they have their own global namespace. (The built-in names " -"actually also live in a module; this is called :mod:`builtins`.)" -msgstr "" +"file or interactively, are considered part of a module called " +":mod:`__main__`, so they have their own global namespace. (The built-in " +"names actually also live in a module; this is called :mod:`builtins`.)" +msgstr "" +"Los espacios de nombres se crean en diferentes momentos y con diferentes " +"tiempos de vida. El espacio de nombres que contiene los nombres incluidos " +"se crea cuando se inicia el intérprete, y nunca se borra. El espacio de " +"nombres global de un módulo se crea cuando se lee la definición de un " +"módulo; normalmente, los espacios de nombres de módulos también duran hasta " +"que el intérprete finaliza. Las instrucciones ejecutadas en el nivel de " +"llamadas superior del intérprete, ya sea desde un script o interactivamente," +" se consideran parte del módulo llamado :mod:`__main__`, por lo tanto tienen" +" su propio espacio de nombres global. (Los nombres incluidos en realidad " +"también viven en un módulo; este se llama :mod:`builtins`.)" #: ../Doc/tutorial/classes.rst:106 msgid "" "The local namespace for a function is created when the function is called, " "and deleted when the function returns or raises an exception that is not " -"handled within the function. (Actually, forgetting would be a better way to " -"describe what actually happens.) Of course, recursive invocations each have " -"their own local namespace." +"handled within the function. (Actually, forgetting would be a better way to" +" describe what actually happens.) Of course, recursive invocations each " +"have their own local namespace." msgstr "" +"El espacio de nombres local a una función se crea cuando la función es " +"llamada, y se elimina cuando la función retorna o lanza una excepción que no" +" se maneje dentro de la función. (Podríamos decir que lo que pasa en " +"realidad es que ese espacio de nombres se \"olvida\".) Por supuesto, las " +"llamadas recursivas tienen cada una su propio espacio de nombres local." #: ../Doc/tutorial/classes.rst:112 msgid "" "A *scope* is a textual region of a Python program where a namespace is " -"directly accessible. \"Directly accessible\" here means that an unqualified " -"reference to a name attempts to find the name in the namespace." +"directly accessible. \"Directly accessible\" here means that an unqualified" +" reference to a name attempts to find the name in the namespace." msgstr "" +"Un *ámbito* es una región textual de un programa en Python donde un espacio " +"de nombres es accesible directamente. \"Accesible directamente\" significa " +"que una referencia sin calificar a un nombre intenta encontrar dicho nombre " +"dentro del espacio de nombres." #: ../Doc/tutorial/classes.rst:116 msgid "" -"Although scopes are determined statically, they are used dynamically. At any " -"time during execution, there are at least three nested scopes whose " +"Although scopes are determined statically, they are used dynamically. At any" +" time during execution, there are at least three nested scopes whose " "namespaces are directly accessible:" msgstr "" +"Aunque los alcances se determinan estáticamente, se usan dinámicamente. En " +"cualquier momento durante la ejecución hay por lo menos cuatro alcances " +"anidados cuyos espacios de nombres son directamente accesibles:" #: ../Doc/tutorial/classes.rst:120 msgid "the innermost scope, which is searched first, contains the local names" @@ -198,12 +299,19 @@ msgstr "" msgid "" "If a name is declared global, then all references and assignments go " "directly to the middle scope containing the module's global names. To " -"rebind variables found outside of the innermost scope, the :keyword:" -"`nonlocal` statement can be used; if not declared nonlocal, those variables " -"are read-only (an attempt to write to such a variable will simply create a " -"*new* local variable in the innermost scope, leaving the identically named " -"outer variable unchanged)." -msgstr "" +"rebind variables found outside of the innermost scope, the " +":keyword:`nonlocal` statement can be used; if not declared nonlocal, those " +"variables are read-only (an attempt to write to such a variable will simply " +"create a *new* local variable in the innermost scope, leaving the " +"identically named outer variable unchanged)." +msgstr "" +"Si un nombre se declara como global, entonces todas las referencias y " +"asignaciones al mismo van directo al ámbito intermedio que contiene los " +"nombres globales del módulo. Para reasignar nombres encontrados afuera del " +"ámbito más interno, se puede usar la declaración :keyword:`nonlocal`; si no " +"se declara nonlocal, esas variables serán de sólo lectura (un intento de " +"escribir a esas variables simplemente crea una *nueva* variable local en el " +"ámbito interno, dejando intacta la variable externa del mismo nombre)." #: ../Doc/tutorial/classes.rst:133 msgid "" @@ -212,6 +320,10 @@ msgid "" "namespace as the global scope: the module's namespace. Class definitions " "place yet another namespace in the local scope." msgstr "" +"Habitualmente, el ámbito local referencia los nombres locales de la función " +"actual. Fuera de una función, el ámbito local referencia al mismo espacio " +"de nombres que el ámbito global: el espacio de nombres del módulo. Las " +"definiciones de clases crean un espacio de nombres más en el ámbito local." #: ../Doc/tutorial/classes.rst:138 msgid "" @@ -219,34 +331,55 @@ msgid "" "scope of a function defined in a module is that module's namespace, no " "matter from where or by what alias the function is called. On the other " "hand, the actual search for names is done dynamically, at run time --- " -"however, the language definition is evolving towards static name resolution, " -"at \"compile\" time, so don't rely on dynamic name resolution! (In fact, " +"however, the language definition is evolving towards static name resolution," +" at \"compile\" time, so don't rely on dynamic name resolution! (In fact, " "local variables are already determined statically.)" msgstr "" +"Es importante notar que los alcances se determinan textualmente: el ámbito " +"global de una función definida en un módulo es el espacio de nombres de ese " +"módulo, no importa desde dónde o con qué alias se llame a la función. Por " +"otro lado, la búsqueda de nombres se hace dinámicamente, en tiempo de " +"ejecución; sin embargo, la definición del lenguaje está evolucionando a " +"hacer resolución de nombres estáticamente, en tiempo de \"compilación\", " +"¡así que no te confíes de la resolución de nombres dinámica! (De hecho, las " +"variables locales ya se determinan estáticamente.)" #: ../Doc/tutorial/classes.rst:146 msgid "" -"A special quirk of Python is that -- if no :keyword:`global` statement is in " -"effect -- assignments to names always go into the innermost scope. " +"A special quirk of Python is that -- if no :keyword:`global` statement is in" +" effect -- assignments to names always go into the innermost scope. " "Assignments do not copy data --- they just bind names to objects. The same " "is true for deletions: the statement ``del x`` removes the binding of ``x`` " "from the namespace referenced by the local scope. In fact, all operations " -"that introduce new names use the local scope: in particular, :keyword:" -"`import` statements and function definitions bind the module or function " -"name in the local scope." -msgstr "" +"that introduce new names use the local scope: in particular, " +":keyword:`import` statements and function definitions bind the module or " +"function name in the local scope." +msgstr "" +"Una peculiaridad especial de Python es que, si no hay una declaración " +":keyword:`global` o :keyword:`nonlocal` en efecto, las asignaciones a " +"nombres siempre van al ámbito interno. Las asignaciones no copian datos, " +"solamente asocian nombres a objetos. Lo mismo cuando se borra: la " +"declaración ``del x`` quita la asociación de ``x`` del espacio de nombres " +"referenciado por el ámbito local. De hecho, todas las operaciones que " +"introducen nuevos nombres usan el ámbito local: en particular, las " +"instrucciones :keyword:`import` y las definiciones de funciones asocian el " +"módulo o nombre de la función al espacio de nombres en el ámbito local." #: ../Doc/tutorial/classes.rst:154 msgid "" "The :keyword:`global` statement can be used to indicate that particular " -"variables live in the global scope and should be rebound there; the :keyword:" -"`nonlocal` statement indicates that particular variables live in an " -"enclosing scope and should be rebound there." +"variables live in the global scope and should be rebound there; the " +":keyword:`nonlocal` statement indicates that particular variables live in an" +" enclosing scope and should be rebound there." msgstr "" +"La declaración :keyword:`global` puede usarse para indicar que ciertas " +"variables viven en el ámbito global y deberían reasignarse allí; la " +"declaración :keyword:`nonlocal` indica que ciertas variables viven en un " +"ámbito encerrado y deberían reasignarse allí." #: ../Doc/tutorial/classes.rst:162 msgid "Scopes and Namespaces Example" -msgstr "" +msgstr "Ejémplo de ámbitos y espacios de nombre" #: ../Doc/tutorial/classes.rst:164 msgid "" diff --git a/tutorial/errors.po b/tutorial/errors.po index 172ca928b1..75cbea93d9 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -18,7 +18,7 @@ msgstr "" #: ../Doc/tutorial/errors.rst:5 msgid "Errors and Exceptions" -msgstr "" +msgstr "Errores y excepciones" #: ../Doc/tutorial/errors.rst:7 msgid "" @@ -26,30 +26,43 @@ msgid "" "tried out the examples you have probably seen some. There are (at least) " "two distinguishable kinds of errors: *syntax errors* and *exceptions*." msgstr "" +"Hasta ahora los mensajes de error no habían sido más que mencionados, pero " +"si probaste los ejemplos probablemente hayas visto algunos. Hay (al menos) " +"dos tipos diferentes de errores: *errores de sintaxis* y *excepciones*." #: ../Doc/tutorial/errors.rst:15 msgid "Syntax Errors" -msgstr "" +msgstr "Errores de sintaxis" #: ../Doc/tutorial/errors.rst:17 msgid "" "Syntax errors, also known as parsing errors, are perhaps the most common " "kind of complaint you get while you are still learning Python::" msgstr "" +"Los errores de sintaxis, también conocidos como errores de interpretación, " +"son quizás el tipo de queja más común que tenés cuando todavía estás " +"aprendiendo Python::" #: ../Doc/tutorial/errors.rst:26 msgid "" -"The parser repeats the offending line and displays a little 'arrow' pointing " -"at the earliest point in the line where the error was detected. The error " +"The parser repeats the offending line and displays a little 'arrow' pointing" +" at the earliest point in the line where the error was detected. The error " "is caused by (or at least detected at) the token *preceding* the arrow: in " "the example, the error is detected at the function :func:`print`, since a " -"colon (``':'``) is missing before it. File name and line number are printed " -"so you know where to look in case the input came from a script." +"colon (``':'``) is missing before it. File name and line number are printed" +" so you know where to look in case the input came from a script." msgstr "" +"El intérprete repite la línea culpable y muestra una pequeña 'flecha' que " +"apunta al primer lugar donde se detectó el error. Este es causado por (o al" +" menos detectado en) el símbolo que *precede* a la flecha: en el ejemplo, el" +" error se detecta en la función :func:`print`, ya que faltan dos puntos " +"(``':'``) antes del mismo. Se muestran el nombre del archivo y el número de" +" línea para que sepas dónde mirar en caso de que la entrada venga de un " +"programa." #: ../Doc/tutorial/errors.rst:37 msgid "Exceptions" -msgstr "" +msgstr "Excepciones" #: ../Doc/tutorial/errors.rst:39 msgid "" @@ -60,74 +73,103 @@ msgid "" "not handled by programs, however, and result in error messages as shown " "here::" msgstr "" +"Incluso si la declaración o expresión es sintácticamente correcta, puede " +"generar un error cuando se intenta ejecutarla. Los errores detectados " +"durante la ejecución se llaman *excepciones*, y no son incondicionalmente " +"fatales: pronto aprenderás cómo manejarlos en los programas en Python. Sin " +"embargo, la mayoría de las excepciones no son manejadas por los programas, y" +" resultan en mensajes de error como los mostrados aquí::" #: ../Doc/tutorial/errors.rst:58 msgid "" "The last line of the error message indicates what happened. Exceptions come " "in different types, and the type is printed as part of the message: the " -"types in the example are :exc:`ZeroDivisionError`, :exc:`NameError` and :exc:" -"`TypeError`. The string printed as the exception type is the name of the " -"built-in exception that occurred. This is true for all built-in exceptions, " -"but need not be true for user-defined exceptions (although it is a useful " -"convention). Standard exception names are built-in identifiers (not reserved " -"keywords)." -msgstr "" +"types in the example are :exc:`ZeroDivisionError`, :exc:`NameError` and " +":exc:`TypeError`. The string printed as the exception type is the name of " +"the built-in exception that occurred. This is true for all built-in " +"exceptions, but need not be true for user-defined exceptions (although it is" +" a useful convention). Standard exception names are built-in identifiers " +"(not reserved keywords)." +msgstr "" +"La última línea de los mensajes de error indica qué sucedió. Las " +"excepciones vienen de distintos tipos, y el tipo se imprime como parte del " +"mensaje: los tipos en el ejemplo son: :exc:`ZeroDivisionError`, " +":exc:`NameError` y :exc:`TypeError`. La cadena mostrada como tipo de la " +"excepción es el nombre de la excepción predefinida que ocurrió. Esto es " +"verdad para todas las excepciones predefinidas del intérprete, pero no " +"necesita ser verdad para excepciones definidas por el usuario (aunque es una" +" convención útil). Los nombres de las excepciones estándar son " +"identificadores incorporados al intérprete (no son palabras clave " +"reservadas)." #: ../Doc/tutorial/errors.rst:66 msgid "" -"The rest of the line provides detail based on the type of exception and what " -"caused it." +"The rest of the line provides detail based on the type of exception and what" +" caused it." msgstr "" +"El resto de la línea provee un detalle basado en el tipo de la excepción y " +"qué la causó." #: ../Doc/tutorial/errors.rst:69 msgid "" "The preceding part of the error message shows the context where the " -"exception happened, in the form of a stack traceback. In general it contains " -"a stack traceback listing source lines; however, it will not display lines " +"exception happened, in the form of a stack traceback. In general it contains" +" a stack traceback listing source lines; however, it will not display lines " "read from standard input." msgstr "" +"La parte anterior del mensaje de error muestra el contexto donde la " +"excepción sucedió, en la forma de un *trazado del error* listando líneas " +"fuente; sin embargo, no mostrará líneas leídas desde la entrada estándar." #: ../Doc/tutorial/errors.rst:74 msgid "" ":ref:`bltin-exceptions` lists the built-in exceptions and their meanings." msgstr "" +":ref:`bltin-exceptions` lista las excepciones predefinidas y sus " +"significados." #: ../Doc/tutorial/errors.rst:80 msgid "Handling Exceptions" -msgstr "" +msgstr "Manejando excepciones" #: ../Doc/tutorial/errors.rst:82 msgid "" "It is possible to write programs that handle selected exceptions. Look at " "the following example, which asks the user for input until a valid integer " -"has been entered, but allows the user to interrupt the program (using :kbd:" -"`Control-C` or whatever the operating system supports); note that a user-" -"generated interruption is signalled by raising the :exc:`KeyboardInterrupt` " -"exception. ::" -msgstr "" +"has been entered, but allows the user to interrupt the program (using " +":kbd:`Control-C` or whatever the operating system supports); note that a " +"user-generated interruption is signalled by raising the " +":exc:`KeyboardInterrupt` exception. ::" +msgstr "" +"Es posible escribir programas que manejen determinadas excepciones. Mirá el" +" siguiente ejemplo, que le pide al usuario una entrada hasta que ingrese un " +"entero válido, pero permite al usuario interrumpir el programa (usando " +":kbd:`Control-C` o lo que sea que el sistema operativo soporte); notá que " +"una interrupción generada por el usuario se señaliza generando la excepción " +":exc:`KeyboardInterrupt`. ::" #: ../Doc/tutorial/errors.rst:96 msgid "The :keyword:`try` statement works as follows." -msgstr "" +msgstr "La declaración :keyword:`try` funciona de la siguiente manera:" #: ../Doc/tutorial/errors.rst:98 msgid "" -"First, the *try clause* (the statement(s) between the :keyword:`try` and :" -"keyword:`except` keywords) is executed." +"First, the *try clause* (the statement(s) between the :keyword:`try` and " +":keyword:`except` keywords) is executed." msgstr "" #: ../Doc/tutorial/errors.rst:101 msgid "" -"If no exception occurs, the *except clause* is skipped and execution of the :" -"keyword:`try` statement is finished." +"If no exception occurs, the *except clause* is skipped and execution of the " +":keyword:`try` statement is finished." msgstr "" #: ../Doc/tutorial/errors.rst:104 msgid "" "If an exception occurs during execution of the try clause, the rest of the " -"clause is skipped. Then if its type matches the exception named after the :" -"keyword:`except` keyword, the except clause is executed, and then execution " -"continues after the :keyword:`try` statement." +"clause is skipped. Then if its type matches the exception named after the " +":keyword:`except` keyword, the except clause is executed, and then execution" +" continues after the :keyword:`try` statement." msgstr "" #: ../Doc/tutorial/errors.rst:109 diff --git a/tutorial/floatingpoint.po b/tutorial/floatingpoint.po index f1d9b31636..760967a345 100644 --- a/tutorial/floatingpoint.po +++ b/tutorial/floatingpoint.po @@ -18,18 +18,23 @@ msgstr "" #: ../Doc/tutorial/floatingpoint.rst:9 msgid "Floating Point Arithmetic: Issues and Limitations" -msgstr "" +msgstr "Aritmética de Punto Flotante: Problemas y Limitaciones" #: ../Doc/tutorial/floatingpoint.rst:14 msgid "" "Floating-point numbers are represented in computer hardware as base 2 " "(binary) fractions. For example, the decimal fraction ::" msgstr "" +"Los números de punto flotante se representan en el hardware de la " +"computadora en fracciones en base 2 (binario). Por ejemplo, la fracción " +"decimal ::" #: ../Doc/tutorial/floatingpoint.rst:19 msgid "" "has value 1/10 + 2/100 + 5/1000, and in the same way the binary fraction ::" msgstr "" +"...tiene el valor 1/10 + 2/100 + 5/1000, y de la misma manera la fracción " +"binaria ::" #: ../Doc/tutorial/floatingpoint.rst:23 msgid "" @@ -37,6 +42,9 @@ msgid "" "only real difference being that the first is written in base 10 fractional " "notation, and the second in base 2." msgstr "" +"...tiene el valor 0/2 + 0/4 + 1/8. Estas dos fracciones tienen valores " +"idénticos, la única diferencia real es que la primera está escrita en " +"notación fraccional en base 10 y la segunda en base 2." #: ../Doc/tutorial/floatingpoint.rst:27 msgid "" @@ -45,16 +53,23 @@ msgid "" "point numbers you enter are only approximated by the binary floating-point " "numbers actually stored in the machine." msgstr "" +"Desafortunadamente, la mayoría de las fracciones decimales no pueden " +"representarse exactamente como fracciones binarias. Como consecuencia, en " +"general los números de punto flotante decimal que ingresás en la computadora" +" son sólo aproximados por los números de punto flotante binario que " +"realmente se guardan en la máquina." #: ../Doc/tutorial/floatingpoint.rst:32 msgid "" "The problem is easier to understand at first in base 10. Consider the " "fraction 1/3. You can approximate that as a base 10 fraction::" msgstr "" +"El problema es más fácil de entender primero en base 10. Considerá la " +"fracción 1/3. Podés aproximarla como una fracción de base 10 ::" #: ../Doc/tutorial/floatingpoint.rst:37 ../Doc/tutorial/floatingpoint.rst:41 msgid "or, better, ::" -msgstr "" +msgstr "...o, mejor, ::" #: ../Doc/tutorial/floatingpoint.rst:45 msgid "" @@ -62,23 +77,35 @@ msgid "" "result will never be exactly 1/3, but will be an increasingly better " "approximation of 1/3." msgstr "" +"...y así. No importa cuantos dígitos desees escribir, el resultado nunca " +"será exactamente 1/3, pero será una aproximación cada vez mejor de 1/3." #: ../Doc/tutorial/floatingpoint.rst:49 msgid "" -"In the same way, no matter how many base 2 digits you're willing to use, the " -"decimal value 0.1 cannot be represented exactly as a base 2 fraction. In " +"In the same way, no matter how many base 2 digits you're willing to use, the" +" decimal value 0.1 cannot be represented exactly as a base 2 fraction. In " "base 2, 1/10 is the infinitely repeating fraction ::" msgstr "" +"De la misma manera, no importa cuantos dígitos en base 2 quieras usar, el " +"valor decimal 0.1 no puede representarse exactamente como una fracción en " +"base 2. En base 2, 1/10 es la siguiente fracción que se repite " +"infinitamente::" #: ../Doc/tutorial/floatingpoint.rst:55 msgid "" "Stop at any finite number of bits, and you get an approximation. On most " "machines today, floats are approximated using a binary fraction with the " -"numerator using the first 53 bits starting with the most significant bit and " -"with the denominator as a power of two. In the case of 1/10, the binary " -"fraction is ``3602879701896397 / 2 ** 55`` which is close to but not exactly " -"equal to the true value of 1/10." -msgstr "" +"numerator using the first 53 bits starting with the most significant bit and" +" with the denominator as a power of two. In the case of 1/10, the binary " +"fraction is ``3602879701896397 / 2 ** 55`` which is close to but not exactly" +" equal to the true value of 1/10." +msgstr "" +"Frená en cualquier número finito de bits, y tendrás una aproximación. En la" +" mayoría de las máquinas hoy en día, los float se aproximan usando una " +"fracción binaria con el numerador usando los primeros 53 bits con el bit más" +" significativos y el denominador como una potencia de dos. En el caso de " +"1/10, la fracción binaria es ``3602879701896397 / 2 ** 55`` que está cerca " +"pero no es exactamente el valor verdadero de 1/10." #: ../Doc/tutorial/floatingpoint.rst:62 msgid "" @@ -88,18 +115,30 @@ msgid "" "if Python were to print the true decimal value of the binary approximation " "stored for 0.1, it would have to display ::" msgstr "" +"La mayoría de los usuarios no son conscientes de esta aproximación por la " +"forma en que se muestran los valores. Python solamente muestra una " +"aproximación decimal al valor verdadero decimal de la aproximación binaria " +"almacenada por la máquina. En la mayoría de las máquinas, si Python fuera a" +" imprimir el verdadero valor decimal de la aproximación binaria almacenada " +"para 0.1, debería mostrar ::" #: ../Doc/tutorial/floatingpoint.rst:71 msgid "" -"That is more digits than most people find useful, so Python keeps the number " -"of digits manageable by displaying a rounded value instead ::" +"That is more digits than most people find useful, so Python keeps the number" +" of digits manageable by displaying a rounded value instead ::" msgstr "" +"Esos son más dígitos que lo que la mayoría de la gente encuentra útil, por " +"lo que Python mantiene manejable la cantidad de dígitos al mostrar en su " +"lugar un valor redondeado ::" #: ../Doc/tutorial/floatingpoint.rst:77 msgid "" "Just remember, even though the printed result looks like the exact value of " "1/10, the actual stored value is the nearest representable binary fraction." msgstr "" +"Sólo recordá que, a pesar de que el valor mostrado resulta ser exactamente " +"1/10, el valor almacenado realmente es la fracción binaria más cercana " +"posible." #: ../Doc/tutorial/floatingpoint.rst:80 msgid "" @@ -111,64 +150,98 @@ msgid "" "values share the same approximation, any one of them could be displayed " "while still preserving the invariant ``eval(repr(x)) == x``." msgstr "" +"Interesantemente, hay varios números decimales que comparten la misma " +"fracción binaria más aproximada. Por ejemplo, los números ``0.1``, " +"``0.10000000000000001`` y " +"``0.1000000000000000055511151231257827021181583404541015625`` son todos " +"aproximados por ``3602879701896397 / 2 ** 55``. Ya que todos estos valores " +"decimales comparten la misma aproximación, se podría mostrar cualquiera de " +"ellos para preservar el invariante ``eval(repr(x)) == x``." #: ../Doc/tutorial/floatingpoint.rst:88 msgid "" "Historically, the Python prompt and built-in :func:`repr` function would " "choose the one with 17 significant digits, ``0.10000000000000001``. " -"Starting with Python 3.1, Python (on most systems) is now able to choose the " -"shortest of these and simply display ``0.1``." +"Starting with Python 3.1, Python (on most systems) is now able to choose the" +" shortest of these and simply display ``0.1``." msgstr "" +"Históricamente, el prompt de Python y la función integrada :func:`repr` " +"eligieron el valor con los 17 dígitos, ``0.10000000000000001``. Desde " +"Python 3.1, en la mayoría de los sistemas Python ahora es capaz de elegir la" +" forma más corta de ellos y mostrar ``0.1``." #: ../Doc/tutorial/floatingpoint.rst:93 msgid "" -"Note that this is in the very nature of binary floating-point: this is not a " -"bug in Python, and it is not a bug in your code either. You'll see the same " -"kind of thing in all languages that support your hardware's floating-point " -"arithmetic (although some languages may not *display* the difference by " -"default, or in all output modes)." +"Note that this is in the very nature of binary floating-point: this is not a" +" bug in Python, and it is not a bug in your code either. You'll see the " +"same kind of thing in all languages that support your hardware's floating-" +"point arithmetic (although some languages may not *display* the difference " +"by default, or in all output modes)." msgstr "" +"Notá que esta es la verdadera naturaleza del punto flotante binario: no es " +"un error de Python, y tampoco es un error en tu código. Verás lo mismo en " +"todos los lenguajes que soportan la aritmética de punto flotante de tu " +"hardware (a pesar de que en algunos lenguajes por omisión no *muestren* la " +"diferencia, o no lo hagan en todos los modos de salida)." #: ../Doc/tutorial/floatingpoint.rst:99 msgid "" -"For more pleasant output, you may wish to use string formatting to produce a " -"limited number of significant digits::" +"For more pleasant output, you may wish to use string formatting to produce a" +" limited number of significant digits::" msgstr "" +"Para una salida más elegante, quizás quieras usar el formateo de cadenas de " +"texto para generar un número limitado de dígitos significativos::" #: ../Doc/tutorial/floatingpoint.rst:111 msgid "" -"It's important to realize that this is, in a real sense, an illusion: you're " -"simply rounding the *display* of the true machine value." +"It's important to realize that this is, in a real sense, an illusion: you're" +" simply rounding the *display* of the true machine value." msgstr "" +"Es importante darse cuenta que esto es, realmente, una ilusión: estás " +"simplemente redondeando al *mostrar* el valor verdadero de la máquina." #: ../Doc/tutorial/floatingpoint.rst:114 msgid "" -"One illusion may beget another. For example, since 0.1 is not exactly 1/10, " -"summing three values of 0.1 may not yield exactly 0.3, either::" +"One illusion may beget another. For example, since 0.1 is not exactly 1/10," +" summing three values of 0.1 may not yield exactly 0.3, either::" msgstr "" +"Una ilusión puede generar otra. Por ejemplo, ya que 0.1 no es exactamente " +"1/10, sumar tres veces 0.1 podría también no generar exactamente 0.3::" #: ../Doc/tutorial/floatingpoint.rst:120 msgid "" -"Also, since the 0.1 cannot get any closer to the exact value of 1/10 and 0.3 " -"cannot get any closer to the exact value of 3/10, then pre-rounding with :" -"func:`round` function cannot help::" +"Also, since the 0.1 cannot get any closer to the exact value of 1/10 and 0.3" +" cannot get any closer to the exact value of 3/10, then pre-rounding with " +":func:`round` function cannot help::" msgstr "" +"También, ya que 0.1 no puede acercarse más al valor exacto de 1/10 y 0.3 no " +"puede acercarse más al valor exacto de 3/10, redondear primero con la " +"función :func:`round` no puede ayudar::" #: ../Doc/tutorial/floatingpoint.rst:127 msgid "" -"Though the numbers cannot be made closer to their intended exact values, " -"the :func:`round` function can be useful for post-rounding so that results " -"with inexact values become comparable to one another::" +"Though the numbers cannot be made closer to their intended exact values, the" +" :func:`round` function can be useful for post-rounding so that results with" +" inexact values become comparable to one another::" msgstr "" +"A pesar que los números no pueden acercarse a los valores exactos que " +"pretendemos, la función :func:`round` puede ser útil para redondear a " +"posteriori, para que los resultados con valores inexactos se puedan comparar" +" entre sí::" #: ../Doc/tutorial/floatingpoint.rst:134 msgid "" "Binary floating-point arithmetic holds many surprises like this. The " "problem with \"0.1\" is explained in precise detail below, in the " -"\"Representation Error\" section. See `The Perils of Floating Point `_ for a more complete account of other common " -"surprises." +"\"Representation Error\" section. See `The Perils of Floating Point " +"`_ for a more complete account of other " +"common surprises." msgstr "" +"La aritmética de punto flotante binaria tiene varias sorpresas como esta. El" +" problema con \"0.1\" es explicado con detalle abajo, en la sección \"Error " +"de Representación\". Mirá los Peligros del Punto Flotante (en inglés, `The " +"Perils of Floating Point `_) para una más " +"completa recopilación de otras sorpresas normales." #: ../Doc/tutorial/floatingpoint.rst:139 msgid "" @@ -180,62 +253,96 @@ msgid "" "decimal arithmetic and that every float operation can suffer a new rounding " "error." msgstr "" +"Como dice cerca del final, \"no hay respuestas fáciles\". A pesar de eso, " +"¡no le tengas mucho miedo al punto flotante! Los errores en las operaciones" +" flotantes de Python se heredan del hardware de punto flotante, y en la " +"mayoría de las máquinas están en el orden de no más de una 1 parte en " +"2\\*\\*53 por operación. Eso es más que adecuado para la mayoría de las " +"tareas, pero necesitás tener en cuenta que no es aritmética decimal, y que " +"cada operación de punto flotante sufre un nuevo error de redondeo." #: ../Doc/tutorial/floatingpoint.rst:146 msgid "" "While pathological cases do exist, for most casual use of floating-point " "arithmetic you'll see the result you expect in the end if you simply round " "the display of your final results to the number of decimal digits you " -"expect. :func:`str` usually suffices, and for finer control see the :meth:" -"`str.format` method's format specifiers in :ref:`formatstrings`." +"expect. :func:`str` usually suffices, and for finer control see the " +":meth:`str.format` method's format specifiers in :ref:`formatstrings`." msgstr "" +"A pesar de que existen casos patológicos, para la mayoría de usos casuales " +"de la aritmética de punto flotante al final verás el resultado que esperás " +"si simplemente redondeás lo que mostrás de tus resultados finales al número " +"de dígitos decimales que esperás. :func:`str` es normalmente suficiente, y " +"para un control más fino mirá los parámetros del método de formateo " +":meth:`str.format` en :ref:`string-formatting`." #: ../Doc/tutorial/floatingpoint.rst:152 msgid "" -"For use cases which require exact decimal representation, try using the :mod:" -"`decimal` module which implements decimal arithmetic suitable for accounting " -"applications and high-precision applications." +"For use cases which require exact decimal representation, try using the " +":mod:`decimal` module which implements decimal arithmetic suitable for " +"accounting applications and high-precision applications." msgstr "" +"Para los casos de uso que necesitan una representación decimal exacta, probá" +" el módulo :mod:`decimal`, que implementa aritmética decimal útil para " +"aplicaciones de contabilidad y de alta precisión." #: ../Doc/tutorial/floatingpoint.rst:156 msgid "" -"Another form of exact arithmetic is supported by the :mod:`fractions` module " -"which implements arithmetic based on rational numbers (so the numbers like " +"Another form of exact arithmetic is supported by the :mod:`fractions` module" +" which implements arithmetic based on rational numbers (so the numbers like " "1/3 can be represented exactly)." msgstr "" +"El módulo :mod:`fractions` soporta otra forma de aritmética exacta, ya que " +"implementa aritmética basada en números racionales (por lo que números como " +"1/3 pueden ser representados exactamente)." #: ../Doc/tutorial/floatingpoint.rst:160 msgid "" "If you are a heavy user of floating point operations you should take a look " -"at the Numerical Python package and many other packages for mathematical and " -"statistical operations supplied by the SciPy project. See ." +"at the Numerical Python package and many other packages for mathematical and" +" statistical operations supplied by the SciPy project. See " +"." msgstr "" +"Si sos un usuario frecuente de las operaciones de punto flotante deberías " +"pegarle una mirada al paquete Numerical Python y otros paquetes para " +"operaciones matemáticas y estadísticas provistos por el proyecto SciPy. Mirá" +" ." #: ../Doc/tutorial/floatingpoint.rst:164 msgid "" "Python provides tools that may help on those rare occasions when you really " -"*do* want to know the exact value of a float. The :meth:`float." -"as_integer_ratio` method expresses the value of a float as a fraction::" +"*do* want to know the exact value of a float. The " +":meth:`float.as_integer_ratio` method expresses the value of a float as a " +"fraction::" msgstr "" +"Python provee herramientas que pueden ayudar en esas raras ocasiones cuando " +"realmente *querés* saber el valor exacto de un float. El método " +":meth:`float.as_integer_ratio` expresa el valor del float como una " +"fracción::" #: ../Doc/tutorial/floatingpoint.rst:173 msgid "" -"Since the ratio is exact, it can be used to losslessly recreate the original " -"value::" +"Since the ratio is exact, it can be used to losslessly recreate the original" +" value::" msgstr "" +"Ya que la fracción es exacta, se puede usar para recrear sin pérdidas el " +"valor original::" #: ../Doc/tutorial/floatingpoint.rst:179 msgid "" "The :meth:`float.hex` method expresses a float in hexadecimal (base 16), " "again giving the exact value stored by your computer::" msgstr "" +"El método :meth:`float.hex` expresa un float en hexadecimal (base 16), " +"nuevamente devolviendo el valor exacto almacenado por tu computadora::" #: ../Doc/tutorial/floatingpoint.rst:185 msgid "" -"This precise hexadecimal representation can be used to reconstruct the float " -"value exactly::" +"This precise hexadecimal representation can be used to reconstruct the float" +" value exactly::" msgstr "" +"Esta representación hexadecimal precisa se puede usar para reconstruir el " +"valor exacto del float::" #: ../Doc/tutorial/floatingpoint.rst:191 msgid "" @@ -244,19 +351,28 @@ msgid "" "data with other languages that support the same format (such as Java and " "C99)." msgstr "" +"Ya que la representación es exacta, es útil para portar valores a través de " +"diferentes versiones de Python de manera confiable (independencia de " +"plataformas) e intercambiar datos con otros lenguajes que soportan el mismo " +"formato (como Java y C99)." #: ../Doc/tutorial/floatingpoint.rst:195 msgid "" "Another helpful tool is the :func:`math.fsum` function which helps mitigate " -"loss-of-precision during summation. It tracks \"lost digits\" as values are " -"added onto a running total. That can make a difference in overall accuracy " -"so that the errors do not accumulate to the point where they affect the " +"loss-of-precision during summation. It tracks \"lost digits\" as values are" +" added onto a running total. That can make a difference in overall accuracy" +" so that the errors do not accumulate to the point where they affect the " "final total:" msgstr "" +"Otra herramienta útil es la función :func:`math.fsum` que ayuda a mitigar la" +" pérdida de precisión durante la suma. Esta función lleva la cuenta de " +"\"dígitos perdidos\" mientras se suman los valores en un total. Eso puede " +"hacer una diferencia en la exactitud de lo que se va sumando para que los " +"errores no se acumulen al punto en que afecten el total final::" #: ../Doc/tutorial/floatingpoint.rst:209 msgid "Representation Error" -msgstr "" +msgstr "Error de Representación" #: ../Doc/tutorial/floatingpoint.rst:211 msgid "" @@ -264,6 +380,10 @@ msgid "" "perform an exact analysis of cases like this yourself. Basic familiarity " "with binary floating-point representation is assumed." msgstr "" +"Esta sección explica el ejemplo \"0.1\" en detalle, y muestra como en la " +"mayoría de los casos vos mismo podés realizar un análisis exacto como este. " +"Se asume un conocimiento básico de la representación de punto flotante " +"binario." #: ../Doc/tutorial/floatingpoint.rst:215 msgid "" @@ -273,49 +393,69 @@ msgid "" "Fortran, and many others) often won't display the exact decimal number you " "expect." msgstr "" +":dfn:`Error de representación` se refiere al hecho de que algunas (la " +"mayoría) de las fracciones decimales no pueden representarse exactamente " +"como fracciones binarias (en base 2). Esta es la razón principal de por qué" +" Python (o Perl, C, C++, Java, Fortran, y tantos otros) frecuentemente no " +"mostrarán el número decimal exacto que esperás." #: ../Doc/tutorial/floatingpoint.rst:220 msgid "" -"Why is that? 1/10 is not exactly representable as a binary fraction. Almost " -"all machines today (November 2000) use IEEE-754 floating point arithmetic, " -"and almost all platforms map Python floats to IEEE-754 \"double precision" -"\". 754 doubles contain 53 bits of precision, so on input the computer " -"strives to convert 0.1 to the closest fraction it can of the form *J*/2**\\ " -"*N* where *J* is an integer containing exactly 53 bits. Rewriting ::" -msgstr "" +"Why is that? 1/10 is not exactly representable as a binary fraction. Almost" +" all machines today (November 2000) use IEEE-754 floating point arithmetic, " +"and almost all platforms map Python floats to IEEE-754 \"double precision\"." +" 754 doubles contain 53 bits of precision, so on input the computer strives" +" to convert 0.1 to the closest fraction it can of the form *J*/2**\\ *N* " +"where *J* is an integer containing exactly 53 bits. Rewriting ::" +msgstr "" +"¿Por qué es eso? 1/10 no es representable exactamente como una fracción " +"binaria. Casi todas las máquinas de hoy en día (Noviembre del 2000) usan " +"aritmética de punto flotante IEEE-754, y casi todas las plataformas mapean " +"los flotantes de Python al \"doble precisión\" de IEEE-754. Estos " +"\"dobles\" tienen 53 bits de precisión, por lo tanto en la entrada la " +"computadora intenta convertir 0.1 a la fracción más cercana que puede de la " +"forma *J*/2\\*\\**N* donde *J* es un entero que contiene exactamente 53 " +"bits. Reescribiendo ::" #: ../Doc/tutorial/floatingpoint.rst:229 msgid "as ::" -msgstr "" +msgstr "...como ::" #: ../Doc/tutorial/floatingpoint.rst:233 msgid "" "and recalling that *J* has exactly 53 bits (is ``>= 2**52`` but ``< " "2**53``), the best value for *N* is 56::" msgstr "" +"...y recordando que *J* tiene exactamente 53 bits (es ``>= 2**52`` pero ``< " +"2**53``), el mejor valor para *N* es 56::" #: ../Doc/tutorial/floatingpoint.rst:239 msgid "" -"That is, 56 is the only value for *N* that leaves *J* with exactly 53 bits. " -"The best possible value for *J* is then that quotient rounded::" +"That is, 56 is the only value for *N* that leaves *J* with exactly 53 bits." +" The best possible value for *J* is then that quotient rounded::" msgstr "" +"O sea, 56 es el único valor para *N* que deja *J* con exactamente 53 bits. " +"El mejor valor posible para *J* es entonces el cociente redondeado::" #: ../Doc/tutorial/floatingpoint.rst:246 msgid "" "Since the remainder is more than half of 10, the best approximation is " "obtained by rounding up::" msgstr "" +"Ya que el resto es más que la mitad de 10, la mejor aproximación se obtiene " +"redondeándolo::" #: ../Doc/tutorial/floatingpoint.rst:252 msgid "" "Therefore the best possible approximation to 1/10 in 754 double precision " "is::" -msgstr "" +msgstr "Por lo tanto la mejor aproximación a 1/10 en doble precisión 754 es::" #: ../Doc/tutorial/floatingpoint.rst:256 msgid "" "Dividing both the numerator and denominator by two reduces the fraction to::" msgstr "" +"El dividir tanto el numerador como el denominador reduce la fracción a::" #: ../Doc/tutorial/floatingpoint.rst:260 msgid "" @@ -323,29 +463,43 @@ msgid "" "1/10; if we had not rounded up, the quotient would have been a little bit " "smaller than 1/10. But in no case can it be *exactly* 1/10!" msgstr "" +"Notá que como lo redondeamos, esto es un poquito más grande que 1/10; si no " +"lo hubiéramos redondeado, el cociente hubiese sido un poquito menor que " +"1/10. ¡Pero no hay caso en que sea *exactamente* 1/10!" #: ../Doc/tutorial/floatingpoint.rst:264 msgid "" "So the computer never \"sees\" 1/10: what it sees is the exact fraction " "given above, the best 754 double approximation it can get::" msgstr "" +"Entonces la computadora nunca \"ve\" 1/10: lo que ve es la fracción exacta " +"de arriba, la mejor aproximación al flotante doble de 754 que puede " +"obtener::" #: ../Doc/tutorial/floatingpoint.rst:270 msgid "" "If we multiply that fraction by 10\\*\\*55, we can see the value out to 55 " "decimal digits::" msgstr "" +"Si multiplicamos esa fracción por 10\\*\\*55, podemos ver el valor hasta los" +" 55 dígitos decimales::" #: ../Doc/tutorial/floatingpoint.rst:276 msgid "" -"meaning that the exact number stored in the computer is equal to the decimal " -"value 0.1000000000000000055511151231257827021181583404541015625. Instead of " -"displaying the full decimal value, many languages (including older versions " -"of Python), round the result to 17 significant digits::" +"meaning that the exact number stored in the computer is equal to the decimal" +" value 0.1000000000000000055511151231257827021181583404541015625. Instead of" +" displaying the full decimal value, many languages (including older versions" +" of Python), round the result to 17 significant digits::" msgstr "" +"...lo que significa que el valor exacto almacenado en la computadora es " +"igual al valor decimal " +"0.1000000000000000055511151231257827021181583404541015625. En lugar de " +"mostrar el valor decimal completo, muchos lenguajes (incluyendo versiones " +"más viejas de Python), redondean el resultado a 17 dígitos significativos::" #: ../Doc/tutorial/floatingpoint.rst:284 msgid "" "The :mod:`fractions` and :mod:`decimal` modules make these calculations " "easy::" msgstr "" +"Los módulos :mod:`fractions` y :mod:`decimal` hacen fácil estos cálculos::" diff --git a/tutorial/interactive.po b/tutorial/interactive.po index b8d1fdeef2..f76789feb6 100644 --- a/tutorial/interactive.po +++ b/tutorial/interactive.po @@ -18,20 +18,26 @@ msgstr "" #: ../Doc/tutorial/interactive.rst:5 msgid "Interactive Input Editing and History Substitution" -msgstr "" +msgstr "Edición de entrada interactiva y sustitución de historial" #: ../Doc/tutorial/interactive.rst:7 msgid "" -"Some versions of the Python interpreter support editing of the current input " -"line and history substitution, similar to facilities found in the Korn shell " -"and the GNU Bash shell. This is implemented using the `GNU Readline`_ " -"library, which supports various styles of editing. This library has its own " -"documentation which we won't duplicate here." +"Some versions of the Python interpreter support editing of the current input" +" line and history substitution, similar to facilities found in the Korn " +"shell and the GNU Bash shell. This is implemented using the `GNU Readline`_" +" library, which supports various styles of editing. This library has its " +"own documentation which we won't duplicate here." msgstr "" +"Algunas versiones del intérprete de Python permiten editar la línea de " +"entrada actual, y sustituir en base al historial, de forma similar a las " +"capacidades del intérprete de comandos Korn y el GNU bash. Esto se " +"implementa con la biblioteca `GNU Readline`_, que soporta varios estilos de " +"edición. Esta biblioteca tiene su propia documentación la cuál no vamos a " +"duplicar aquí." #: ../Doc/tutorial/interactive.rst:17 msgid "Tab Completion and History Editing" -msgstr "" +msgstr "Autocompletado con tab e historial de edición" #: ../Doc/tutorial/interactive.rst:19 msgid "" @@ -41,26 +47,45 @@ msgid "" "current local variables, and the available module names. For dotted " "expressions such as ``string.a``, it will evaluate the expression up to the " "final ``'.'`` and then suggest completions from the attributes of the " -"resulting object. Note that this may execute application-defined code if an " -"object with a :meth:`__getattr__` method is part of the expression. The " -"default configuration also saves your history into a file named :file:`." -"python_history` in your user directory. The history will be available again " -"during the next interactive interpreter session." +"resulting object. Note that this may execute application-defined code if an" +" object with a :meth:`__getattr__` method is part of the expression. The " +"default configuration also saves your history into a file named " +":file:`.python_history` in your user directory. The history will be " +"available again during the next interactive interpreter session." msgstr "" +"El autocompletado de variables y nombres de módulos es ``activado " +"automáticamente`` al iniciar el intérprete, por lo tanto la tecla :kbd:`Tab`" +" invoca la función de autocompletado; ésta mira en los nombres de sentencia," +" las variables locales y los nombres de módulos disponibles. Para " +"expresiones con puntos como ``string.a``, va a evaluar la expresión hasta el" +" ``'.'`` final y entonces sugerir autocompletado para los atributos del " +"objeto resultante. Nota que esto quizás ejecute código de aplicaciones " +"definidas si un objeto con un método :meth:`__getattr__` es parte de la " +"expresión. La configuración por omisión también guarda tu historial en un " +"archivo llamado :file:`.python_history` en tu directorio de usuario. El " +"historial estará disponible durante la próxima sesión interactiva del " +"intérprete." #: ../Doc/tutorial/interactive.rst:36 msgid "Alternatives to the Interactive Interpreter" -msgstr "" +msgstr "Alternativas al intérprete interactivo" #: ../Doc/tutorial/interactive.rst:38 msgid "" "This facility is an enormous step forward compared to earlier versions of " "the interpreter; however, some wishes are left: It would be nice if the " -"proper indentation were suggested on continuation lines (the parser knows if " -"an indent token is required next). The completion mechanism might use the " +"proper indentation were suggested on continuation lines (the parser knows if" +" an indent token is required next). The completion mechanism might use the " "interpreter's symbol table. A command to check (or even suggest) matching " "parentheses, quotes, etc., would also be useful." msgstr "" +"Esta funcionalidad es un paso enorme hacia adelante comparado con versiones " +"anteriores del interprete; de todos modos, quedan pendientes algunos deseos:" +" sería bueno que el sangrado correcto se sugiriera en las lineas de " +"continuación (el parser sabe si se requiere un sangrado a continuación). El " +"mecanismo de completado podría usar la tabla de símbolos del intérprete. Un " +"comando para verificar (o incluso sugerir) coincidencia de paréntesis, " +"comillas, etc. también sería útil." #: ../Doc/tutorial/interactive.rst:45 msgid "" @@ -70,3 +95,8 @@ msgid "" "customized and embedded into other applications. Another similar enhanced " "interactive environment is bpython_." msgstr "" +"Un intérprete interactivo mejorado alternativo que está dando vueltas desde " +"hace rato es IPython_, que ofrece completado por tab, exploración de " +"objetos, y administración avanzada del historial. También puede ser " +"configurado en profundidad, e integrarse en otras aplicaciones. Otro " +"entorno interactivo mejorado similar es bpython_." diff --git a/tutorial/modules.po b/tutorial/modules.po index f7363020b3..7db02fd2fa 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -220,17 +220,17 @@ msgid "" "For efficiency reasons, each module is only imported once per interpreter " "session. Therefore, if you change your modules, you must restart the " "interpreter -- or, if it's just one module you want to test interactively, " -"use :func:`importlib.reload`, e.g. ``import importlib; importlib." -"reload(modulename)``." +"use :func:`importlib.reload`, e.g. ``import importlib; " +"importlib.reload(modulename)``." msgstr "" #: ../Doc/tutorial/modules.rst:146 msgid "Executing modules as scripts" -msgstr "" +msgstr "Ejecutando módulos como scripts" #: ../Doc/tutorial/modules.rst:148 msgid "When you run a Python module with ::" -msgstr "" +msgstr "Cuando ejecutás un módulo de Python con ::" #: ../Doc/tutorial/modules.rst:152 msgid "" @@ -238,6 +238,9 @@ msgid "" "with the ``__name__`` set to ``\"__main__\"``. That means that by adding " "this code at the end of your module::" msgstr "" +"...el código en el módulo será ejecutado, tal como si lo hubieses importado," +" pero con ``__name__`` con el valor de ``\"__main__\"``. Eso significa que " +"agregando este código al final de tu módulo::" #: ../Doc/tutorial/modules.rst:160 msgid "" @@ -245,10 +248,13 @@ msgid "" "because the code that parses the command line only runs if the module is " "executed as the \"main\" file:" msgstr "" +"...podés hacer que el archivo sea utilizable tanto como script, como módulo " +"importable, porque el código que analiza la linea de órdenes sólo se ejecuta" +" si el módulo es ejecutado como archivo principal:" #: ../Doc/tutorial/modules.rst:169 msgid "If the module is imported, the code is not run::" -msgstr "" +msgstr "Si el módulo se importa, ese código no se ejecuta::" #: ../Doc/tutorial/modules.rst:174 msgid "" @@ -256,18 +262,26 @@ msgid "" "module, or for testing purposes (running the module as a script executes a " "test suite)." msgstr "" +"Esto es frecuentemente usado para proveer al módulo una interfaz de usuario " +"conveniente, o para propósitos de prueba (ejecutar el módulo como un script " +"ejecuta el juego de pruebas)." #: ../Doc/tutorial/modules.rst:181 msgid "The Module Search Path" -msgstr "" +msgstr "El camino de búsqueda de los módulos" #: ../Doc/tutorial/modules.rst:185 msgid "" "When a module named :mod:`spam` is imported, the interpreter first searches " "for a built-in module with that name. If not found, it then searches for a " -"file named :file:`spam.py` in a list of directories given by the variable :" -"data:`sys.path`. :data:`sys.path` is initialized from these locations:" -msgstr "" +"file named :file:`spam.py` in a list of directories given by the variable " +":data:`sys.path`. :data:`sys.path` is initialized from these locations:" +msgstr "" +"Cuando se importa un módulo llamado :mod:`spam`, el intérprete busca primero" +" por un módulo con ese nombre que esté integrado en el intérprete. Si no lo " +"encuentra, entonces busca un archivo llamado :file:`spam.py` en una lista " +"de directorios especificada por la variable :data:`sys.path`. " +":data:`sys.path` se inicializa con las siguientes ubicaciones:" #: ../Doc/tutorial/modules.rst:190 msgid "" diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index 682ab32816..d95a348e4e 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -18,17 +18,19 @@ msgstr "" #: ../Doc/tutorial/stdlib.rst:5 msgid "Brief Tour of the Standard Library" -msgstr "" +msgstr "Pequeño paseo por la Biblioteca Estándar" #: ../Doc/tutorial/stdlib.rst:11 msgid "Operating System Interface" -msgstr "" +msgstr "Interfaz al sistema operativo" #: ../Doc/tutorial/stdlib.rst:13 msgid "" "The :mod:`os` module provides dozens of functions for interacting with the " "operating system::" msgstr "" +"El módulo :mod:`os` provee docenas de funciones para interactuar con el " +"sistema operativo::" #: ../Doc/tutorial/stdlib.rst:23 msgid "" @@ -36,40 +38,54 @@ msgid "" "This will keep :func:`os.open` from shadowing the built-in :func:`open` " "function which operates much differently." msgstr "" +"Asegurate de usar el estilo ``import os`` en lugar de ``from os import *``. " +"Esto evitará que :func:`os.open` oculte a la función integrada :func:`open`," +" que trabaja bastante diferente." #: ../Doc/tutorial/stdlib.rst:29 msgid "" "The built-in :func:`dir` and :func:`help` functions are useful as " "interactive aids for working with large modules like :mod:`os`::" msgstr "" +"Las funciones integradas :func:`dir` y :func:`help` son útiles como ayudas " +"interactivas para trabajar con módulos grandes como :mod:`os`::" #: ../Doc/tutorial/stdlib.rst:38 msgid "" "For daily file and directory management tasks, the :mod:`shutil` module " "provides a higher level interface that is easier to use::" msgstr "" +"Para tareas diarias de administración de archivos y directorios, el módulo " +":mod:`shutil` provee una interfaz de más alto nivel que es más fácil de " +"usar::" #: ../Doc/tutorial/stdlib.rst:51 msgid "File Wildcards" -msgstr "" +msgstr "Comodines de archivos" #: ../Doc/tutorial/stdlib.rst:53 msgid "" "The :mod:`glob` module provides a function for making file lists from " "directory wildcard searches::" msgstr "" +"El módulo :mod:`glob` provee una función para hacer listas de archivos a " +"partir de búsquedas con comodines en directorios::" #: ../Doc/tutorial/stdlib.rst:64 msgid "Command Line Arguments" -msgstr "" +msgstr "Argumentos de linea de órdenes" #: ../Doc/tutorial/stdlib.rst:66 msgid "" "Common utility scripts often need to process command line arguments. These " -"arguments are stored in the :mod:`sys` module's *argv* attribute as a list. " -"For instance the following output results from running ``python demo.py one " -"two three`` at the command line::" +"arguments are stored in the :mod:`sys` module's *argv* attribute as a list." +" For instance the following output results from running ``python demo.py " +"one two three`` at the command line::" msgstr "" +"Los programas frecuentemente necesitan procesar argumentos de linea de " +"órdenes. Estos argumentos se almacenan en el atributo *argv* del módulo " +":mod:`sys` como una lista. Por ejemplo, la siguiente salida resulta de " +"ejecutar ``python demo.py uno dos tres`` en la línea de órdenes::" #: ../Doc/tutorial/stdlib.rst:75 msgid "" @@ -77,10 +93,13 @@ msgid "" "Unix :func:`getopt` function. More powerful and flexible command line " "processing is provided by the :mod:`argparse` module." msgstr "" +"El módulo :mod:`getopt` procesa *sys.argv* usando las convenciones de la " +"función de Unix :func:`getopt`. El módulo :mod:`argparse` provee un " +"procesamiento más flexible de la linea de órdenes." #: ../Doc/tutorial/stdlib.rst:83 msgid "Error Output Redirection and Program Termination" -msgstr "" +msgstr "Redirección de la salida de error y finalización del programa" #: ../Doc/tutorial/stdlib.rst:85 msgid "" @@ -88,57 +107,74 @@ msgid "" "*stderr*. The latter is useful for emitting warnings and error messages to " "make them visible even when *stdout* has been redirected::" msgstr "" +"El módulo :mod:`sys` también tiene atributos para *stdin*, *stdout*, y " +"*stderr*. Este último es útil para emitir mensajes de alerta y error para " +"que se vean incluso cuando se haya redireccionado *stdout*::" #: ../Doc/tutorial/stdlib.rst:92 msgid "The most direct way to terminate a script is to use ``sys.exit()``." -msgstr "" +msgstr "La forma más directa de terminar un programa es usar ``sys.exit()``." #: ../Doc/tutorial/stdlib.rst:98 msgid "String Pattern Matching" -msgstr "" +msgstr "Coincidencia en patrones de cadenas" #: ../Doc/tutorial/stdlib.rst:100 msgid "" "The :mod:`re` module provides regular expression tools for advanced string " -"processing. For complex matching and manipulation, regular expressions offer " -"succinct, optimized solutions::" +"processing. For complex matching and manipulation, regular expressions offer" +" succinct, optimized solutions::" msgstr "" +"El módulo :mod:`re` provee herramientas de expresiones regulares para un " +"procesamiento avanzado de cadenas. Para manipulación y coincidencias " +"complejas, las expresiones regulares ofrecen soluciones concisas y " +"optimizadas::" #: ../Doc/tutorial/stdlib.rst:110 msgid "" "When only simple capabilities are needed, string methods are preferred " "because they are easier to read and debug::" msgstr "" +"Cuando se necesita algo más sencillo solamente, se prefieren los métodos de " +"las cadenas porque son más fáciles de leer y depurar." #: ../Doc/tutorial/stdlib.rst:120 msgid "Mathematics" -msgstr "" +msgstr "Matemática" #: ../Doc/tutorial/stdlib.rst:122 msgid "" "The :mod:`math` module gives access to the underlying C library functions " "for floating point math::" msgstr "" +"El módulo :mod:`math` permite el acceso a las funciones de la biblioteca C " +"subyacente para la matemática de punto flotante::" #: ../Doc/tutorial/stdlib.rst:131 msgid "The :mod:`random` module provides tools for making random selections::" msgstr "" +"El módulo :mod:`random` provee herramientas para realizar selecciones al " +"azar::" #: ../Doc/tutorial/stdlib.rst:143 msgid "" "The :mod:`statistics` module calculates basic statistical properties (the " "mean, median, variance, etc.) of numeric data::" msgstr "" +"El módulo :mod:`statistics` calcula propiedades de estadística básica (la " +"media, mediana, varianza, etc) de datos númericos::" #: ../Doc/tutorial/stdlib.rst:155 msgid "" "The SciPy project has many other modules for numerical " "computations." msgstr "" +"El proyecto SciPy tiene muchos otros módulos para " +"cálculos numéricos." #: ../Doc/tutorial/stdlib.rst:161 msgid "Internet Access" -msgstr "" +msgstr "Acceso a Internet" #: ../Doc/tutorial/stdlib.rst:163 msgid "" diff --git a/tutorial/stdlib2.po b/tutorial/stdlib2.po index c181a02300..4063aef7e8 100644 --- a/tutorial/stdlib2.po +++ b/tutorial/stdlib2.po @@ -18,37 +18,49 @@ msgstr "" #: ../Doc/tutorial/stdlib2.rst:5 msgid "Brief Tour of the Standard Library --- Part II" -msgstr "" +msgstr "Pequeño paseo por la Biblioteca Estándar - Parte II" #: ../Doc/tutorial/stdlib2.rst:7 msgid "" "This second tour covers more advanced modules that support professional " "programming needs. These modules rarely occur in small scripts." msgstr "" +"Este segundo paseo cubre módulos más avanzados que facilitan necesidades de " +"programación complejas. Estos módulos raramente se usan en scripts cortos." #: ../Doc/tutorial/stdlib2.rst:14 msgid "Output Formatting" -msgstr "" +msgstr "Formato de salida" #: ../Doc/tutorial/stdlib2.rst:16 msgid "" "The :mod:`reprlib` module provides a version of :func:`repr` customized for " "abbreviated displays of large or deeply nested containers::" msgstr "" +"El módulo :mod:`reprlib` provee una versión de :func:`repr` ajustada para " +"mostrar contenedores grandes o profundamente anidados, en forma abreviada:" #: ../Doc/tutorial/stdlib2.rst:23 msgid "" "The :mod:`pprint` module offers more sophisticated control over printing " "both built-in and user defined objects in a way that is readable by the " -"interpreter. When the result is longer than one line, the \"pretty printer\" " -"adds line breaks and indentation to more clearly reveal data structure::" +"interpreter. When the result is longer than one line, the \"pretty printer\"" +" adds line breaks and indentation to more clearly reveal data structure::" msgstr "" +"El módulo :mod:`pprint` ofrece un control más sofisticado de la forma en que" +" se imprimen tanto los objetos predefinidos como los objetos definidos por " +"el usuario, de manera que sean legibles por el intérprete. Cuando el " +"resultado ocupa más de una línea, el generador de \"impresiones lindas\" " +"agrega saltos de línea y sangrías para mostrar la estructura de los datos " +"más claramente::" #: ../Doc/tutorial/stdlib2.rst:39 msgid "" "The :mod:`textwrap` module formats paragraphs of text to fit a given screen " "width::" msgstr "" +"El módulo :mod:`textwrap` formatea párrafos de texto para que quepan dentro " +"de cierto ancho de pantalla::" #: ../Doc/tutorial/stdlib2.rst:53 msgid "" @@ -56,10 +68,13 @@ msgid "" "formats. The grouping attribute of locale's format function provides a " "direct way of formatting numbers with group separators::" msgstr "" +"El módulo :mod:`locale` accede a una base de datos de formatos específicos a" +" una cultura. El atributo `grouping` de la función :func:`format` permite " +"una forma directa de formatear números con separadores de grupo::" #: ../Doc/tutorial/stdlib2.rst:72 msgid "Templating" -msgstr "" +msgstr "Plantillas" #: ../Doc/tutorial/stdlib2.rst:74 msgid "" @@ -68,24 +83,39 @@ msgid "" "allows users to customize their applications without having to alter the " "application." msgstr "" +"El módulo :mod:`string` incluye una clase versátil :class:`~string.Template`" +" (plantilla) con una sintaxis simplificada apta para ser editada por " +"usuarios finales. Esto permite que los usuarios personalicen sus " +"aplicaciones sin necesidad de modificar la aplicación en sí." #: ../Doc/tutorial/stdlib2.rst:78 msgid "" "The format uses placeholder names formed by ``$`` with valid Python " "identifiers (alphanumeric characters and underscores). Surrounding the " "placeholder with braces allows it to be followed by more alphanumeric " -"letters with no intervening spaces. Writing ``$$`` creates a single escaped " -"``$``::" +"letters with no intervening spaces. Writing ``$$`` creates a single escaped" +" ``$``::" msgstr "" +"El formato usa marcadores cuyos nombres se forman con ``$`` seguido de " +"identificadores Python válidos (caracteres alfanuméricos y guión de " +"subrayado). Si se los encierra entre llaves, pueden seguir más caracteres " +"alfanuméricos sin necesidad de dejar espacios en blanco. ``$$`` genera un " +"``$``::" #: ../Doc/tutorial/stdlib2.rst:88 msgid "" -"The :meth:`~string.Template.substitute` method raises a :exc:`KeyError` when " -"a placeholder is not supplied in a dictionary or a keyword argument. For " -"mail-merge style applications, user supplied data may be incomplete and the :" -"meth:`~string.Template.safe_substitute` method may be more appropriate --- " +"The :meth:`~string.Template.substitute` method raises a :exc:`KeyError` when" +" a placeholder is not supplied in a dictionary or a keyword argument. For " +"mail-merge style applications, user supplied data may be incomplete and the " +":meth:`~string.Template.safe_substitute` method may be more appropriate --- " "it will leave placeholders unchanged if data is missing::" msgstr "" +"El método :meth:`~string.Temaplte.substitute` lanza :exc:`KeyError` cuando " +"no se suministra ningún valor para un marcador mediante un diccionario o " +"argumento por nombre. Para algunas aplicaciones los datos suministrados por" +" el usuario puede ser incompletos, y el método " +":meth:`~string.Template.safe_substitute` puede ser más apropiado: deja los " +"marcadores inalterados cuando hay datos faltantes::" #: ../Doc/tutorial/stdlib2.rst:103 msgid "" @@ -94,6 +124,10 @@ msgid "" "placeholders such as the current date, image sequence number, or file " "format::" msgstr "" +"Las subclases de Template pueden especificar un delimitador propio. Por " +"ejemplo, una utilidad de renombrado por lotes para un visualizador de fotos " +"puede escoger usar signos de porcentaje para los marcadores tales como la " +"fecha actual, el número de secuencia de la imagen, o el formato de archivo::" #: ../Doc/tutorial/stdlib2.rst:125 msgid "" diff --git a/tutorial/venv.po b/tutorial/venv.po index 73a2dde5f1..5330b6153e 100644 --- a/tutorial/venv.po +++ b/tutorial/venv.po @@ -18,11 +18,11 @@ msgstr "" #: ../Doc/tutorial/venv.rst:6 msgid "Virtual Environments and Packages" -msgstr "" +msgstr "Entornos Virtuales y Paquetes" #: ../Doc/tutorial/venv.rst:9 msgid "Introduction" -msgstr "" +msgstr "Introducción" #: ../Doc/tutorial/venv.rst:11 msgid "" @@ -32,15 +32,25 @@ msgid "" "bug has been fixed or the application may be written using an obsolete " "version of the library's interface." msgstr "" +"Las aplicaciones en Python usualmente hacen uso de paquetes y módulos que no" +" forman parte de la librería estándar. Las aplicaciones a veces necesitan " +"una versión específica de una librería, debido a que dicha aplicación " +"requiere que un bug particular haya sido solucionado o bien la aplicación ha" +" sido escrita usando una versión obsoleta de la interface de la librería." #: ../Doc/tutorial/venv.rst:17 msgid "" "This means it may not be possible for one Python installation to meet the " "requirements of every application. If application A needs version 1.0 of a " -"particular module but application B needs version 2.0, then the requirements " -"are in conflict and installing either version 1.0 or 2.0 will leave one " +"particular module but application B needs version 2.0, then the requirements" +" are in conflict and installing either version 1.0 or 2.0 will leave one " "application unable to run." msgstr "" +"Esto significa que tal vez no sea posible para una instalación de Python " +"cumplir los requerimientos de todas las aplicaciones. Si la aplicación A " +"necesita la versión 1.0 de un módulo particular y la aplicación B necesita " +"la versión 2.0, entonces los requerimientos entran en conflicto e instalar " +"la versión 1.0 o 2.0 dejará una de las aplicaciones sin funcionar." #: ../Doc/tutorial/venv.rst:23 msgid "" @@ -48,6 +58,9 @@ msgid "" "self-contained directory tree that contains a Python installation for a " "particular version of Python, plus a number of additional packages." msgstr "" +"La solución a este problema es crear un :term:`entorno virtual`, un " +"directorio que contiene una instalación de Python de una versión en " +"particular, además de unos cuantos paquetes adicionales." #: ../Doc/tutorial/venv.rst:27 msgid "" @@ -58,19 +71,32 @@ msgid "" "application B requires a library be upgraded to version 3.0, this will not " "affect application A's environment." msgstr "" +"Diferentes aplicaciones pueden entonces usar entornos virtuales diferentes." +" Para resolver el ejemplo de requerimientos en conflicto citado " +"anteriormente, la aplicación A puede tener su propio entorno virtual con la " +"versión 1.0 instalada mientras que la aplicación B tiene otro entorno " +"virtual con la versión 2.0. Si la aplicación B requiere que actualizar la " +"librería a la versión 3.0, ésto no afectará el entorno virtual de la " +"aplicación A." #: ../Doc/tutorial/venv.rst:36 msgid "Creating Virtual Environments" -msgstr "" +msgstr "Creando Entornos Virtuales" #: ../Doc/tutorial/venv.rst:38 msgid "" -"The module used to create and manage virtual environments is called :mod:" -"`venv`. :mod:`venv` will usually install the most recent version of Python " -"that you have available. If you have multiple versions of Python on your " -"system, you can select a specific Python version by running ``python3`` or " -"whichever version you want." +"The module used to create and manage virtual environments is called " +":mod:`venv`. :mod:`venv` will usually install the most recent version of " +"Python that you have available. If you have multiple versions of Python on " +"your system, you can select a specific Python version by running ``python3``" +" or whichever version you want." msgstr "" +"El script usado para crear y manejar entornos virtuales es " +":program:`pyvenv`. :program:`pyvenv` normalmente instalará la versión mas " +"reciente de Python que tengas disponible; el script también es instalado con" +" un número de versión, con lo que si tienes múltiples versiones de Python en" +" tu sistema puedes seleccionar una versión de Python específica ejecutando " +"``python3`` o la versión que desees." #: ../Doc/tutorial/venv.rst:44 msgid "" @@ -78,6 +104,8 @@ msgid "" "place it, and run the :mod:`venv` module as a script with the directory " "path::" msgstr "" +"Para crear un virtualenv, decide en que carpeta quieres crearlo y ejecuta el" +" módulo :mod:`venv` como script con la ruta a la carpeta::" #: ../Doc/tutorial/venv.rst:49 msgid "" @@ -85,18 +113,21 @@ msgid "" "also create directories inside it containing a copy of the Python " "interpreter, the standard library, and various supporting files." msgstr "" +"Esto creará la carpeta ``tutorial-env`` si no existe, y también creará las " +"subcarpetas conteniendo la copia del intérprete Python, la librería estándar" +" y los archivos de soporte." #: ../Doc/tutorial/venv.rst:53 msgid "Once you've created a virtual environment, you may activate it." -msgstr "" +msgstr "Una vez creado el entorno virtual, podrás activarlo." #: ../Doc/tutorial/venv.rst:55 msgid "On Windows, run::" -msgstr "" +msgstr "En Windows, ejecuta::" #: ../Doc/tutorial/venv.rst:59 msgid "On Unix or MacOS, run::" -msgstr "" +msgstr "En Unix o MacOS, ejecuta::" #: ../Doc/tutorial/venv.rst:63 msgid "" @@ -104,6 +135,9 @@ msgid "" "or :program:`fish` shells, there are alternate ``activate.csh`` and " "``activate.fish`` scripts you should use instead.)" msgstr "" +"(Este script está escrito para la consola bash. Si usas las consolas " +":program:`csh` or :program:`fish`, hay scripts alternativos ``activate.csh``" +" y ``activate.fish`` que deberá usar en su lugar)." #: ../Doc/tutorial/venv.rst:68 msgid "" @@ -112,15 +146,18 @@ msgid "" "running ``python`` will get you that particular version and installation of " "Python. For example:" msgstr "" +"Activar el entorno virtual cambiará el prompt de tu consola para mostrar que" +" entorno virtual está usando, y modificará el entorno para que al ejecutar " +"``python`` sea con esa versión e instalación en particular. Por ejemplo:" #: ../Doc/tutorial/venv.rst:87 msgid "Managing Packages with pip" -msgstr "" +msgstr "Manejando paquetes con pip" #: ../Doc/tutorial/venv.rst:89 msgid "" -"You can install, upgrade, and remove packages using a program called :" -"program:`pip`. By default ``pip`` will install packages from the Python " +"You can install, upgrade, and remove packages using a program called " +":program:`pip`. By default ``pip`` will install packages from the Python " "Package Index, . You can browse the Python Package Index " "by going to it in your web browser, or you can use ``pip``'s limited search " "feature:" @@ -128,22 +165,29 @@ msgstr "" #: ../Doc/tutorial/venv.rst:105 msgid "" -"``pip`` has a number of subcommands: \"search\", \"install\", \"uninstall\", " -"\"freeze\", etc. (Consult the :ref:`installing-index` guide for complete " +"``pip`` has a number of subcommands: \"search\", \"install\", \"uninstall\"," +" \"freeze\", etc. (Consult the :ref:`installing-index` guide for complete " "documentation for ``pip``.)" msgstr "" +"``pip`` tiene varios subcomandos: \"search\", \"install\", \"uninstall\", " +"\"freeze\", etc. (consulta la guía :ref:`installing-index` para la " +"documentación completa de ``pip``.)" #: ../Doc/tutorial/venv.rst:109 msgid "" "You can install the latest version of a package by specifying a package's " "name:" msgstr "" +"Se puede instalar la última versión de un paquete especificando el nombre " +"del paquete:" #: ../Doc/tutorial/venv.rst:120 msgid "" "You can also install a specific version of a package by giving the package " "name followed by ``==`` and the version number:" msgstr "" +"También se puede instalar una verisón específica de un paquete ingresando el" +" nombre del paquete seguido de ``==`` y el número de versión:" #: ../Doc/tutorial/venv.rst:131 msgid "" @@ -152,41 +196,54 @@ msgid "" "number to get that version, or you can run ``pip install --upgrade`` to " "upgrade the package to the latest version:" msgstr "" +"Si se re-ejecuta el comando, ``pip`` detectará que la versión ya está " +"instalada y no hará nada. Se puede ingresar un número de versión diferente " +"para instalarlo, o se puede ejecutar ``pip install --upgrade`` para " +"actualizar el paquete a la última versión:" #: ../Doc/tutorial/venv.rst:146 msgid "" "``pip uninstall`` followed by one or more package names will remove the " "packages from the virtual environment." msgstr "" +"``pip uninstall`` seguido de uno o varios nombres de paquetes desinstalará " +"los paquetes del entorno virtual." #: ../Doc/tutorial/venv.rst:149 msgid "``pip show`` will display information about a particular package:" -msgstr "" +msgstr "``pip show`` mostrará información de un paquete en particular:" #: ../Doc/tutorial/venv.rst:166 msgid "" "``pip list`` will display all of the packages installed in the virtual " "environment:" msgstr "" +"``pip list`` mostrará todos los paquetes instalados en el entorno virtual:" #: ../Doc/tutorial/venv.rst:178 msgid "" "``pip freeze`` will produce a similar list of the installed packages, but " -"the output uses the format that ``pip install`` expects. A common convention " -"is to put this list in a ``requirements.txt`` file:" +"the output uses the format that ``pip install`` expects. A common convention" +" is to put this list in a ``requirements.txt`` file:" msgstr "" +"``pip freeze`` devuelve una lista de paquetes instalados similar, pero el " +"formato de salida es el requerido por ``pip install``. Una convención común" +" es poner esta lista en un archivo ``requirements.txt``:" #: ../Doc/tutorial/venv.rst:190 msgid "" "The ``requirements.txt`` can then be committed to version control and " -"shipped as part of an application. Users can then install all the necessary " -"packages with ``install -r``:" +"shipped as part of an application. Users can then install all the necessary" +" packages with ``install -r``:" msgstr "" +"El archivo ``requirements.txt`` entonces puede ser agregado a nuestro " +"control de versiones y distribuído como parte de la aplicación. Los usuarios" +" pueden entonces instalar todos los paquetes necesarios con ``install -r``:" #: ../Doc/tutorial/venv.rst:207 msgid "" "``pip`` has many more options. Consult the :ref:`installing-index` guide " "for complete documentation for ``pip``. When you've written a package and " -"want to make it available on the Python Package Index, consult the :ref:" -"`distributing-index` guide." +"want to make it available on the Python Package Index, consult the " +":ref:`distributing-index` guide." msgstr "" diff --git a/tutorial/whatnow.po b/tutorial/whatnow.po index 63644163fa..25fecaa6b6 100644 --- a/tutorial/whatnow.po +++ b/tutorial/whatnow.po @@ -18,20 +18,25 @@ msgstr "" #: ../Doc/tutorial/whatnow.rst:5 msgid "What Now?" -msgstr "" +msgstr "¿Y ahora qué?" #: ../Doc/tutorial/whatnow.rst:7 msgid "" "Reading this tutorial has probably reinforced your interest in using Python " -"--- you should be eager to apply Python to solving your real-world problems. " -"Where should you go to learn more?" +"--- you should be eager to apply Python to solving your real-world problems." +" Where should you go to learn more?" msgstr "" +"Leer este tutorial probablemente reforzó tu interés por usar Python, " +"deberías estar ansioso por aplicar Python a la resolución de tus problemas " +"reales. ¿A dónde deberías ir para aprender más?" #: ../Doc/tutorial/whatnow.rst:11 msgid "" "This tutorial is part of Python's documentation set. Some other documents " "in the set are:" msgstr "" +"Este tutorial forma parte del juego de documentación de Python. Algunos " +"otros documentos que encontrarás en este juego son:" #: ../Doc/tutorial/whatnow.rst:14 msgid ":ref:`library-index`:" @@ -63,7 +68,7 @@ msgstr "" #: ../Doc/tutorial/whatnow.rst:31 msgid "More Python resources:" -msgstr "" +msgstr "Más recursos sobre Python:" #: ../Doc/tutorial/whatnow.rst:33 msgid "" @@ -103,26 +108,37 @@ msgstr "" #: ../Doc/tutorial/whatnow.rst:54 msgid "" "https://scipy.org: The Scientific Python project includes modules for fast " -"array computations and manipulations plus a host of packages for such things " -"as linear algebra, Fourier transforms, non-linear solvers, random number " +"array computations and manipulations plus a host of packages for such things" +" as linear algebra, Fourier transforms, non-linear solvers, random number " "distributions, statistical analysis and the like." msgstr "" #: ../Doc/tutorial/whatnow.rst:59 msgid "" "For Python-related questions and problem reports, you can post to the " -"newsgroup :newsgroup:`comp.lang.python`, or send them to the mailing list at " -"python-list@python.org. The newsgroup and mailing list are gatewayed, so " +"newsgroup :newsgroup:`comp.lang.python`, or send them to the mailing list at" +" python-list@python.org. The newsgroup and mailing list are gatewayed, so " "messages posted to one will automatically be forwarded to the other. There " -"are hundreds of postings a day, asking (and answering) questions, suggesting " -"new features, and announcing new modules. Mailing list archives are " +"are hundreds of postings a day, asking (and answering) questions, suggesting" +" new features, and announcing new modules. Mailing list archives are " "available at https://mail.python.org/pipermail/." msgstr "" +"Para preguntas relacionadas con Python y reportes de problemas puedes " +"escribir al grupo de noticias :newsgroup:`comp.lang.python`, o enviarlas a " +"la lista de correo que hay en python-list@python.org. El grupo de noticias y" +" la lista de correo están interconectadas, por lo que los mensajes enviados " +"a uno serán retransmitidos al otro. Hay alrededor de cientos de mensajes " +"diarios (con picos de hasta varios cientos), haciendo (y respondiendo) " +"preguntas, sugiriendo nuevas características, y anunciando nuevos módulos. " +"Antes de escribir, asegúrate de haber revisado la lista de `Preguntas " +"Frecuentes `_ (también llamado el FAQ). " +"Muchas veces responde las preguntas que se hacen una y otra vez, y quizáz " +"contega la solución a tu problema." #: ../Doc/tutorial/whatnow.rst:67 msgid "" "Before posting, be sure to check the list of :ref:`Frequently Asked " "Questions ` (also called the FAQ). The FAQ answers many of the " -"questions that come up again and again, and may already contain the solution " -"for your problem." +"questions that come up again and again, and may already contain the solution" +" for your problem." msgstr "" From 7f679cf69660cf72b55bc1e790a5ee404225e215 Mon Sep 17 00:00:00 2001 From: gilgamezh Date: Sat, 2 May 2020 15:31:34 +0200 Subject: [PATCH 09/24] ignore ! when comparing --- .migration/rst2po.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.migration/rst2po.py b/.migration/rst2po.py index 05273a0ae2..258856e933 100644 --- a/.migration/rst2po.py +++ b/.migration/rst2po.py @@ -96,7 +96,7 @@ def get_paragraph(fd): def get_rst_translation_text(rstfilename, english_spanish, text): """Given an rstfilename an a text returns the corresponding translated text if exists""" for en, es in english_spanish: - if en == text: + if en.replace("!", "") == text.replace("!", ""): return es From 5144e29b17f6964c3ad9c144696d53d180b89968 Mon Sep 17 00:00:00 2001 From: gilgamezh Date: Sat, 2 May 2020 15:42:02 +0200 Subject: [PATCH 10/24] update translation --- tutorial/datastructures.po | 234 +++++++++++++++++++++++++++---------- 1 file changed, 175 insertions(+), 59 deletions(-) diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index d1c84a632c..1c9bc4b07f 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -216,6 +216,7 @@ msgstr "" #: ../Doc/tutorial/datastructures.rst:197 msgid "For example, assume we want to create a list of squares, like::" msgstr "" +"Por ejemplo, asumamos que queremos crear una lista de cuadrados, como::" #: ../Doc/tutorial/datastructures.rst:206 msgid "" @@ -223,91 +224,119 @@ msgid "" "exists after the loop completes. We can calculate the list of squares " "without any side effects using::" msgstr "" +"Nota que esto crea (o sobreescribe) una variable llamada ``x`` que sigue " +"existiendo luego de que el bucle haya terminado. Podemos calcular la lista " +"de cuadrados sin ningun efecto secundario haciendo::" #: ../Doc/tutorial/datastructures.rst:212 msgid "or, equivalently::" -msgstr "" +msgstr "o, un equivalente::" #: ../Doc/tutorial/datastructures.rst:216 msgid "which is more concise and readable." -msgstr "" +msgstr "que es más conciso y legible." #: ../Doc/tutorial/datastructures.rst:218 msgid "" "A list comprehension consists of brackets containing an expression followed " -"by a :keyword:`!for` clause, then zero or more :keyword:`!for` or :keyword:`!" -"if` clauses. The result will be a new list resulting from evaluating the " -"expression in the context of the :keyword:`!for` and :keyword:`!if` clauses " -"which follow it. For example, this listcomp combines the elements of two " -"lists if they are not equal::" -msgstr "" +"by a :keyword:`!for` clause, then zero or more :keyword:`!for` or " +":keyword:`!if` clauses. The result will be a new list resulting from " +"evaluating the expression in the context of the :keyword:`!for` and " +":keyword:`!if` clauses which follow it. For example, this listcomp combines " +"the elements of two lists if they are not equal::" +msgstr "" +"Una lista de comprensión consiste de corchetes rodeando una expresión " +"seguida de la declaración :keyword:`for` y luego cero o más declaraciones " +":keyword:`for` o :keyword:`if`. El resultado será una nueva lista que sale " +"de evaluar la expresión en el contexto de los :keyword:`for` o :keyword:`if`" +" que le siguen. Por ejemplo, esta lista de comprensión combina los " +"elementos de dos listas si no son iguales::" #: ../Doc/tutorial/datastructures.rst:228 msgid "and it's equivalent to::" -msgstr "" +msgstr "y es equivalente a::" #: ../Doc/tutorial/datastructures.rst:239 msgid "" -"Note how the order of the :keyword:`for` and :keyword:`if` statements is the " -"same in both these snippets." +"Note how the order of the :keyword:`for` and :keyword:`if` statements is the" +" same in both these snippets." msgstr "" +"Notá como el orden de los :keyword:`for` y :keyword:`if` es el mismo en " +"ambos pedacitos de código." #: ../Doc/tutorial/datastructures.rst:242 msgid "" "If the expression is a tuple (e.g. the ``(x, y)`` in the previous example), " "it must be parenthesized. ::" msgstr "" +"Si la expresión es una tupla (como el ``(x, y)`` en el ejemplo anterior), " +"debe estar entre paréntesis. ::" #: ../Doc/tutorial/datastructures.rst:273 msgid "" "List comprehensions can contain complex expressions and nested functions::" msgstr "" +"Las comprensiones de listas pueden contener expresiones complejas y " +"funciones anidadas::" #: ../Doc/tutorial/datastructures.rst:280 msgid "Nested List Comprehensions" -msgstr "" +msgstr "Listas por comprensión anidadas" #: ../Doc/tutorial/datastructures.rst:282 msgid "" "The initial expression in a list comprehension can be any arbitrary " "expression, including another list comprehension." msgstr "" +"La expresión inicial de una comprensión de listas puede ser cualquier " +"expresión arbitraria, incluyendo otra comprensión de listas." #: ../Doc/tutorial/datastructures.rst:285 msgid "" "Consider the following example of a 3x4 matrix implemented as a list of 3 " "lists of length 4::" msgstr "" +"Considerá el siguiente ejemplo de una matriz de 3x4 implementada como una " +"lista de tres listas de largo 4::" #: ../Doc/tutorial/datastructures.rst:294 msgid "The following list comprehension will transpose rows and columns::" -msgstr "" +msgstr "La siguiente comprensión de lista transpondrá las filas y columnas::" #: ../Doc/tutorial/datastructures.rst:299 msgid "" "As we saw in the previous section, the nested listcomp is evaluated in the " -"context of the :keyword:`for` that follows it, so this example is equivalent " -"to::" +"context of the :keyword:`for` that follows it, so this example is equivalent" +" to::" msgstr "" +"Como vimos en la sección anterior, la lista de comprensión anidada se evalua" +" en el contexto del :keyword:`for` que lo sigue, por lo que este ejemplo " +"equivale a::" #: ../Doc/tutorial/datastructures.rst:310 msgid "which, in turn, is the same as::" -msgstr "" +msgstr "el cual, a la vez, es lo mismo que::" #: ../Doc/tutorial/datastructures.rst:323 msgid "" "In the real world, you should prefer built-in functions to complex flow " -"statements. The :func:`zip` function would do a great job for this use case::" +"statements. The :func:`zip` function would do a great job for this use " +"case::" msgstr "" +"En el mundo real, deberías preferir funciones predefinidas a declaraciones " +"con flujo complejo. La función :func:`zip` haría un buen trabajo para este " +"caso de uso::" #: ../Doc/tutorial/datastructures.rst:329 msgid "" "See :ref:`tut-unpacking-arguments` for details on the asterisk in this line." msgstr "" +"Ver :ref:`tut-unpacking-arguments` para detalles en el asterisco de esta " +"línea." #: ../Doc/tutorial/datastructures.rst:334 msgid "The :keyword:`!del` statement" -msgstr "" +msgstr "La instrucción :keyword:`del`" #: ../Doc/tutorial/datastructures.rst:336 msgid "" @@ -317,44 +346,67 @@ msgid "" "used to remove slices from a list or clear the entire list (which we did " "earlier by assignment of an empty list to the slice). For example::" msgstr "" +"Hay una manera de quitar un ítem de una lista dado su índice en lugar de su " +"valor: la instrucción :keyword:`del`. Esta es diferente del método " +":meth:`pop`, el cual devuelve un valor. La instrucción :keyword:`del` " +"también puede usarse para quitar secciones de una lista o vaciar la lista " +"completa (lo que hacíamos antes asignando una lista vacía a la sección). " +"Por ejemplo::" #: ../Doc/tutorial/datastructures.rst:353 msgid ":keyword:`del` can also be used to delete entire variables::" -msgstr "" +msgstr ":keyword:`del` puede usarse también para eliminar variables::" #: ../Doc/tutorial/datastructures.rst:357 msgid "" "Referencing the name ``a`` hereafter is an error (at least until another " "value is assigned to it). We'll find other uses for :keyword:`del` later." msgstr "" +"Hacer referencia al nombre ``a`` de aquí en más es un error (al menos hasta " +"que se le asigne otro valor). Veremos otros usos para :keyword:`del` más " +"adelante." #: ../Doc/tutorial/datastructures.rst:364 msgid "Tuples and Sequences" -msgstr "" +msgstr "Tuplas y secuencias" #: ../Doc/tutorial/datastructures.rst:366 msgid "" "We saw that lists and strings have many common properties, such as indexing " -"and slicing operations. They are two examples of *sequence* data types " -"(see :ref:`typesseq`). Since Python is an evolving language, other sequence " -"data types may be added. There is also another standard sequence data type: " -"the *tuple*." +"and slicing operations. They are two examples of *sequence* data types (see" +" :ref:`typesseq`). Since Python is an evolving language, other sequence " +"data types may be added. There is also another standard sequence data type:" +" the *tuple*." msgstr "" +"Vimos que las listas y cadenas tienen propiedades en común, como el indizado" +" y las operaciones de seccionado. Estas son dos ejemplos de datos de tipo " +"*secuencia* (ver :ref:`typesseq`). Como Python es un lenguaje en evolución," +" otros datos de tipo secuencia pueden agregarse. Existe otro dato de tipo " +"secuencia estándar: la *tupla*." #: ../Doc/tutorial/datastructures.rst:372 msgid "" "A tuple consists of a number of values separated by commas, for instance::" msgstr "" +"Una tupla consiste de un número de valores separados por comas, por " +"ejemplo::" #: ../Doc/tutorial/datastructures.rst:394 msgid "" "As you see, on output tuples are always enclosed in parentheses, so that " "nested tuples are interpreted correctly; they may be input with or without " -"surrounding parentheses, although often parentheses are necessary anyway (if " -"the tuple is part of a larger expression). It is not possible to assign to " -"the individual items of a tuple, however it is possible to create tuples " +"surrounding parentheses, although often parentheses are necessary anyway (if" +" the tuple is part of a larger expression). It is not possible to assign to" +" the individual items of a tuple, however it is possible to create tuples " "which contain mutable objects, such as lists." msgstr "" +"Como puedes ver, en la salida las tuplas siempre se encierran entre " +"paréntesis, para que las tuplas anidadas puedan interpretarse correctamente;" +" pueden ingresarse con o sin paréntesis, aunque a menudo los paréntesis son " +"necesarios de todas formas (si la tupla es parte de una expresión más " +"grande). No es posible asignar a los ítems individuales de una tupla, pero " +"sin embargo sí se puede crear tuplas que contengan objetos mutables, como " +"las listas." #: ../Doc/tutorial/datastructures.rst:401 msgid "" @@ -362,19 +414,32 @@ msgid "" "situations and for different purposes. Tuples are :term:`immutable`, and " "usually contain a heterogeneous sequence of elements that are accessed via " "unpacking (see later in this section) or indexing (or even by attribute in " -"the case of :func:`namedtuples `). Lists are :term:" -"`mutable`, and their elements are usually homogeneous and are accessed by " -"iterating over the list." -msgstr "" +"the case of :func:`namedtuples `). Lists are " +":term:`mutable`, and their elements are usually homogeneous and are accessed" +" by iterating over the list." +msgstr "" +"A pesar de que las tuplas puedan parecerse a las listas, frecuentemente se " +"utilizan en distintas situaciones y para distintos propósitos. Las tuplas " +"son `inmutables` y normalmente contienen una secuencia heterogénea de " +"elementos que son accedidos al desempaquetar (ver más adelante en esta " +"sección) o indizar (o incluso acceder por atributo en el caso de las " +":func:`namedtuples `). Las listas son `mutables`, y" +" sus elementos son normalmente homogéneos y se acceden iterando a la lista." #: ../Doc/tutorial/datastructures.rst:409 msgid "" -"A special problem is the construction of tuples containing 0 or 1 items: the " -"syntax has some extra quirks to accommodate these. Empty tuples are " +"A special problem is the construction of tuples containing 0 or 1 items: the" +" syntax has some extra quirks to accommodate these. Empty tuples are " "constructed by an empty pair of parentheses; a tuple with one item is " "constructed by following a value with a comma (it is not sufficient to " "enclose a single value in parentheses). Ugly, but effective. For example::" msgstr "" +"Un problema particular es la construcción de tuplas que contengan 0 o 1 " +"ítem: la sintaxis presenta algunas peculiaridades para estos casos. Las " +"tuplas vacías se construyen mediante un par de paréntesis vacío; una tupla " +"con un ítem se construye poniendo una coma a continuación del valor (no " +"alcanza con encerrar un único valor entre paréntesis). Feo, pero efectivo." +" Por ejemplo::" #: ../Doc/tutorial/datastructures.rst:424 msgid "" @@ -382,19 +447,28 @@ msgid "" "packing*: the values ``12345``, ``54321`` and ``'hello!'`` are packed " "together in a tuple. The reverse operation is also possible::" msgstr "" +"La declaración ``t = 12345, 54321, 'hola!'`` es un ejemplo de *empaquetado " +"de tuplas*: los valores ``12345``, ``54321`` y ``'hola!'`` se empaquetan " +"juntos en una tupla. La operación inversa también es posible::" #: ../Doc/tutorial/datastructures.rst:430 msgid "" -"This is called, appropriately enough, *sequence unpacking* and works for any " -"sequence on the right-hand side. Sequence unpacking requires that there are " -"as many variables on the left side of the equals sign as there are elements " -"in the sequence. Note that multiple assignment is really just a combination " -"of tuple packing and sequence unpacking." +"This is called, appropriately enough, *sequence unpacking* and works for any" +" sequence on the right-hand side. Sequence unpacking requires that there " +"are as many variables on the left side of the equals sign as there are " +"elements in the sequence. Note that multiple assignment is really just a " +"combination of tuple packing and sequence unpacking." msgstr "" +"Esto se llama, apropiadamente, *desempaquetado de secuencias*, y funciona " +"para cualquier secuencia en el lado derecho del igual. El desempaquetado de" +" secuencias requiere que la cantidad de variables a la izquierda del signo " +"igual sea el tamaño de la secuencia. Notá que la asignación múltiple es en " +"realidad sólo una combinación de empaquetado de tuplas y desempaquetado de " +"secuencias." #: ../Doc/tutorial/datastructures.rst:440 msgid "Sets" -msgstr "" +msgstr "Conjuntos" #: ../Doc/tutorial/datastructures.rst:442 msgid "" @@ -404,6 +478,11 @@ msgid "" "mathematical operations like union, intersection, difference, and symmetric " "difference." msgstr "" +"Python también incluye un tipo de dato para *conjuntos*. Un conjunto es una" +" colección no ordenada y sin elementos repetidos. Los usos básicos de éstos" +" incluyen verificación de pertenencia y eliminación de entradas duplicadas. " +"Los conjuntos también soportan operaciones matemáticas como la unión, " +"intersección, diferencia, y diferencia simétrica." #: ../Doc/tutorial/datastructures.rst:447 msgid "" @@ -412,34 +491,51 @@ msgid "" "creates an empty dictionary, a data structure that we discuss in the next " "section." msgstr "" +"Las llaves o la función :func:`set` pueden usarse para crear conjuntos. Notá" +" que para crear un conjunto vacío tenés que usar ``set()``, no ``{}``; esto" +" último crea un diccionario vacío, una estructura de datos que discutiremos " +"en la sección siguiente." #: ../Doc/tutorial/datastructures.rst:451 msgid "Here is a brief demonstration::" -msgstr "" +msgstr "Una pequeña demostración::" #: ../Doc/tutorial/datastructures.rst:476 msgid "" "Similarly to :ref:`list comprehensions `, set comprehensions " "are also supported::" msgstr "" +"De forma similar a las :ref:`comprensiones de listas `, está" +" también soportada la comprensión de conjuntos::" #: ../Doc/tutorial/datastructures.rst:487 msgid "Dictionaries" -msgstr "" +msgstr "Diccionarios" #: ../Doc/tutorial/datastructures.rst:489 msgid "" -"Another useful data type built into Python is the *dictionary* (see :ref:" -"`typesmapping`). Dictionaries are sometimes found in other languages as " -"\"associative memories\" or \"associative arrays\". Unlike sequences, which " -"are indexed by a range of numbers, dictionaries are indexed by *keys*, which " -"can be any immutable type; strings and numbers can always be keys. Tuples " -"can be used as keys if they contain only strings, numbers, or tuples; if a " -"tuple contains any mutable object either directly or indirectly, it cannot " -"be used as a key. You can't use lists as keys, since lists can be modified " -"in place using index assignments, slice assignments, or methods like :meth:" -"`append` and :meth:`extend`." -msgstr "" +"Another useful data type built into Python is the *dictionary* (see " +":ref:`typesmapping`). Dictionaries are sometimes found in other languages as" +" \"associative memories\" or \"associative arrays\". Unlike sequences, " +"which are indexed by a range of numbers, dictionaries are indexed by *keys*," +" which can be any immutable type; strings and numbers can always be keys. " +"Tuples can be used as keys if they contain only strings, numbers, or tuples;" +" if a tuple contains any mutable object either directly or indirectly, it " +"cannot be used as a key. You can't use lists as keys, since lists can be " +"modified in place using index assignments, slice assignments, or methods " +"like :meth:`append` and :meth:`extend`." +msgstr "" +"Otro tipo de dato útil incluído en Python es el *diccionario* (ver " +":ref:`typesmapping`). Los diccionarios se encuentran a veces en otros " +"lenguajes como \"memorias asociativas\" o \"arreglos asociativos\". A " +"diferencia de las secuencias, que se indexan mediante un rango numérico, los" +" diccionarios se indexan con *claves*, que pueden ser cualquier tipo " +"inmutable; las cadenas y números siempre pueden ser claves. Las tuplas " +"pueden usarse como claves si solamente contienen cadenas, números o tuplas; " +"si una tupla contiene cualquier objeto mutable directa o indirectamente, no " +"puede usarse como clave. No podés usar listas como claves, ya que las listas" +" pueden modificarse usando asignación por índice, asignación por sección, o " +"métodos como :meth:`append` y :meth:`extend`." #: ../Doc/tutorial/datastructures.rst:500 msgid "" @@ -563,34 +659,54 @@ msgid "" "lowest, so that ``A and not B or C`` is equivalent to ``(A and (not B)) or " "C``. As always, parentheses can be used to express the desired composition." msgstr "" +"Las comparaciones pueden combinarse mediante los operadores booleanos " +"``and`` y ``or``, y el resultado de una comparación (o de cualquier otra " +"expresión booleana) puede negarse con ``not``. Estos tienen prioridades " +"menores que los operadores de comparación; entre ellos ``not`` tiene la " +"mayor prioridad y ``or`` la menor, o sea que ``A and not B or C`` equivale a" +" ``(A and (not B)) or C``. Como siempre, los paréntesis pueden usarse para " +"expresar la composición deseada." #: ../Doc/tutorial/datastructures.rst:656 msgid "" "The Boolean operators ``and`` and ``or`` are so-called *short-circuit* " "operators: their arguments are evaluated from left to right, and evaluation " -"stops as soon as the outcome is determined. For example, if ``A`` and ``C`` " -"are true but ``B`` is false, ``A and B and C`` does not evaluate the " +"stops as soon as the outcome is determined. For example, if ``A`` and ``C``" +" are true but ``B`` is false, ``A and B and C`` does not evaluate the " "expression ``C``. When used as a general value and not as a Boolean, the " "return value of a short-circuit operator is the last evaluated argument." msgstr "" +"Los operadores booleanos ``and`` y ``or`` son los llamados operadores " +"*cortocircuito*: sus argumentos se evalúan de izquierda a derecha, y la " +"evaluación se detiene en el momento en que se determina su resultado. Por " +"ejemplo, si ``A`` y ``C`` son verdaderas pero ``B`` es falsa, en ``A and B " +"and C`` no se evalúa la expresión ``C``. Cuando se usa como un valor " +"general y no como un booleano, el valor devuelto de un operador " +"cortocircuito es el último argumento evaluado." #: ../Doc/tutorial/datastructures.rst:663 msgid "" "It is possible to assign the result of a comparison or other Boolean " "expression to a variable. For example, ::" msgstr "" +"Es posible asignar el resultado de una comparación u otra expresión booleana" +" a una variable. Por ejemplo, ::" #: ../Doc/tutorial/datastructures.rst:671 msgid "" -"Note that in Python, unlike C, assignment cannot occur inside expressions. C " -"programmers may grumble about this, but it avoids a common class of problems " -"encountered in C programs: typing ``=`` in an expression when ``==`` was " -"intended." +"Note that in Python, unlike C, assignment cannot occur inside expressions. C" +" programmers may grumble about this, but it avoids a common class of " +"problems encountered in C programs: typing ``=`` in an expression when " +"``==`` was intended." msgstr "" +"Notá que en Python, a diferencia de C, la asignación no puede ocurrir dentro" +" de expresiones. Los programadores de C pueden renegar por esto, pero es " +"algo que evita un tipo de problema común encontrado en programas en C: " +"escribir ``=`` en una expresión cuando lo que se quiere escribir es ``==``." #: ../Doc/tutorial/datastructures.rst:680 msgid "Comparing Sequences and Other Types" -msgstr "" +msgstr "Comparando secuencias y otros tipos" #: ../Doc/tutorial/datastructures.rst:682 msgid "" From d7569d26a9f2981b36f9779aa4bca961e8c9ea4d Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 15:44:21 +0200 Subject: [PATCH 11/24] More translations --- tutorial/classes.po | 3 + tutorial/inputoutput.po | 118 ++++++++++++++++++++++++++++++---------- 2 files changed, 91 insertions(+), 30 deletions(-) diff --git a/tutorial/classes.po b/tutorial/classes.po index d7c5c3b275..3339e4288f 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -387,6 +387,9 @@ msgid "" "namespaces, and how :keyword:`global` and :keyword:`nonlocal` affect " "variable binding::" msgstr "" +"Este es un ejemplo que muestra como hacer referencia a distintos ámbitos y " +"espacios de nombres, y cómo las declaraciones :keyword:`global` y " +":keyword:`nonlocal` afectan la asignación de variables::" #: ../Doc/tutorial/classes.rst:191 msgid "The output of the example code is:" diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 17129af1ef..9ccd877677 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -18,7 +18,7 @@ msgstr "" #: ../Doc/tutorial/inputoutput.rst:5 msgid "Input and Output" -msgstr "" +msgstr "Entrada y salida" #: ../Doc/tutorial/inputoutput.rst:7 msgid "" @@ -26,18 +26,27 @@ msgid "" "printed in a human-readable form, or written to a file for future use. This " "chapter will discuss some of the possibilities." msgstr "" +"Hay diferentes métodos de presentar la salida de un programa; los datos " +"pueden ser impresos de una forma legible por humanos, o escritos a un " +"archivo para uso futuro. Este capítulo discutirá algunas de las " +"posibilidades." #: ../Doc/tutorial/inputoutput.rst:15 msgid "Fancier Output Formatting" -msgstr "" +msgstr "Formateo elegante de la salida" #: ../Doc/tutorial/inputoutput.rst:17 msgid "" -"So far we've encountered two ways of writing values: *expression statements* " -"and the :func:`print` function. (A third way is using the :meth:`write` " -"method of file objects; the standard output file can be referenced as ``sys." -"stdout``. See the Library Reference for more information on this.)" +"So far we've encountered two ways of writing values: *expression statements*" +" and the :func:`print` function. (A third way is using the :meth:`write` " +"method of file objects; the standard output file can be referenced as " +"``sys.stdout``. See the Library Reference for more information on this.)" msgstr "" +"Hasta ahora encontramos dos maneras de escribir valores: *declaraciones de " +"expresión* y la función :func:`print`. (Una tercer manera es usando el " +"método :meth:`write` de los objetos tipo archivo; el archivo de salida " +"estándar puede referenciarse como ``sys.stdout``. Mirá la Referencia de la " +"Biblioteca para más información sobre esto.)" #: ../Doc/tutorial/inputoutput.rst:22 msgid "" @@ -81,17 +90,26 @@ msgstr "" msgid "" "The :func:`str` function is meant to return representations of values which " "are fairly human-readable, while :func:`repr` is meant to generate " -"representations which can be read by the interpreter (or will force a :exc:" -"`SyntaxError` if there is no equivalent syntax). For objects which don't " -"have a particular representation for human consumption, :func:`str` will " -"return the same value as :func:`repr`. Many values, such as numbers or " -"structures like lists and dictionaries, have the same representation using " +"representations which can be read by the interpreter (or will force a " +":exc:`SyntaxError` if there is no equivalent syntax). For objects which " +"don't have a particular representation for human consumption, :func:`str` " +"will return the same value as :func:`repr`. Many values, such as numbers or" +" structures like lists and dictionaries, have the same representation using " "either function. Strings, in particular, have two distinct representations." msgstr "" +"La función :func:`str` devuelve representaciones de los valores que son " +"bastante legibles por humanos, mientras que :func:`repr` genera " +"representaciones que pueden ser leídas por el el intérprete (o forzarían un " +":exc:`SyntaxError` si no hay sintáxis equivalente). Para objetos que no " +"tienen una representación en particular para consumo humano, :func:`str` " +"devolverá el mismo valor que :func:`repr`. Muchos valores, como números o " +"estructuras como listas y diccionarios, tienen la misma representación " +"usando cualquiera de las dos funciones. Las cadenas, en particular, tienen " +"dos representaciones distintas." #: ../Doc/tutorial/inputoutput.rst:68 msgid "Some examples::" -msgstr "" +msgstr "Algunos ejemplos::" #: ../Doc/tutorial/inputoutput.rst:91 msgid "" @@ -145,25 +163,32 @@ msgstr "" #: ../Doc/tutorial/inputoutput.rst:144 msgid "Basic usage of the :meth:`str.format` method looks like this::" -msgstr "" +msgstr "El uso básico del método :meth:`str.format` es como esto::" #: ../Doc/tutorial/inputoutput.rst:149 msgid "" "The brackets and characters within them (called format fields) are replaced " -"with the objects passed into the :meth:`str.format` method. A number in the " -"brackets can be used to refer to the position of the object passed into the :" -"meth:`str.format` method. ::" +"with the objects passed into the :meth:`str.format` method. A number in the" +" brackets can be used to refer to the position of the object passed into the" +" :meth:`str.format` method. ::" msgstr "" +"Las llaves y caracteres dentro de las mismas (llamados campos de formato) " +"son reemplazadas con los objetos pasados en el método :meth:`str.format`. " +"Un número en las llaves se refiere a la posición del objeto pasado en el " +"método. ::" #: ../Doc/tutorial/inputoutput.rst:159 msgid "" -"If keyword arguments are used in the :meth:`str.format` method, their values " -"are referred to by using the name of the argument. ::" +"If keyword arguments are used in the :meth:`str.format` method, their values" +" are referred to by using the name of the argument. ::" msgstr "" +"Si se usan argumentos nombrados en el método :meth:`str.format`, sus valores" +" serán referidos usando el nombre del argumento. ::" #: ../Doc/tutorial/inputoutput.rst:166 msgid "Positional and keyword arguments can be arbitrarily combined::" msgstr "" +"Se pueden combinar arbitrariamente argumentos posicionales y nombrados::" #: ../Doc/tutorial/inputoutput.rst:172 msgid "" @@ -172,18 +197,28 @@ msgid "" "instead of by position. This can be done by simply passing the dict and " "using square brackets ``'[]'`` to access the keys ::" msgstr "" +"Si tenés una cadena de formateo realmente larga que no querés separar, " +"podría ser bueno que puedas hacer referencia a las variables a ser " +"formateadas por el nombre en vez de la posición. Esto puede hacerse " +"simplemente pasando el diccionario y usando corchetes ``'[]'`` para acceder " +"a las claves ::" #: ../Doc/tutorial/inputoutput.rst:182 msgid "" "This could also be done by passing the table as keyword arguments with the " "'**' notation. ::" msgstr "" +"Esto se podría también hacer pasando la tabla como argumentos nombrados con " +"la notación '**'. ::" #: ../Doc/tutorial/inputoutput.rst:189 msgid "" -"This is particularly useful in combination with the built-in function :func:" -"`vars`, which returns a dictionary containing all local variables." +"This is particularly useful in combination with the built-in function " +":func:`vars`, which returns a dictionary containing all local variables." msgstr "" +"Esto es particularmente útil en combinación con la función integrada " +":func:`vars`, que devuelve un diccionario conteniendo todas las variables " +"locales." #: ../Doc/tutorial/inputoutput.rst:192 msgid "" @@ -193,9 +228,11 @@ msgstr "" #: ../Doc/tutorial/inputoutput.rst:209 msgid "" -"For a complete overview of string formatting with :meth:`str.format`, see :" -"ref:`formatstrings`." +"For a complete overview of string formatting with :meth:`str.format`, see " +":ref:`formatstrings`." msgstr "" +"Para una completa descripción del formateo de cadenas con " +":meth:`str.format`, mirá en :ref:`string-formatting`." #: ../Doc/tutorial/inputoutput.rst:214 msgid "Manual String Formatting" @@ -228,38 +265,47 @@ msgid "" "There is another method, :meth:`str.zfill`, which pads a numeric string on " "the left with zeros. It understands about plus and minus signs::" msgstr "" +"Hay otro método, :meth:`str.zfill`, el cual rellena una cadena numérica a la" +" izquierda con ceros. Entiende signos positivos y negativos::" #: ../Doc/tutorial/inputoutput.rst:258 msgid "Old string formatting" -msgstr "" +msgstr "Viejo formateo de cadenas" #: ../Doc/tutorial/inputoutput.rst:260 msgid "" -"The ``%`` operator can also be used for string formatting. It interprets the " -"left argument much like a :c:func:`sprintf`\\ -style format string to be " +"The ``%`` operator can also be used for string formatting. It interprets the" +" left argument much like a :c:func:`sprintf`\\ -style format string to be " "applied to the right argument, and returns the string resulting from this " "formatting operation. For example::" msgstr "" +"El operador ``%`` también puede usarse para formateo de cadenas. Interpreta" +" el argumento de la izquierda con el estilo de formateo de :c:func:`sprintf`" +" para ser aplicado al argumento de la derecha, y devuelve la cadena " +"resultante de esta operación de formateo. Por ejemplo::" #: ../Doc/tutorial/inputoutput.rst:269 msgid "" "More information can be found in the :ref:`old-string-formatting` section." msgstr "" +"Podés encontrar más información en la sección :ref:`old-string-formatting`." #: ../Doc/tutorial/inputoutput.rst:275 msgid "Reading and Writing Files" -msgstr "" +msgstr "Leyendo y escribiendo archivos" #: ../Doc/tutorial/inputoutput.rst:281 msgid "" ":func:`open` returns a :term:`file object`, and is most commonly used with " "two arguments: ``open(filename, mode)``." msgstr "" +"La función :func:`open` devuelve un `objeto archivo`, y se usa normalmente " +"con dos argumentos: ``open(nombre_de_archivo, modo)``. ::" #: ../Doc/tutorial/inputoutput.rst:293 msgid "" -"The first argument is a string containing the filename. The second argument " -"is another string containing a few characters describing the way in which " +"The first argument is a string containing the filename. The second argument" +" is another string containing a few characters describing the way in which " "the file will be used. *mode* can be ``'r'`` when the file will only be " "read, ``'w'`` for only writing (an existing file with the same name will be " "erased), and ``'a'`` opens the file for appending; any data written to the " @@ -267,16 +313,28 @@ msgid "" "reading and writing. The *mode* argument is optional; ``'r'`` will be " "assumed if it's omitted." msgstr "" +"Cuando se lee en modo texto, por defecto se convierten los fines de lineas " +"que son específicos a las plataformas (``\\n`` en Unix, ``\\r\\n`` en " +"Windows) a solamente ``\\n``. Cuando se escribe en modo texto, por defecto " +"se convierten los ``\\n`` a los finales de linea específicos de la " +"plataforma. Este cambio automático está bien para archivos de texto, pero " +"corrompería datos binarios como los de archivos :file:`JPEG` o :file:`EXE`." +" Asegurate de usar modo binario cuando leas y escribas tales archivos." #: ../Doc/tutorial/inputoutput.rst:302 msgid "" "Normally, files are opened in :dfn:`text mode`, that means, you read and " "write strings from and to the file, which are encoded in a specific " "encoding. If encoding is not specified, the default is platform dependent " -"(see :func:`open`). ``'b'`` appended to the mode opens the file in :dfn:" -"`binary mode`: now the data is read and written in the form of bytes " +"(see :func:`open`). ``'b'`` appended to the mode opens the file in " +":dfn:`binary mode`: now the data is read and written in the form of bytes " "objects. This mode should be used for all files that don't contain text." msgstr "" +"Es una buena práctica usar la declaración :keyword:`with` cuando manejamos " +"objetos archivo. Tiene la ventaja que el archivo es cerrado apropiadamente " +"luego de que el bloque termina, incluso si se generó una excepción. También" +" es mucho más corto que escribir los equivalentes bloques :keyword:`try`\\ " +"-\\ :keyword:`finally` ::" #: ../Doc/tutorial/inputoutput.rst:309 msgid "" From 72b4d3d3414e7e032b6a6476e049f81dc45a8e55 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 15:52:39 +0200 Subject: [PATCH 12/24] More inputoutput --- tutorial/inputoutput.po | 169 +++++++++++++++++++++++++++++++--------- 1 file changed, 133 insertions(+), 36 deletions(-) diff --git a/tutorial/inputoutput.po b/tutorial/inputoutput.po index 9ccd877677..90d6ec1f26 100644 --- a/tutorial/inputoutput.po +++ b/tutorial/inputoutput.po @@ -342,29 +342,48 @@ msgid "" "endings (``\\n`` on Unix, ``\\r\\n`` on Windows) to just ``\\n``. When " "writing in text mode, the default is to convert occurrences of ``\\n`` back " "to platform-specific line endings. This behind-the-scenes modification to " -"file data is fine for text files, but will corrupt binary data like that in :" -"file:`JPEG` or :file:`EXE` files. Be very careful to use binary mode when " +"file data is fine for text files, but will corrupt binary data like that in " +":file:`JPEG` or :file:`EXE` files. Be very careful to use binary mode when " "reading and writing such files." msgstr "" +"Cuando se lee en modo texto, por defecto se convierten los fines de lineas " +"que son específicos a las plataformas (``\\n`` en Unix, ``\\r\\n`` en " +"Windows) a solamente ``\\n``. Cuando se escribe en modo texto, por defecto " +"se convierten los ``\\n`` a los finales de linea específicos de la " +"plataforma. Este cambio automático está bien para archivos de texto, pero " +"corrompería datos binarios como los de archivos :file:`JPEG` o :file:`EXE`." +" Asegurate de usar modo binario cuando leas y escribas tales archivos." #: ../Doc/tutorial/inputoutput.rst:317 msgid "" "It is good practice to use the :keyword:`with` keyword when dealing with " "file objects. The advantage is that the file is properly closed after its " -"suite finishes, even if an exception is raised at some point. Using :" -"keyword:`!with` is also much shorter than writing equivalent :keyword:`try`" -"\\ -\\ :keyword:`finally` blocks::" +"suite finishes, even if an exception is raised at some point. Using " +":keyword:`!with` is also much shorter than writing equivalent " +":keyword:`try`\\ -\\ :keyword:`finally` blocks::" msgstr "" +"Es una buena práctica usar la declaración :keyword:`with` cuando manejamos " +"objetos archivo. Tiene la ventaja que el archivo es cerrado apropiadamente " +"luego de que el bloque termina, incluso si se generó una excepción. También" +" es mucho más corto que escribir los equivalentes bloques :keyword:`try`\\ " +"-\\ :keyword:`finally` ::" #: ../Doc/tutorial/inputoutput.rst:328 msgid "" -"If you're not using the :keyword:`with` keyword, then you should call ``f." -"close()`` to close the file and immediately free up any system resources " -"used by it. If you don't explicitly close a file, Python's garbage collector " -"will eventually destroy the object and close the open file for you, but the " -"file may stay open for a while. Another risk is that different Python " -"implementations will do this clean-up at different times." -msgstr "" +"If you're not using the :keyword:`with` keyword, then you should call " +"``f.close()`` to close the file and immediately free up any system resources" +" used by it. If you don't explicitly close a file, Python's garbage " +"collector will eventually destroy the object and close the open file for " +"you, but the file may stay open for a while. Another risk is that different" +" Python implementations will do this clean-up at different times." +msgstr "" +"Si no estuvieses usando el bloque :keyword:`with`, entonces deberías llamar " +"``f.close()`` para cerrar el archivo e inmediatamente liberar cualquier " +"recurso del sistema usado por este. Si no cierras explícitamente el archivo," +" el «garbage collector» de Python eventualmente destruirá el objeto y " +"cerrará el archivo por vos, pero el archivo puede estar abierto por un " +"tiempo. Otro riesgo es que diferentes implementaciones de Python harán esta " +"limpieza en diferentes momentos." #: ../Doc/tutorial/inputoutput.rst:336 msgid "" @@ -372,68 +391,101 @@ msgid "" "calling ``f.close()``, attempts to use the file object will automatically " "fail. ::" msgstr "" +"Después de que un objeto de archivo es cerrado, ya sea por :keyword:`with` o" +" llamando a ``f.close()``, intentar volver a utilizarlo fallará " +"automáticamente::" #: ../Doc/tutorial/inputoutput.rst:350 msgid "Methods of File Objects" -msgstr "" +msgstr "Métodos de los objetos Archivo" #: ../Doc/tutorial/inputoutput.rst:352 msgid "" "The rest of the examples in this section will assume that a file object " "called ``f`` has already been created." msgstr "" +"El resto de los ejemplos en esta sección asumirán que ya se creó un objeto " +"archivo llamado ``f``." #: ../Doc/tutorial/inputoutput.rst:355 msgid "" "To read a file's contents, call ``f.read(size)``, which reads some quantity " -"of data and returns it as a string (in text mode) or bytes object (in binary " -"mode). *size* is an optional numeric argument. When *size* is omitted or " +"of data and returns it as a string (in text mode) or bytes object (in binary" +" mode). *size* is an optional numeric argument. When *size* is omitted or " "negative, the entire contents of the file will be read and returned; it's " "your problem if the file is twice as large as your machine's memory. " "Otherwise, at most *size* bytes are read and returned. If the end of the " -"file has been reached, ``f.read()`` will return an empty string (``''``). ::" -msgstr "" +"file has been reached, ``f.read()`` will return an empty string (``''``). " +"::" +msgstr "" +"Para leer el contenido de una archivo llamá a ``f.read(cantidad)``, el cual " +"lee alguna cantidad de datos y los devuelve como una cadena de (en modo " +"texto) o un objeto de bytes (en modo binario). *cantidad* es un argumento " +"numérico opcional. Cuando se omite *cantidad* o es negativo, el contenido " +"entero del archivo será leido y devuelto; es tu problema si el archivo es el" +" doble de grande que la memoria de tu máquina. De otra manera, a lo sumo " +"una *cantidad* de bytes son leídos y devueltos. Si se alcanzó el fin del " +"archivo, ``f.read()`` devolverá una cadena vacía (``\"\"``). ::" #: ../Doc/tutorial/inputoutput.rst:369 msgid "" -"``f.readline()`` reads a single line from the file; a newline character (``" -"\\n``) is left at the end of the string, and is only omitted on the last " +"``f.readline()`` reads a single line from the file; a newline character " +"(``\\n``) is left at the end of the string, and is only omitted on the last " "line of the file if the file doesn't end in a newline. This makes the " "return value unambiguous; if ``f.readline()`` returns an empty string, the " "end of the file has been reached, while a blank line is represented by " "``'\\n'``, a string containing only a single newline. ::" msgstr "" +"``f.readline()`` lee una sola linea del archivo; el caracter de fin de linea" +" (``\\n``) se deja al final de la cadena, y sólo se omite en la última linea" +" del archivo si el mismo no termina en un fin de linea. Esto hace que el " +"valor de retorno no sea ambiguo; si ``f.readline()`` devuelve una cadena " +"vacía, es que se alcanzó el fin del archivo, mientras que una linea en " +"blanco es representada por ``'\\n'``, una cadena conteniendo sólo un único " +"fin de linea. ::" #: ../Doc/tutorial/inputoutput.rst:383 msgid "" "For reading lines from a file, you can loop over the file object. This is " "memory efficient, fast, and leads to simple code::" msgstr "" +"Para leer líneas de un archivo, podés iterar sobre el objeto archivo. Esto " +"es eficiente en memoria, rápido, y conduce a un código más simple::" #: ../Doc/tutorial/inputoutput.rst:392 msgid "" "If you want to read all the lines of a file in a list you can also use " "``list(f)`` or ``f.readlines()``." msgstr "" +"Si querés leer todas las líneas de un archivo en una lista también podés " +"usar ``list(f)`` o ``f.readlines()``." #: ../Doc/tutorial/inputoutput.rst:395 msgid "" "``f.write(string)`` writes the contents of *string* to the file, returning " "the number of characters written. ::" msgstr "" +"``f.write(cadena)`` escribe el contenido de la *cadena* al archivo, " +"devolviendo la cantidad de caracteres escritos. ::" #: ../Doc/tutorial/inputoutput.rst:401 msgid "" "Other types of objects need to be converted -- either to a string (in text " "mode) or a bytes object (in binary mode) -- before writing them::" msgstr "" +"Otros tipos de objetos necesitan serconvertidos -- tanto a una cadena (en " +"modo texto) o a un objeto de bytes (en modo binario) -- antes de " +"escribirlos::" #: ../Doc/tutorial/inputoutput.rst:409 msgid "" -"``f.tell()`` returns an integer giving the file object's current position in " -"the file represented as number of bytes from the beginning of the file when " -"in binary mode and an opaque number when in text mode." +"``f.tell()`` returns an integer giving the file object's current position in" +" the file represented as number of bytes from the beginning of the file when" +" in binary mode and an opaque number when in text mode." msgstr "" +"``f.tell()`` devuelve un entero que indica la posición actual en el archivo " +"representada como número de bytes desde el comienzo del archivo en modo " +"binario y un número opaco en modo texto." #: ../Doc/tutorial/inputoutput.rst:413 msgid "" @@ -445,26 +497,42 @@ msgid "" "*from_what* can be omitted and defaults to 0, using the beginning of the " "file as the reference point. ::" msgstr "" +"Para cambiar la posición del objeto archivo, usá ``f.seek(desplazamiento, " +"desde_donde)``. La posición es calculada agregando el *desplazamiento* a un" +" punto de referencia; el punto de referencia se selecciona del argumento " +"*desde_donde*. Un valor *desde_donde* de 0 mide desde el comienzo del " +"archivo, 1 usa la posición actual del archivo, y 2 usa el fin del archivo " +"como punto de referencia. *desde_donde* puede omitirse, el default es 0, " +"usando el comienzo del archivo como punto de referencia. ::" #: ../Doc/tutorial/inputoutput.rst:432 msgid "" "In text files (those opened without a ``b`` in the mode string), only seeks " "relative to the beginning of the file are allowed (the exception being " "seeking to the very file end with ``seek(0, 2)``) and the only valid " -"*offset* values are those returned from the ``f.tell()``, or zero. Any other " -"*offset* value produces undefined behaviour." +"*offset* values are those returned from the ``f.tell()``, or zero. Any other" +" *offset* value produces undefined behaviour." msgstr "" +"En los archivos de texto (aquellos que se abrieron sin una ``b`` en el " +"modo), se permiten solamente desplazamientos con ``seek`` relativos al " +"comienzo (con la excepción de ir justo al final con ``seek(0, 2)``) y los " +"únicos valores de *desplazamiento* válidos son aquellos retornados por " +"``f.tell()``, o cero. Cualquier otro valor de *desplazamiento* produce un " +"comportamiento indefinido." #: ../Doc/tutorial/inputoutput.rst:438 msgid "" -"File objects have some additional methods, such as :meth:`~file.isatty` and :" -"meth:`~file.truncate` which are less frequently used; consult the Library " +"File objects have some additional methods, such as :meth:`~file.isatty` and " +":meth:`~file.truncate` which are less frequently used; consult the Library " "Reference for a complete guide to file objects." msgstr "" +"Los objetos archivo tienen algunos métodos más, como :meth:`isatty` y " +":meth:`truncate` que son usados menos frecuentemente; consultá la Referencia" +" de la Biblioteca para una guía completa sobre los objetos archivo." #: ../Doc/tutorial/inputoutput.rst:446 msgid "Saving structured data with :mod:`json`" -msgstr "" +msgstr "Guardar datos estructurados con :mod:`json`" #: ../Doc/tutorial/inputoutput.rst:450 msgid "" @@ -475,19 +543,36 @@ msgid "" "complex data types like nested lists and dictionaries, parsing and " "serializing by hand becomes complicated." msgstr "" +"Las cadenas pueden facilmente escribirse y leerse de un archivo. Los " +"números toman algo más de esfuerzo, ya que el método :meth:`read` sólo " +"devuelve cadenas, que tendrán que ser pasadas a una función como " +":func:`int`, que toma una cadena como ``'123'`` y devuelve su valor numérico" +" 123. Sin embargo, cuando querés grabar tipos de datos más complejos como " +"listas, diccionarios, o instancias de clases, las cosas se ponen más " +"complicadas." #: ../Doc/tutorial/inputoutput.rst:457 msgid "" "Rather than having users constantly writing and debugging code to save " "complicated data types to files, Python allows you to use the popular data " -"interchange format called `JSON (JavaScript Object Notation) `_. The standard module called :mod:`json` can take Python data " -"hierarchies, and convert them to string representations; this process is " -"called :dfn:`serializing`. Reconstructing the data from the string " +"interchange format called `JSON (JavaScript Object Notation) " +"`_. The standard module called :mod:`json` can take Python" +" data hierarchies, and convert them to string representations; this process " +"is called :dfn:`serializing`. Reconstructing the data from the string " "representation is called :dfn:`deserializing`. Between serializing and " "deserializing, the string representing the object may have been stored in a " "file or data, or sent over a network connection to some distant machine." msgstr "" +"En lugar de tener a los usuarios constantemente escribiendo y debugueando " +"código para grabar tipos de datos complicados, Python te permite usar " +"formato intercambiable de datos popular llamado `JSON (JavaScript Object " +"Notation) `_. El módulo estandar llamado :mod:`json` puede " +"tomar datos de Python con una jerarquía, y convertirlo a representaciones de" +" cadena de caracteres; este proceso es llamado :dfn:`serializing`. " +"Reconstruir los datos desde la representación de cadena de caracteres es " +"llamado :dfn:`deserializing`. Entre serialización y deserialización, la " +"cadena de caracteres representando el objeto quizás haya sido guardado en un" +" archivo o datos, o enviado a una máquina distante por una conexión de red." #: ../Doc/tutorial/inputoutput.rst:468 msgid "" @@ -501,19 +586,27 @@ msgid "" "If you have an object ``x``, you can view its JSON string representation " "with a simple line of code::" msgstr "" +"Si tienes un objeto ``x``, puedes ver su representación JSON con una simple " +"línea de código::" #: ../Doc/tutorial/inputoutput.rst:479 msgid "" -"Another variant of the :func:`~json.dumps` function, called :func:`~json." -"dump`, simply serializes the object to a :term:`text file`. So if ``f`` is " -"a :term:`text file` object opened for writing, we can do this::" +"Another variant of the :func:`~json.dumps` function, called " +":func:`~json.dump`, simply serializes the object to a :term:`text file`. So" +" if ``f`` is a :term:`text file` object opened for writing, we can do this::" msgstr "" +"Otra variante de la función :func:`~json.dumps`, llamada :func:`~json.dump`," +" simplemente serializa el objeto a un :term:`archivo de texto`. Así que, si " +"``f`` es un objeto :term:`archivo de texto` abierto para escritura, podemos " +"hacer::" #: ../Doc/tutorial/inputoutput.rst:485 msgid "" -"To decode the object again, if ``f`` is a :term:`text file` object which has " -"been opened for reading::" +"To decode the object again, if ``f`` is a :term:`text file` object which has" +" been opened for reading::" msgstr "" +"Para decodificar un objeto nuevamente, si ``f`` es un objeto :term:`archivo " +"de texto` que fue abierto para lectura::" #: ../Doc/tutorial/inputoutput.rst:490 msgid "" @@ -522,6 +615,10 @@ msgid "" "effort. The reference for the :mod:`json` module contains an explanation of " "this." msgstr "" +"La simple técnica de serialización puede manejar listas y diccionarios, pero" +" serializar instancias de clases arbitrarias en JSON requiere un poco de " +"esfuerzo extra. La referencia del módulo :mod:`json` contiene una " +"explicación de esto." #: ../Doc/tutorial/inputoutput.rst:496 msgid ":mod:`pickle` - the pickle module" From cf3a545a14cb1b73655b5392935faef35f7f7153 Mon Sep 17 00:00:00 2001 From: gilgamezh Date: Sat, 2 May 2020 16:02:45 +0200 Subject: [PATCH 13/24] update datastructures.po translation (migration) --- tutorial/datastructures.po | 49 +++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 6 deletions(-) diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index 1c9bc4b07f..90a8f6fed5 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -565,75 +565,96 @@ msgstr "" #: ../Doc/tutorial/datastructures.rst:517 msgid "Here is a small example using a dictionary::" -msgstr "" +msgstr "Un pequeño ejemplo de uso de un diccionario::" #: ../Doc/tutorial/datastructures.rst:538 msgid "" "The :func:`dict` constructor builds dictionaries directly from sequences of " "key-value pairs::" msgstr "" +"El constructor :func:`dict` crea un diccionario directamente desde " +"secuencias de pares clave-valor::" #: ../Doc/tutorial/datastructures.rst:544 msgid "" "In addition, dict comprehensions can be used to create dictionaries from " "arbitrary key and value expressions::" msgstr "" +"Además, las comprensiones de diccionarios se pueden usar para crear " +"diccionarios desde expresiones arbitrarias de clave y valor::" #: ../Doc/tutorial/datastructures.rst:550 msgid "" "When the keys are simple strings, it is sometimes easier to specify pairs " "using keyword arguments::" msgstr "" +"Cuando las claves son cadenas simples, a veces resulta más fácil especificar" +" los pares usando argumentos por palabra clave::" #: ../Doc/tutorial/datastructures.rst:560 msgid "Looping Techniques" -msgstr "" +msgstr "Técnicas de iteración" #: ../Doc/tutorial/datastructures.rst:562 msgid "" "When looping through dictionaries, the key and corresponding value can be " "retrieved at the same time using the :meth:`items` method. ::" msgstr "" +"Cuando iteramos sobre diccionarios, se pueden obtener al mismo tiempo la " +"clave y su valor correspondiente usando el método :meth:`items`. ::" #: ../Doc/tutorial/datastructures.rst:572 msgid "" "When looping through a sequence, the position index and corresponding value " "can be retrieved at the same time using the :func:`enumerate` function. ::" msgstr "" +"Cuando se itera sobre una secuencia, se puede obtener el índice de posición " +"junto a su valor correspondiente usando la función :func:`enumerate`. ::" #: ../Doc/tutorial/datastructures.rst:582 msgid "" "To loop over two or more sequences at the same time, the entries can be " "paired with the :func:`zip` function. ::" msgstr "" +"Para iterar sobre dos o más secuencias al mismo tiempo, los valores pueden " +"emparejarse con la función :func:`zip`. ::" #: ../Doc/tutorial/datastructures.rst:594 msgid "" "To loop over a sequence in reverse, first specify the sequence in a forward " "direction and then call the :func:`reversed` function. ::" msgstr "" +"Para iterar sobre una secuencia en orden inverso, se especifica primero la " +"secuencia al derecho y luego se llama a la función :func:`reversed`. ::" #: ../Doc/tutorial/datastructures.rst:606 msgid "" "To loop over a sequence in sorted order, use the :func:`sorted` function " "which returns a new sorted list while leaving the source unaltered. ::" msgstr "" +"Para iterar sobre una secuencia ordenada, se utiliza la función " +":func:`sorted` la cual devuelve una nueva lista ordenada dejando a la " +"original intacta. ::" #: ../Doc/tutorial/datastructures.rst:618 msgid "" "It is sometimes tempting to change a list while you are looping over it; " "however, it is often simpler and safer to create a new list instead. ::" msgstr "" +"A veces uno intenta cambiar una lista mientras la está iterando; sin " +"embargo, a menudo es más simple y seguro crear una nueva lista::" #: ../Doc/tutorial/datastructures.rst:635 msgid "More on Conditions" -msgstr "" +msgstr "Más acerca de condiciones" #: ../Doc/tutorial/datastructures.rst:637 msgid "" "The conditions used in ``while`` and ``if`` statements can contain any " "operators, not just comparisons." msgstr "" +"Las condiciones usadas en las instrucciones ``while`` e ``if`` pueden " +"contener cualquier operador, no sólo comparaciones." #: ../Doc/tutorial/datastructures.rst:640 msgid "" @@ -643,12 +664,20 @@ msgid "" "mutable objects like lists. All comparison operators have the same " "priority, which is lower than that of all numerical operators." msgstr "" +"Los operadores de comparación ``in`` y ``not in`` verifican si un valor está" +" (o no está) en una secuencia. Los operadores ``is`` e ``is not`` comparan " +"si dos objetos son realmente el mismo objeto; esto es significativo sólo " +"para objetos mutables como las listas. Todos los operadores de comparación " +"tienen la misma prioridad, la cual es menor que la de todos los operadores " +"numéricos." #: ../Doc/tutorial/datastructures.rst:646 msgid "" "Comparisons can be chained. For example, ``a < b == c`` tests whether ``a`` " "is less than ``b`` and moreover ``b`` equals ``c``." msgstr "" +"Las comparaciones pueden encadenarse. Por ejemplo, ``a < b == c`` verifica " +"si ``a`` es menor que ``b`` y además si ``b`` es igual a ``c``." #: ../Doc/tutorial/datastructures.rst:649 msgid "" @@ -720,9 +749,17 @@ msgid "" "sequences are considered equal. If one sequence is an initial sub-sequence " "of the other, the shorter sequence is the smaller (lesser) one. " "Lexicographical ordering for strings uses the Unicode code point number to " -"order individual characters. Some examples of comparisons between sequences " -"of the same type::" -msgstr "" +"order individual characters. Some examples of comparisons between sequences" +" of the same type::" +msgstr "" +"Las secuencias pueden compararse con otros objetos del mismo tipo de " +"secuencia. La comparación usa orden *lexicográfico*: primero se comparan los" +" dos primeros ítems, si son diferentes esto ya determina el resultado de la " +"comparación; si son iguales, se comparan los siguientes dos ítems, y así " +"sucesivamente hasta llegar al final de alguna de las secuencias. Si dos " +"ítems a comparar son ambos secuencias del mismo tipo, la comparación " +"lexicográfica es recursiva. Si todos los ítems de dos secuencias resultan " +"iguales, se considera que las secuencias son iguales." #: ../Doc/tutorial/datastructures.rst:702 msgid "" From 08e56cc3431a87fd617f58c43f204fc8a27da2db Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 16:03:19 +0200 Subject: [PATCH 14/24] Update tutorialpyar submodule --- .migration/tutorialpyar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.migration/tutorialpyar b/.migration/tutorialpyar index ad66506ae6..f9fbb76893 160000 --- a/.migration/tutorialpyar +++ b/.migration/tutorialpyar @@ -1 +1 @@ -Subproject commit ad66506ae678c5fadc138dae1dda71d6a21d9c95 +Subproject commit f9fbb768937506e977356772170a737949899a01 From 2b391044dac57e94fc145e498682ea3365d2b1d4 Mon Sep 17 00:00:00 2001 From: gilgamezh Date: Sat, 2 May 2020 16:09:36 +0200 Subject: [PATCH 15/24] update datastructures.po translation (migration) --- tutorial/datastructures.po | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index 90a8f6fed5..edac914e2b 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -549,11 +549,16 @@ msgstr "" #: ../Doc/tutorial/datastructures.rst:506 msgid "" "The main operations on a dictionary are storing a value with some key and " -"extracting the value given the key. It is also possible to delete a key:" -"value pair with ``del``. If you store using a key that is already in use, " -"the old value associated with that key is forgotten. It is an error to " -"extract a value using a non-existent key." -msgstr "" +"extracting the value given the key. It is also possible to delete a " +"key:value pair with ``del``. If you store using a key that is already in " +"use, the old value associated with that key is forgotten. It is an error to" +" extract a value using a non-existent key." +msgstr "" +"Las operaciones principales sobre un diccionario son guardar un valor con " +"una clave y extraer ese valor dada la clave. También es posible borrar un " +"par clave:valor con ``del``. Si usás una clave que ya está en uso para " +"guardar un valor, el valor que estaba asociado con esa clave se pierde. Es " +"un error extraer un valor usando una clave no existente." #: ../Doc/tutorial/datastructures.rst:512 msgid "" From 7e9682c40a633010c42b07d95e762fa4f3be6b4d Mon Sep 17 00:00:00 2001 From: gilgamezh Date: Sat, 2 May 2020 16:20:24 +0200 Subject: [PATCH 16/24] update datastructures.po translation (migration) --- tutorial/datastructures.po | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tutorial/datastructures.po b/tutorial/datastructures.po index edac914e2b..4d46be51fd 100644 --- a/tutorial/datastructures.po +++ b/tutorial/datastructures.po @@ -769,11 +769,17 @@ msgstr "" #: ../Doc/tutorial/datastructures.rst:702 msgid "" "Note that comparing objects of different types with ``<`` or ``>`` is legal " -"provided that the objects have appropriate comparison methods. For example, " -"mixed numeric types are compared according to their numeric value, so 0 " +"provided that the objects have appropriate comparison methods. For example," +" mixed numeric types are compared according to their numeric value, so 0 " "equals 0.0, etc. Otherwise, rather than providing an arbitrary ordering, " "the interpreter will raise a :exc:`TypeError` exception." msgstr "" +"Observá que comparar objetos de diferentes tipos con ``<`` o ``>`` es legal " +"siempre y cuando los objetas tenga los métodos de comparación apropiados. " +"Por ejemplo, los tipos de números mezclados son comparados de acuerdo a su " +"valor numérico, o sea 0 es igual a 0.0, etc. Si no es el caso, en lugar de " +"proveer un ordenamiento arbitrario, el intérprete generará una excepción " +":exc:`TypeError`." #: ../Doc/tutorial/datastructures.rst:710 msgid "Footnotes" From bfc7aec1f369fdcf2a1e44654c208cc9aadefe56 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 16:32:22 +0200 Subject: [PATCH 17/24] Classes --- tutorial/classes.po | 584 +++++++++++++++++++++++++++++++++----------- 1 file changed, 440 insertions(+), 144 deletions(-) diff --git a/tutorial/classes.po b/tutorial/classes.po index 3339e4288f..bdc8b879f3 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -393,39 +393,47 @@ msgstr "" #: ../Doc/tutorial/classes.rst:191 msgid "The output of the example code is:" -msgstr "" +msgstr "El resultado del código ejemplo es:" #: ../Doc/tutorial/classes.rst:200 msgid "" -"Note how the *local* assignment (which is default) didn't change *scope_test*" -"\\'s binding of *spam*. The :keyword:`nonlocal` assignment changed " -"*scope_test*\\'s binding of *spam*, and the :keyword:`global` assignment " -"changed the module-level binding." +"Note how the *local* assignment (which is default) didn't change " +"*scope_test*\\'s binding of *spam*. The :keyword:`nonlocal` assignment " +"changed *scope_test*\\'s binding of *spam*, and the :keyword:`global` " +"assignment changed the module-level binding." msgstr "" +"Notá como la asignación *local* (que es el comportamiento normal) no cambió " +"la vinculación de *algo* de *prueba_ambitos*. La asignación " +":keyword:`nonlocal` cambió la vinculación de *algo* de *prueba_ambitos*, y " +"la asignación :keyword:`global` cambió la vinculación a nivel de módulo." #: ../Doc/tutorial/classes.rst:205 msgid "" -"You can also see that there was no previous binding for *spam* before the :" -"keyword:`global` assignment." +"You can also see that there was no previous binding for *spam* before the " +":keyword:`global` assignment." msgstr "" +"También podés ver que no había vinculación para *algo* antes de la " +"asignación :keyword:`global`." #: ../Doc/tutorial/classes.rst:212 msgid "A First Look at Classes" -msgstr "" +msgstr "Un primer vistazo a las clases" #: ../Doc/tutorial/classes.rst:214 msgid "" "Classes introduce a little bit of new syntax, three new object types, and " "some new semantics." msgstr "" +"Las clases introducen un poquito de sintaxis nueva, tres nuevos tipos de " +"objetos y algo de semántica nueva." #: ../Doc/tutorial/classes.rst:221 msgid "Class Definition Syntax" -msgstr "" +msgstr "Sintaxis de definición de clases" #: ../Doc/tutorial/classes.rst:223 msgid "The simplest form of class definition looks like this::" -msgstr "" +msgstr "La forma más sencilla de definición de una clase se ve así::" #: ../Doc/tutorial/classes.rst:232 msgid "" @@ -434,52 +442,81 @@ msgid "" "a class definition in a branch of an :keyword:`if` statement, or inside a " "function.)" msgstr "" +"Las definiciones de clases, al igual que las definiciones de funciones " +"(instrucciones :keyword:`def`) deben ejecutarse antes de que tengan efecto " +"alguno. (Es concebible poner una definición de clase dentro de una rama de " +"un :keyword:`if`, o dentro de una función.)" #: ../Doc/tutorial/classes.rst:236 msgid "" "In practice, the statements inside a class definition will usually be " -"function definitions, but other statements are allowed, and sometimes useful " -"--- we'll come back to this later. The function definitions inside a class " -"normally have a peculiar form of argument list, dictated by the calling " +"function definitions, but other statements are allowed, and sometimes useful" +" --- we'll come back to this later. The function definitions inside a class" +" normally have a peculiar form of argument list, dictated by the calling " "conventions for methods --- again, this is explained later." msgstr "" +"En la práctica, las declaraciones dentro de una clase son definiciones de " +"funciones, pero otras declaraciones son permitidas, y a veces resultan " +"útiles; veremos esto más adelante. Las definiciones de funciones dentro de " +"una clase normalmente tienen una lista de argumentos peculiar, dictada por " +"las convenciones de invocación de métodos; a esto también lo veremos más " +"adelante." #: ../Doc/tutorial/classes.rst:242 msgid "" "When a class definition is entered, a new namespace is created, and used as " "the local scope --- thus, all assignments to local variables go into this " -"new namespace. In particular, function definitions bind the name of the new " -"function here." +"new namespace. In particular, function definitions bind the name of the new" +" function here." msgstr "" +"Cuando se ingresa una definición de clase, se crea un nuevo espacio de " +"nombres, el cual se usa como ámbito local; por lo tanto, todas las " +"asignaciones a variables locales van a este nuevo espacio de nombres. En " +"particular, las definiciones de funciones asocian el nombre de las funciones" +" nuevas allí." #: ../Doc/tutorial/classes.rst:247 msgid "" "When a class definition is left normally (via the end), a *class object* is " "created. This is basically a wrapper around the contents of the namespace " -"created by the class definition; we'll learn more about class objects in the " -"next section. The original local scope (the one in effect just before the " +"created by the class definition; we'll learn more about class objects in the" +" next section. The original local scope (the one in effect just before the " "class definition was entered) is reinstated, and the class object is bound " -"here to the class name given in the class definition header (:class:" -"`ClassName` in the example)." +"here to the class name given in the class definition header " +"(:class:`ClassName` in the example)." msgstr "" +"Cuando una definición de clase se finaliza normalmente se crea un *objeto " +"clase*. Básicamente, este objeto envuelve los contenidos del espacio de " +"nombres creado por la definición de la clase; aprenderemos más acerca de los" +" objetos clase en la sección siguiente. El ámbito local original (el que " +"tenía efecto justo antes de que ingrese la definición de la clase) es " +"restablecido, y el objeto clase se asocia allí al nombre que se le puso a la" +" clase en el encabezado de su definición (:class:`Clase` en el ejemplo)." #: ../Doc/tutorial/classes.rst:259 msgid "Class Objects" -msgstr "" +msgstr "Objetos clase" #: ../Doc/tutorial/classes.rst:261 msgid "" "Class objects support two kinds of operations: attribute references and " "instantiation." msgstr "" +"Los objetos clase soportan dos tipos de operaciones: hacer referencia a " +"atributos e instanciación." #: ../Doc/tutorial/classes.rst:264 msgid "" "*Attribute references* use the standard syntax used for all attribute " -"references in Python: ``obj.name``. Valid attribute names are all the names " -"that were in the class's namespace when the class object was created. So, " +"references in Python: ``obj.name``. Valid attribute names are all the names" +" that were in the class's namespace when the class object was created. So, " "if the class definition looked like this::" msgstr "" +"Para *hacer referencia a atributos* se usa la sintaxis estándar de todas las" +" referencias a atributos en Python: ``objeto.nombre``. Los nombres de " +"atributo válidos son todos los nombres que estaban en el espacio de nombres " +"de la clase cuando ésta se creó. Por lo tanto, si la definición de la clase" +" es así::" #: ../Doc/tutorial/classes.rst:276 msgid "" @@ -489,35 +526,53 @@ msgid "" "assignment. :attr:`__doc__` is also a valid attribute, returning the " "docstring belonging to the class: ``\"A simple example class\"``." msgstr "" +"...entonces ``MiClase.i`` y ``MiClase.f`` son referencias de atributos " +"válidas, que devuelven un entero y un objeto función respectivamente. Los " +"atributos de clase también pueden ser asignados, o sea que podés cambiar el " +"valor de ``MiClase.i`` mediante asignación. :attr:`__doc__` también es un " +"atributo válido, que devuelve la documentación asociada a la clase: " +"``\"Simple clase de ejemplo\"``." #: ../Doc/tutorial/classes.rst:282 msgid "" "Class *instantiation* uses function notation. Just pretend that the class " -"object is a parameterless function that returns a new instance of the class. " -"For example (assuming the above class)::" +"object is a parameterless function that returns a new instance of the class." +" For example (assuming the above class)::" msgstr "" +"La *instanciación* de clases usa la notación de funciones. Hacé de cuenta " +"que el objeto de clase es una función sin parámetros que devuelve una nueva " +"instancia de la clase. Por ejemplo (para la clase de más arriba)::" #: ../Doc/tutorial/classes.rst:288 msgid "" "creates a new *instance* of the class and assigns this object to the local " "variable ``x``." msgstr "" +"...crea una nueva *instancia* de la clase y asigna este objeto a la variable" +" local ``x``." #: ../Doc/tutorial/classes.rst:291 msgid "" "The instantiation operation (\"calling\" a class object) creates an empty " "object. Many classes like to create objects with instances customized to a " -"specific initial state. Therefore a class may define a special method named :" -"meth:`__init__`, like this::" +"specific initial state. Therefore a class may define a special method named " +":meth:`__init__`, like this::" msgstr "" +"La operación de instanciación (\"llamar\" a un objeto clase) crea un objeto " +"vacío. Muchas clases necesitan crear objetos con instancias en un estado " +"inicial particular. Por lo tanto una clase puede definir un método especial" +" llamado :meth:`__init__`, de esta forma::" #: ../Doc/tutorial/classes.rst:299 msgid "" "When a class defines an :meth:`__init__` method, class instantiation " -"automatically invokes :meth:`__init__` for the newly-created class " -"instance. So in this example, a new, initialized instance can be obtained " -"by::" +"automatically invokes :meth:`__init__` for the newly-created class instance." +" So in this example, a new, initialized instance can be obtained by::" msgstr "" +"Cuando una clase define un método :meth:`__init__`, la instanciación de la " +"clase automáticamente invoca a :meth:`__init__` para la instancia recién " +"creada. Entonces, en este ejemplo, una instancia nueva e inicializada se " +"puede obtener haciendo::" #: ../Doc/tutorial/classes.rst:305 msgid "" @@ -525,17 +580,24 @@ msgid "" "flexibility. In that case, arguments given to the class instantiation " "operator are passed on to :meth:`__init__`. For example, ::" msgstr "" +"Por supuesto, el método :meth:`__init__` puede tener argumentos para mayor " +"flexibilidad. En ese caso, los argumentos que se pasen al operador de " +"instanciación de la clase van a parar al método :meth:`__init__`. Por " +"ejemplo, ::" #: ../Doc/tutorial/classes.rst:322 msgid "Instance Objects" -msgstr "" +msgstr "Objetos instancia" #: ../Doc/tutorial/classes.rst:324 msgid "" -"Now what can we do with instance objects? The only operations understood by " -"instance objects are attribute references. There are two kinds of valid " +"Now what can we do with instance objects? The only operations understood by" +" instance objects are attribute references. There are two kinds of valid " "attribute names, data attributes and methods." msgstr "" +"Ahora, ¿Qué podemos hacer con los objetos instancia? La única operación que" +" es entendida por los objetos instancia es la referencia de atributos. Hay " +"dos tipos de nombres de atributos válidos, atributos de datos y métodos." #: ../Doc/tutorial/classes.rst:328 msgid "" @@ -546,17 +608,31 @@ msgid "" "following piece of code will print the value ``16``, without leaving a " "trace::" msgstr "" +"Los *atributos de datos* se corresponden con las \"variables de instancia\" " +"en Smalltalk, y con las \"variables miembro\" en C++. Los atributos de " +"datos no necesitan ser declarados; tal como las variables locales son " +"creados la primera vez que se les asigna algo. Por ejemplo, si ``x`` es la " +"instancia de :class:`MiClase` creada más arriba, el siguiente pedazo de " +"código va a imprimir el valor ``16``, sin dejar ningún rastro::" #: ../Doc/tutorial/classes.rst:340 msgid "" "The other kind of instance attribute reference is a *method*. A method is a " "function that \"belongs to\" an object. (In Python, the term method is not " -"unique to class instances: other object types can have methods as well. For " -"example, list objects have methods called append, insert, remove, sort, and " -"so on. However, in the following discussion, we'll use the term method " +"unique to class instances: other object types can have methods as well. For" +" example, list objects have methods called append, insert, remove, sort, and" +" so on. However, in the following discussion, we'll use the term method " "exclusively to mean methods of class instance objects, unless explicitly " "stated otherwise.)" msgstr "" +"El otro tipo de atributo de instancia es el *método*. Un método es una " +"función que \"pertenece a\" un objeto. En Python, el término método no está" +" limitado a instancias de clase: otros tipos de objetos pueden tener métodos" +" también. Por ejemplo, los objetos lista tienen métodos llamados append, " +"insert, remove, sort, y así sucesivamente. Pero, en la siguiente " +"explicación, usaremos el término método para referirnos exclusivamente a " +"métodos de objetos instancia de clase, a menos que se especifique " +"explícitamente lo contrario." #: ../Doc/tutorial/classes.rst:349 msgid "" @@ -567,14 +643,21 @@ msgid "" "not, since ``MyClass.i`` is not. But ``x.f`` is not the same thing as " "``MyClass.f`` --- it is a *method object*, not a function object." msgstr "" +"Los nombres válidos de métodos de un objeto instancia dependen de su clase. " +"Por definición, todos los atributos de clase que son objetos funciones " +"definen métodos correspondientes de sus instancias. Entonces, en nuestro " +"ejemplo, ``x.f`` es una referencia a un método válido, dado que " +"``MiClase.f`` es una función, pero ``x.i`` no lo es, dado que ``MiClase.i`` " +"no lo es. Pero ``x.f`` no es la misma cosa que ``MiClase.f``; es un *objeto" +" método*, no un objeto función." #: ../Doc/tutorial/classes.rst:360 msgid "Method Objects" -msgstr "" +msgstr "Objetos método" #: ../Doc/tutorial/classes.rst:362 msgid "Usually, a method is called right after it is bound::" -msgstr "" +msgstr "Generalmente, un método es llamado luego de ser vinculado::" #: ../Doc/tutorial/classes.rst:366 msgid "" @@ -583,48 +666,64 @@ msgid "" "is a method object, and can be stored away and called at a later time. For " "example::" msgstr "" +"En el ejemplo :class:`MiClase`, esto devuelve la cadena ``'hola mundo'``. " +"Pero no es necesario llamar al método justo en ese momento: ``x.f`` es un " +"objeto método, y puede ser guardado y llamado más tarde. Por ejemplo::" #: ../Doc/tutorial/classes.rst:374 msgid "will continue to print ``hello world`` until the end of time." -msgstr "" +msgstr "...continuará imprimiendo ``hola mundo`` hasta el fin de los días." #: ../Doc/tutorial/classes.rst:376 msgid "" -"What exactly happens when a method is called? You may have noticed that ``x." -"f()`` was called without an argument above, even though the function " +"What exactly happens when a method is called? You may have noticed that " +"``x.f()`` was called without an argument above, even though the function " "definition for :meth:`f` specified an argument. What happened to the " -"argument? Surely Python raises an exception when a function that requires an " -"argument is called without any --- even if the argument isn't actually " +"argument? Surely Python raises an exception when a function that requires an" +" argument is called without any --- even if the argument isn't actually " "used..." msgstr "" +"¿Qué sucede exactamente cuando un método es llamado? Debés haber notado que" +" ``x.f()`` fue llamado más arriba sin ningún argumento, a pesar de que la " +"definición de función de :meth:`f` especificaba un argumento. ¿Qué pasó con" +" ese argumento? Seguramente Python levanta una excepción cuando una función" +" que requiere un argumento es llamada sin ninguno, aún si el argumento no es" +" utilizado..." #: ../Doc/tutorial/classes.rst:382 msgid "" "Actually, you may have guessed the answer: the special thing about methods " -"is that the instance object is passed as the first argument of the " -"function. In our example, the call ``x.f()`` is exactly equivalent to " -"``MyClass.f(x)``. In general, calling a method with a list of *n* arguments " -"is equivalent to calling the corresponding function with an argument list " +"is that the instance object is passed as the first argument of the function." +" In our example, the call ``x.f()`` is exactly equivalent to " +"``MyClass.f(x)``. In general, calling a method with a list of *n* arguments" +" is equivalent to calling the corresponding function with an argument list " "that is created by inserting the method's instance object before the first " "argument." msgstr "" +"De hecho, tal vez hayas adivinado la respuesta: lo que tienen de especial " +"los métodos es que el objeto es pasado como el primer argumento de la " +"función. En nuestro ejemplo, la llamada ``x.f()`` es exactamente equivalente" +" a ``MiClase.f(x)``. En general, llamar a un método con una lista de *n* " +"argumentos es equivalente a llamar a la función correspondiente con una " +"lista de argumentos que es creada insertando el objeto del método antes del " +"primer argumento." #: ../Doc/tutorial/classes.rst:389 msgid "" -"If you still don't understand how methods work, a look at the implementation " -"can perhaps clarify matters. When a non-data attribute of an instance is " +"If you still don't understand how methods work, a look at the implementation" +" can perhaps clarify matters. When a non-data attribute of an instance is " "referenced, the instance's class is searched. If the name denotes a valid " "class attribute that is a function object, a method object is created by " -"packing (pointers to) the instance object and the function object just found " -"together in an abstract object: this is the method object. When the method " -"object is called with an argument list, a new argument list is constructed " +"packing (pointers to) the instance object and the function object just found" +" together in an abstract object: this is the method object. When the method" +" object is called with an argument list, a new argument list is constructed " "from the instance object and the argument list, and the function object is " "called with this new argument list." msgstr "" #: ../Doc/tutorial/classes.rst:403 msgid "Class and Instance Variables" -msgstr "" +msgstr "Variables de clase y de instancia" #: ../Doc/tutorial/classes.rst:405 msgid "" @@ -632,6 +731,9 @@ msgid "" "and class variables are for attributes and methods shared by all instances " "of the class::" msgstr "" +"En general, las variables de instancia son para datos únicos de cada " +"instancia y las variables de clase son para atributos y métodos compartidos " +"por todas las instancias de la clase::" #: ../Doc/tutorial/classes.rst:427 msgid "" @@ -641,14 +743,20 @@ msgid "" "not be used as a class variable because just a single list would be shared " "by all *Dog* instances::" msgstr "" +"Como se vió en :ref:`tut-object`, los datos compartidos pueden tener efectos" +" inesperados que involucren objetos :term:`mutables` como ser listas y " +"diccionarios. Por ejemplo, la lista *trucos* en el siguiente código no " +"debería ser usada como variable de clase porque una sola lista sería " +"compartida por todos las instancias de *Perro*::" #: ../Doc/tutorial/classes.rst:450 msgid "Correct design of the class should use an instance variable instead::" msgstr "" +"El diseño correcto de esta clase sería usando una variable de instancia::" #: ../Doc/tutorial/classes.rst:474 msgid "Random Remarks" -msgstr "" +msgstr "Algunas observaciones" #: ../Doc/tutorial/classes.rst:478 msgid "" @@ -660,6 +768,14 @@ msgid "" "just an underscore), or using verbs for methods and nouns for data " "attributes." msgstr "" +"Los atributos de datos tienen preferencia sobre los métodos con el mismo " +"nombre; para evitar conflictos de nombre accidentales, que pueden causar " +"errores difíciles de encontrar en programas grandes, es prudente usar algún " +"tipo de convención que minimice las posibilidades de dichos conflictos. " +"Algunas convenciones pueden ser poner los nombres de métodos con mayúsculas," +" prefijar los nombres de atributos de datos con una pequeña cadena única (a " +"lo mejor sólo un guión bajo), o usar verbos para los métodos y sustantivos " +"para los atributos." #: ../Doc/tutorial/classes.rst:485 msgid "" @@ -667,59 +783,94 @@ msgid "" "(\"clients\") of an object. In other words, classes are not usable to " "implement pure abstract data types. In fact, nothing in Python makes it " "possible to enforce data hiding --- it is all based upon convention. (On " -"the other hand, the Python implementation, written in C, can completely hide " -"implementation details and control access to an object if necessary; this " +"the other hand, the Python implementation, written in C, can completely hide" +" implementation details and control access to an object if necessary; this " "can be used by extensions to Python written in C.)" msgstr "" +"A los atributos de datos los pueden hacer referencia tanto los métodos como " +"los usuarios (\"clientes\") ordinarios de un objeto. En otras palabras, las" +" clases no se usan para implementar tipos de datos abstractos puros. De " +"hecho, en Python no hay nada que haga cumplir el ocultar datos; todo se basa" +" en convención. (Por otro lado, la implementación de Python, escrita en C, " +"puede ocultar por completo detalles de implementación y el control de acceso" +" a un objeto si es necesario; esto se puede usar en extensiones a Python " +"escritas en C.)" #: ../Doc/tutorial/classes.rst:493 msgid "" "Clients should use data attributes with care --- clients may mess up " "invariants maintained by the methods by stamping on their data attributes. " -"Note that clients may add data attributes of their own to an instance object " -"without affecting the validity of the methods, as long as name conflicts are " -"avoided --- again, a naming convention can save a lot of headaches here." +"Note that clients may add data attributes of their own to an instance object" +" without affecting the validity of the methods, as long as name conflicts " +"are avoided --- again, a naming convention can save a lot of headaches here." msgstr "" +"Los clientes deben usar los atributos de datos con cuidado; éstos pueden " +"romper invariantes que mantienen los métodos si pisan los atributos de " +"datos. Observá que los clientes pueden añadir sus propios atributos de datos" +" a una instancia sin afectar la validez de sus métodos, siempre y cuando se " +"eviten conflictos de nombres; de nuevo, una convención de nombres puede " +"ahorrar un montón de dolores de cabeza." #: ../Doc/tutorial/classes.rst:499 msgid "" "There is no shorthand for referencing data attributes (or other methods!) " -"from within methods. I find that this actually increases the readability of " -"methods: there is no chance of confusing local variables and instance " +"from within methods. I find that this actually increases the readability of" +" methods: there is no chance of confusing local variables and instance " "variables when glancing through a method." msgstr "" +"No hay un atajo para hacer referencia a atributos de datos (¡u otros " +"métodos!) desde dentro de un método. A mi parecer, esto en realidad aumenta" +" la legibilidad de los métodos: no existe posibilidad alguna de confundir " +"variables locales con variables de instancia cuando repasamos un método." #: ../Doc/tutorial/classes.rst:504 msgid "" "Often, the first argument of a method is called ``self``. This is nothing " "more than a convention: the name ``self`` has absolutely no special meaning " "to Python. Note, however, that by not following the convention your code " -"may be less readable to other Python programmers, and it is also conceivable " -"that a *class browser* program might be written that relies upon such a " +"may be less readable to other Python programmers, and it is also conceivable" +" that a *class browser* program might be written that relies upon such a " "convention." msgstr "" +"A menudo, el primer argumento de un método se llama ``self`` (uno mismo). " +"Esto no es nada más que una convención: el nombre ``self`` no significa nada" +" en especial para Python. Observá que, sin embargo, si no seguís la " +"convención tu código puede resultar menos legible a otros programadores de " +"Python, y puede llegar a pasar que un programa *navegador de clases* pueda " +"escribirse de una manera que dependa de dicha convención." #: ../Doc/tutorial/classes.rst:510 msgid "" -"Any function object that is a class attribute defines a method for instances " -"of that class. It is not necessary that the function definition is " -"textually enclosed in the class definition: assigning a function object to a " -"local variable in the class is also ok. For example::" +"Any function object that is a class attribute defines a method for instances" +" of that class. It is not necessary that the function definition is " +"textually enclosed in the class definition: assigning a function object to a" +" local variable in the class is also ok. For example::" msgstr "" +"Cualquier objeto función que es un atributo de clase define un método para " +"instancias de esa clase. No es necesario que el la definición de la función" +" esté textualmente dentro de la definición de la clase: asignando un objeto " +"función a una variable local en la clase también está bien. Por ejemplo::" #: ../Doc/tutorial/classes.rst:527 msgid "" -"Now ``f``, ``g`` and ``h`` are all attributes of class :class:`C` that refer " -"to function objects, and consequently they are all methods of instances of :" -"class:`C` --- ``h`` being exactly equivalent to ``g``. Note that this " +"Now ``f``, ``g`` and ``h`` are all attributes of class :class:`C` that refer" +" to function objects, and consequently they are all methods of instances of " +":class:`C` --- ``h`` being exactly equivalent to ``g``. Note that this " "practice usually only serves to confuse the reader of a program." msgstr "" +"Ahora ``f``, ``g`` y ``h`` son todos atributos de la clase :class:`C` que " +"hacen referencia a objetos función, y consecuentemente son todos métodos de " +"las instancias de :class:`C`; ``h`` siendo exactamente equivalente a ``g``. " +"Fijate que esta práctica normalmente sólo sirve para confundir al que lea un" +" programa." #: ../Doc/tutorial/classes.rst:532 msgid "" "Methods may call other methods by using method attributes of the ``self`` " "argument::" msgstr "" +"Los métodos pueden llamar a otros métodos de la instancia usando el " +"argumento ``self``::" #: ../Doc/tutorial/classes.rst:546 msgid "" @@ -730,19 +881,31 @@ msgid "" "legitimate uses of the global scope: for one thing, functions and modules " "imported into the global scope can be used by methods, as well as functions " "and classes defined in it. Usually, the class containing the method is " -"itself defined in this global scope, and in the next section we'll find some " -"good reasons why a method would want to reference its own class." -msgstr "" +"itself defined in this global scope, and in the next section we'll find some" +" good reasons why a method would want to reference its own class." +msgstr "" +"Los métodos pueden hacer referencia a nombres globales de la misma manera " +"que lo hacen las funciones comunes. El ámbito global asociado a un método " +"es el módulo que contiene su definición. (Una clase nunca se usa como un " +"ámbito global.) Si bien es raro encontrar una buena razón para usar datos " +"globales en un método, hay muchos usos legítimos del ámbito global: por lo " +"menos, las funciones y módulos importados en el ámbito global pueden usarse " +"por los métodos, al igual que las funciones y clases definidas en él. " +"Habitualmente, la clase que contiene el método está definida en este ámbito " +"global, y en la siguiente sección veremos algunas buenas razones por las que" +" un método querría hacer referencia a su propia clase." #: ../Doc/tutorial/classes.rst:556 msgid "" "Each value is an object, and therefore has a *class* (also called its " "*type*). It is stored as ``object.__class__``." msgstr "" +"Todo valor es un objeto, y por lo tanto tiene una *clase* (también llamado " +"su *tipo*). Ésta se almacena como ``objeto.__class__``." #: ../Doc/tutorial/classes.rst:563 msgid "Inheritance" -msgstr "" +msgstr "Herencia" #: ../Doc/tutorial/classes.rst:565 msgid "" @@ -750,6 +913,9 @@ msgid "" "without supporting inheritance. The syntax for a derived class definition " "looks like this::" msgstr "" +"Por supuesto, una característica del lenguaje no sería digna del nombre " +"\"clase\" si no soportara herencia. La sintaxis para una definición de " +"clase derivada se ve así::" #: ../Doc/tutorial/classes.rst:576 msgid "" @@ -758,16 +924,26 @@ msgid "" "expressions are also allowed. This can be useful, for example, when the " "base class is defined in another module::" msgstr "" +"El nombre :class:`ClaseBase` debe estar definido en un ámbito que contenga a" +" la definición de la clase derivada. En el lugar del nombre de la clase " +"base se permiten otras expresiones arbitrarias. Esto puede ser útil, por " +"ejemplo, cuando la clase base está definida en otro módulo::" #: ../Doc/tutorial/classes.rst:583 msgid "" "Execution of a derived class definition proceeds the same as for a base " "class. When the class object is constructed, the base class is remembered. " -"This is used for resolving attribute references: if a requested attribute is " -"not found in the class, the search proceeds to look in the base class. This " -"rule is applied recursively if the base class itself is derived from some " -"other class." -msgstr "" +"This is used for resolving attribute references: if a requested attribute is" +" not found in the class, the search proceeds to look in the base class. " +"This rule is applied recursively if the base class itself is derived from " +"some other class." +msgstr "" +"La ejecución de una definición de clase derivada procede de la misma forma " +"que una clase base. Cuando el objeto clase se construye, se tiene en cuenta" +" a la clase base. Esto se usa para resolver referencias a atributos: si un " +"atributo solicitado no se encuentra en la clase, la búsqueda continúa por la" +" clase base. Esta regla se aplica recursivamente si la clase base misma " +"deriva de alguna otra clase." #: ../Doc/tutorial/classes.rst:589 msgid "" @@ -777,54 +953,74 @@ msgid "" "searched, descending down the chain of base classes if necessary, and the " "method reference is valid if this yields a function object." msgstr "" +"No hay nada en especial en la instanciación de clases derivadas: " +"``ClaseDerivada()`` crea una nueva instancia de la clase. Las referencias a" +" métodos se resuelven de la siguiente manera: se busca el atributo de clase " +"correspondiente, descendiendo por la cadena de clases base si es necesario, " +"y la referencia al método es válida si se entrega un objeto función." #: ../Doc/tutorial/classes.rst:595 msgid "" -"Derived classes may override methods of their base classes. Because methods " -"have no special privileges when calling other methods of the same object, a " -"method of a base class that calls another method defined in the same base " +"Derived classes may override methods of their base classes. Because methods" +" have no special privileges when calling other methods of the same object, a" +" method of a base class that calls another method defined in the same base " "class may end up calling a method of a derived class that overrides it. " "(For C++ programmers: all methods in Python are effectively ``virtual``.)" msgstr "" +"Las clases derivadas pueden redefinir métodos de su clase base. Como los " +"métodos no tienen privilegios especiales cuando llaman a otros métodos del " +"mismo objeto, un método de la clase base que llame a otro método definido en" +" la misma clase base puede terminar llamando a un método de la clase " +"derivada que lo haya redefinido. (Para los programadores de C++: en Python " +"todos los métodos son en efecto ``virtuales``.)" #: ../Doc/tutorial/classes.rst:601 msgid "" "An overriding method in a derived class may in fact want to extend rather " "than simply replace the base class method of the same name. There is a " -"simple way to call the base class method directly: just call ``BaseClassName." -"methodname(self, arguments)``. This is occasionally useful to clients as " -"well. (Note that this only works if the base class is accessible as " -"``BaseClassName`` in the global scope.)" -msgstr "" +"simple way to call the base class method directly: just call " +"``BaseClassName.methodname(self, arguments)``. This is occasionally useful " +"to clients as well. (Note that this only works if the base class is " +"accessible as ``BaseClassName`` in the global scope.)" +msgstr "" +"Un método redefinido en una clase derivada puede de hecho querer extender en" +" vez de simplemente reemplazar al método de la clase base con el mismo " +"nombre. Hay una manera simple de llamar al método de la clase base " +"directamente: simplemente llamás a ``ClaseBase.metodo(self, argumentos)``. " +"En ocasiones esto es útil para los clientes también. (Observá que esto sólo" +" funciona si la clase base es accesible como ``ClaseBase`` en el ámbito " +"global.)" #: ../Doc/tutorial/classes.rst:608 msgid "Python has two built-in functions that work with inheritance:" -msgstr "" +msgstr "Python tiene dos funciones integradas que funcionan con herencia:" #: ../Doc/tutorial/classes.rst:610 msgid "" -"Use :func:`isinstance` to check an instance's type: ``isinstance(obj, int)`` " -"will be ``True`` only if ``obj.__class__`` is :class:`int` or some class " +"Use :func:`isinstance` to check an instance's type: ``isinstance(obj, int)``" +" will be ``True`` only if ``obj.__class__`` is :class:`int` or some class " "derived from :class:`int`." msgstr "" #: ../Doc/tutorial/classes.rst:614 msgid "" -"Use :func:`issubclass` to check class inheritance: ``issubclass(bool, int)`` " -"is ``True`` since :class:`bool` is a subclass of :class:`int`. However, " +"Use :func:`issubclass` to check class inheritance: ``issubclass(bool, int)``" +" is ``True`` since :class:`bool` is a subclass of :class:`int`. However, " "``issubclass(float, int)`` is ``False`` since :class:`float` is not a " "subclass of :class:`int`." msgstr "" #: ../Doc/tutorial/classes.rst:624 msgid "Multiple Inheritance" -msgstr "" +msgstr "Herencia múltiple" #: ../Doc/tutorial/classes.rst:626 msgid "" "Python supports a form of multiple inheritance as well. A class definition " "with multiple base classes looks like this::" msgstr "" +"Python también soporta una forma de herencia múltiple. Una definición de " +"clase con múltiples clases base se ve así::" #: ../Doc/tutorial/classes.rst:636 msgid "" @@ -832,10 +1028,17 @@ msgid "" "attributes inherited from a parent class as depth-first, left-to-right, not " "searching twice in the same class where there is an overlap in the " "hierarchy. Thus, if an attribute is not found in :class:`DerivedClassName`, " -"it is searched for in :class:`Base1`, then (recursively) in the base classes " -"of :class:`Base1`, and if it was not found there, it was searched for in :" -"class:`Base2`, and so on." -msgstr "" +"it is searched for in :class:`Base1`, then (recursively) in the base classes" +" of :class:`Base1`, and if it was not found there, it was searched for in " +":class:`Base2`, and so on." +msgstr "" +"Para la mayoría de los propósitos, en los casos más simples, podés pensar en" +" la búsqueda de los atributos heredados de clases padres como primero en " +"profundidad, de izquierda a derecha, sin repetir la misma clase cuando está " +"dos veces en la jerarquía. Por lo tanto, si un atributo no se encuentra en " +":class:`ClaseDerivada`, se busca en :class:`Base1`, luego (recursivamente) " +"en las clases base de :class:`Base1`, y sólo si no se encuentra allí se lo " +"busca en :class:`Base2`, y así sucesivamente." #: ../Doc/tutorial/classes.rst:643 msgid "" @@ -845,6 +1048,11 @@ msgid "" "method and is more powerful than the super call found in single-inheritance " "languages." msgstr "" +"En realidad es un poco más complejo que eso; el orden de resolución de " +"métodos cambia dinámicamente para soportar las llamadas cooperativas a " +":func:`super`. Este enfoque es conocido en otros lenguajes con herencia " +"múltiple como \"llámese al siguiente método\" y es más poderoso que la " +"llamada al superior que se encuentra en lenguajes con sólo herencia simple." #: ../Doc/tutorial/classes.rst:649 msgid "" @@ -859,23 +1067,43 @@ msgid "" "and that is monotonic (meaning that a class can be subclassed without " "affecting the precedence order of its parents). Taken together, these " "properties make it possible to design reliable and extensible classes with " -"multiple inheritance. For more detail, see https://www.python.org/download/" -"releases/2.3/mro/." -msgstr "" +"multiple inheritance. For more detail, see " +"https://www.python.org/download/releases/2.3/mro/." +msgstr "" +"El ordenamiento dinámico es necesario porque todos los casos de herencia " +"múltiple exhiben una o más relaciones en diamante (cuando se puede llegar al" +" menos a una de las clases base por distintos caminos desde la clase de más " +"abajo). Por ejemplo, todas las clases heredan de :class:`object`, por lo " +"tanto cualquier caso de herencia múltiple provee más de un camino para " +"llegar a :class:`object`. Para que las clases base no sean accedidas más de" +" una vez, el algoritmo dinámico hace lineal el orden de búsqueda de manera " +"que se preserve el orden de izquierda a derecha especificado en cada clase, " +"que se llame a cada clase base sólo una vez, y que sea monótona (lo cual " +"significa que una clase puede tener clases derivadas sin afectar el orden de" +" precedencia de sus clases bases). En conjunto, estas propiedades hacen " +"posible diseñar clases confiables y extensibles con herencia múltiple. Para " +"más detalles mirá https://www.python.org/download/releases/2.3/mro/." #: ../Doc/tutorial/classes.rst:666 msgid "Private Variables" -msgstr "" +msgstr "Variables privadas" #: ../Doc/tutorial/classes.rst:668 msgid "" -"\"Private\" instance variables that cannot be accessed except from inside an " -"object don't exist in Python. However, there is a convention that is " +"\"Private\" instance variables that cannot be accessed except from inside an" +" object don't exist in Python. However, there is a convention that is " "followed by most Python code: a name prefixed with an underscore (e.g. " "``_spam``) should be treated as a non-public part of the API (whether it is " "a function, a method or a data member). It should be considered an " "implementation detail and subject to change without notice." msgstr "" +"Las variables \"privadas\" de instancia, que no pueden accederse excepto " +"desde dentro de un objeto, no existen en Python. Sin embargo, hay una " +"convención que se sigue en la mayoría del código Python: un nombre prefijado" +" con un guión bajo (por ejemplo, ``_spam``) debería tratarse como una parte " +"no pública de la API (más allá de que sea una función, un método, o un " +"dato). Debería considerarse un detalle de implementación y que está sujeto " +"a cambios sin aviso." #: ../Doc/tutorial/classes.rst:678 msgid "" @@ -884,21 +1112,33 @@ msgid "" "support for such a mechanism, called :dfn:`name mangling`. Any identifier " "of the form ``__spam`` (at least two leading underscores, at most one " "trailing underscore) is textually replaced with ``_classname__spam``, where " -"``classname`` is the current class name with leading underscore(s) " -"stripped. This mangling is done without regard to the syntactic position of " -"the identifier, as long as it occurs within the definition of a class." -msgstr "" +"``classname`` is the current class name with leading underscore(s) stripped." +" This mangling is done without regard to the syntactic position of the " +"identifier, as long as it occurs within the definition of a class." +msgstr "" +"Ya que hay un caso de uso válido para los identificadores privados de clase " +"(a saber: colisión de nombres con nombres definidos en las subclases), hay " +"un soporte limitado para este mecanismo. Cualquier identificador con la " +"forma ``__spam`` (al menos dos guiones bajos al principio, como mucho un " +"guión bajo al final) es textualmente reemplazado por " +"``_nombredeclase__spam``, donde ``nombredeclase`` es el nombre de clase " +"actual al que se le sacan guiones bajos del comienzo (si los tuviera). Se " +"modifica el nombre del identificador sin importar su posición sintáctica, " +"siempre y cuando ocurra dentro de la definición de una clase." #: ../Doc/tutorial/classes.rst:687 msgid "" "Name mangling is helpful for letting subclasses override methods without " "breaking intraclass method calls. For example::" msgstr "" +"La modificación de nombres es útil para dejar que las subclases " +"sobreescriban los métodos sin romper las llamadas a los métodos desde la " +"misma clase. Por ejemplo::" #: ../Doc/tutorial/classes.rst:709 msgid "" -"The above example would work even if ``MappingSubclass`` were to introduce a " -"``__update`` identifier since it is replaced with ``_Mapping__update`` in " +"The above example would work even if ``MappingSubclass`` were to introduce a" +" ``__update`` identifier since it is replaced with ``_Mapping__update`` in " "the ``Mapping`` class and ``_MappingSubclass__update`` in the " "``MappingSubclass`` class respectively." msgstr "" @@ -906,10 +1146,13 @@ msgstr "" #: ../Doc/tutorial/classes.rst:714 msgid "" "Note that the mangling rules are designed mostly to avoid accidents; it " -"still is possible to access or modify a variable that is considered " -"private. This can even be useful in special circumstances, such as in the " -"debugger." +"still is possible to access or modify a variable that is considered private." +" This can even be useful in special circumstances, such as in the debugger." msgstr "" +"Hay que aclarar que las reglas de modificación de nombres están diseñadas " +"principalmente para evitar accidentes; es posible acceder o modificar una " +"variable que es considerada como privada. Esto hasta puede resultar útil en" +" circunstancias especiales, tales como en el depurador." #: ../Doc/tutorial/classes.rst:718 msgid "" @@ -920,10 +1163,16 @@ msgid "" "applies to ``getattr()``, ``setattr()`` and ``delattr()``, as well as when " "referencing ``__dict__`` directly." msgstr "" +"Notar que el código pasado a ``exec`` o ``eval()`` no considera que el " +"nombre de clase de la clase que invoca sea la clase actual; esto es similar " +"al efecto de la sentencia ``global``, efecto que es de similar manera " +"restringido a código que es compilado en conjunto. La misma restricción " +"aplica a ``getattr()``, ``setattr()`` y ``delattr()``, así como cuando se " +"referencia a ``__dict__`` directamente." #: ../Doc/tutorial/classes.rst:729 msgid "Odds and Ends" -msgstr "" +msgstr "Cambalache" #: ../Doc/tutorial/classes.rst:731 msgid "" @@ -931,46 +1180,69 @@ msgid "" "or C \"struct\", bundling together a few named data items. An empty class " "definition will do nicely::" msgstr "" +"A veces es útil tener un tipo de datos similar al \"registro\" de Pascal o " +"la \"estructura\" de C, que sirva para juntar algunos pocos ítems con " +"nombre. Una definición de clase vacía funcionará perfecto::" #: ../Doc/tutorial/classes.rst:745 msgid "" "A piece of Python code that expects a particular abstract data type can " -"often be passed a class that emulates the methods of that data type " -"instead. For instance, if you have a function that formats some data from a " -"file object, you can define a class with methods :meth:`read` and :meth:`!" -"readline` that get the data from a string buffer instead, and pass it as an " -"argument." -msgstr "" +"often be passed a class that emulates the methods of that data type instead." +" For instance, if you have a function that formats some data from a file " +"object, you can define a class with methods :meth:`read` and " +":meth:`!readline` that get the data from a string buffer instead, and pass " +"it as an argument." +msgstr "" +"Algún código Python que espera un tipo abstracto de datos en particular " +"puede frecuentemente recibir en cambio una clase que emula los métodos de " +"aquel tipo de datos. Por ejemplo, si tenés una función que formatea algunos" +" datos a partir de un objeto archivo, podés definir una clase con métodos " +":meth:`read` y :meth:`!readline` que obtengan los datos de alguna cadena en " +"memoria intermedia, y pasarlo como argumento." #: ../Doc/tutorial/classes.rst:756 msgid "" -"Instance method objects have attributes, too: ``m.__self__`` is the instance " -"object with the method :meth:`m`, and ``m.__func__`` is the function object " -"corresponding to the method." +"Instance method objects have attributes, too: ``m.__self__`` is the instance" +" object with the method :meth:`m`, and ``m.__func__`` is the function object" +" corresponding to the method." msgstr "" +"Los objetos método de instancia tienen atributos también: ``m.__self__`` es " +"el objeto instancia con el método :meth:`m`, y ``m.__func__`` es el objeto " +"función correspondiente al método." #: ../Doc/tutorial/classes.rst:764 msgid "Iterators" -msgstr "" +msgstr "Iteradores" #: ../Doc/tutorial/classes.rst:766 msgid "" "By now you have probably noticed that most container objects can be looped " "over using a :keyword:`for` statement::" msgstr "" +"Es probable que hayas notado que la mayoría de los objetos contenedores " +"pueden ser recorridos usando una sentencia :keyword:`for`::" #: ../Doc/tutorial/classes.rst:780 msgid "" "This style of access is clear, concise, and convenient. The use of " -"iterators pervades and unifies Python. Behind the scenes, the :keyword:" -"`for` statement calls :func:`iter` on the container object. The function " -"returns an iterator object that defines the method :meth:`~iterator." -"__next__` which accesses elements in the container one at a time. When " -"there are no more elements, :meth:`~iterator.__next__` raises a :exc:" -"`StopIteration` exception which tells the :keyword:`!for` loop to " -"terminate. You can call the :meth:`~iterator.__next__` method using the :" -"func:`next` built-in function; this example shows how it all works::" -msgstr "" +"iterators pervades and unifies Python. Behind the scenes, the " +":keyword:`for` statement calls :func:`iter` on the container object. The " +"function returns an iterator object that defines the method " +":meth:`~iterator.__next__` which accesses elements in the container one at a" +" time. When there are no more elements, :meth:`~iterator.__next__` raises a" +" :exc:`StopIteration` exception which tells the :keyword:`!for` loop to " +"terminate. You can call the :meth:`~iterator.__next__` method using the " +":func:`next` built-in function; this example shows how it all works::" +msgstr "" +"Este estilo de acceso es limpio, conciso y conveniente. El uso de " +"iteradores está impregnado y unifica a Python. En bambalinas, la sentencia " +":keyword:`for` llama a :func:`iter` en el objeto contenedor. La función " +"devuelve un objeto iterador que define el método :meth:`__next__` que accede" +" elementos en el contenedor de a uno por vez. Cuando no hay más elementos, " +":meth:`~iterator.__next__` levanta una excepción :exc:`StopIteration` que le" +" avisa al bucle del :keyword:`for` que hay que terminar. Podés llamar al " +"método :meth:`~iterator.__next__` usando la función integrada " +":func:`~iterator.__next__`; este ejemplo muestra como funciona todo esto::" #: ../Doc/tutorial/classes.rst:805 msgid "" @@ -979,36 +1251,55 @@ msgid "" "returns an object with a :meth:`~iterator.__next__` method. If the class " "defines :meth:`__next__`, then :meth:`__iter__` can just return ``self``::" msgstr "" +"Habiendo visto la mecánica del protocolo de iteración, es fácil agregar " +"comportamiento de iterador a tus clases. Definí un método :meth:`__iter__` " +"que devuelva un objeto con un método :meth:`__next__`. Si la clase define " +":meth:`__next__`, entonces alcanza con que :meth:`__iter__` devuelva " +"``self``::" #: ../Doc/tutorial/classes.rst:842 msgid "Generators" -msgstr "" +msgstr "Generadores" #: ../Doc/tutorial/classes.rst:844 msgid "" -":term:`Generator`\\s are a simple and powerful tool for creating iterators. " -"They are written like regular functions but use the :keyword:`yield` " +":term:`Generator`\\s are a simple and powerful tool for creating iterators." +" They are written like regular functions but use the :keyword:`yield` " "statement whenever they want to return data. Each time :func:`next` is " "called on it, the generator resumes where it left off (it remembers all the " "data values and which statement was last executed). An example shows that " "generators can be trivially easy to create::" msgstr "" +"Los `generadores` son una simple y poderosa herramienta para crear " +"iteradores. Se escriben como funciones regulares pero usan la sentencia " +":keyword:`yield` cuando quieren devolver datos. Cada vez que se llama " +":func:`next` sobre él, el generador continúa desde donde dejó (y recuerda " +"todos los valores de datos y cual sentencia fue ejecutada última). Un " +"ejemplo muestra que los generadores pueden ser muy fáciles de crear::" #: ../Doc/tutorial/classes.rst:865 msgid "" "Anything that can be done with generators can also be done with class-based " "iterators as described in the previous section. What makes generators so " -"compact is that the :meth:`__iter__` and :meth:`~generator.__next__` methods " -"are created automatically." +"compact is that the :meth:`__iter__` and :meth:`~generator.__next__` methods" +" are created automatically." msgstr "" +"Todo lo que puede ser hecho con generadores también puede ser hecho con " +"iteradores basados en clases, como se describe en la sección anterior. Lo " +"que hace que los generadores sean tan compactos es que los métodos " +":meth:`__iter__` y :meth:`__next__` son creados automáticamente." #: ../Doc/tutorial/classes.rst:870 msgid "" "Another key feature is that the local variables and execution state are " "automatically saved between calls. This made the function easier to write " -"and much more clear than an approach using instance variables like ``self." -"index`` and ``self.data``." +"and much more clear than an approach using instance variables like " +"``self.index`` and ``self.data``." msgstr "" +"Otra característica clave es que las variables locales y el estado de la " +"ejecución son guardados automáticamente entre llamadas. Esto hace que la " +"función sea más fácil de escribir y quede mucho más claro que hacerlo usando" +" variables de instancia tales como ``self.indice`` y ``self.datos``." #: ../Doc/tutorial/classes.rst:875 msgid "" @@ -1017,24 +1308,29 @@ msgid "" "combination, these features make it easy to create iterators with no more " "effort than writing a regular function." msgstr "" +"Además de la creación automática de métodos y el guardar el estado del " +"programa, cuando los generadores terminan automáticamente levantan " +":exc:`StopIteration`. Combinadas, estas características facilitan la " +"creación de iteradores, y hacen que no sea más esfuerzo que escribir una " +"función regular." #: ../Doc/tutorial/classes.rst:884 msgid "Generator Expressions" -msgstr "" +msgstr "Expresiones generadoras" #: ../Doc/tutorial/classes.rst:886 msgid "" -"Some simple generators can be coded succinctly as expressions using a syntax " -"similar to list comprehensions but with parentheses instead of square " +"Some simple generators can be coded succinctly as expressions using a syntax" +" similar to list comprehensions but with parentheses instead of square " "brackets. These expressions are designed for situations where the generator " -"is used right away by an enclosing function. Generator expressions are more " -"compact but less versatile than full generator definitions and tend to be " +"is used right away by an enclosing function. Generator expressions are more" +" compact but less versatile than full generator definitions and tend to be " "more memory friendly than equivalent list comprehensions." msgstr "" #: ../Doc/tutorial/classes.rst:893 msgid "Examples::" -msgstr "" +msgstr "Ejemplos::" #: ../Doc/tutorial/classes.rst:917 msgid "Footnotes" From 2a7a07f48ff974421c8adeb2ccf8a5cf133d4923 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 16:33:45 +0200 Subject: [PATCH 18/24] Update tutorialpyar with fixes --- .migration/tutorialpyar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.migration/tutorialpyar b/.migration/tutorialpyar index f9fbb76893..19fc55a5b1 160000 --- a/.migration/tutorialpyar +++ b/.migration/tutorialpyar @@ -1 +1 @@ -Subproject commit f9fbb768937506e977356772170a737949899a01 +Subproject commit 19fc55a5b17bea8bfa30744982496365ca736165 From 76368ac56c94da8d623e1bce0aabb3bdba23f3ef Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 16:49:24 +0200 Subject: [PATCH 19/24] Translate errors.po --- .migration/tutorialpyar | 2 +- tutorial/errors.po | 196 ++++++++++++++++++++++++++++++---------- 2 files changed, 148 insertions(+), 50 deletions(-) diff --git a/.migration/tutorialpyar b/.migration/tutorialpyar index 19fc55a5b1..43a6dc73a0 160000 --- a/.migration/tutorialpyar +++ b/.migration/tutorialpyar @@ -1 +1 @@ -Subproject commit 19fc55a5b17bea8bfa30744982496365ca736165 +Subproject commit 43a6dc73a0611b66b34f358c3145f2f6fbbdaa11 diff --git a/tutorial/errors.po b/tutorial/errors.po index 75cbea93d9..4eb4e6efea 100644 --- a/tutorial/errors.po +++ b/tutorial/errors.po @@ -188,20 +188,35 @@ msgid "" "not in other handlers of the same :keyword:`!try` statement. An except " "clause may name multiple exceptions as a parenthesized tuple, for example::" msgstr "" +"Una declaración :keyword:`try` puede tener más de un :keyword:`except`, para" +" especificar manejadores para distintas excepciones. A lo sumo un manejador" +" será ejecutado. Sólo se manejan excepciones que ocurren en el " +"correspondiente :keyword:`try`, no en otros manejadores del mismo " +":keyword:`try`. Un :keyword:`except` puede nombrar múltiples excepciones " +"usando paréntesis, por ejemplo::" #: ../Doc/tutorial/errors.rst:123 msgid "" -"A class in an :keyword:`except` clause is compatible with an exception if it " -"is the same class or a base class thereof (but not the other way around --- " -"an except clause listing a derived class is not compatible with a base " +"A class in an :keyword:`except` clause is compatible with an exception if it" +" is the same class or a base class thereof (but not the other way around ---" +" an except clause listing a derived class is not compatible with a base " "class). For example, the following code will print B, C, D in that order::" msgstr "" +"Una clase en una clausula :keyword:`except` es compatible con una excepción " +"si la misma esta en la misma clase o una clase base de la misma (pero no de " +"la otra manera --- una clausula except listando una clase derivada no es " +"compatible con una clase base). Por ejemplo, el siguiente código imprimirá " +"B, C, D, en ese orden::" #: ../Doc/tutorial/errors.rst:147 msgid "" "Note that if the except clauses were reversed (with ``except B`` first), it " -"would have printed B, B, B --- the first matching except clause is triggered." +"would have printed B, B, B --- the first matching except clause is " +"triggered." msgstr "" +"Notese que si las clausulas de except estuvieran invertidas (con ``except " +"B`` primero), habría impreso B, B, B --- la primera clausula de except " +"coincidente es usada." #: ../Doc/tutorial/errors.rst:150 msgid "" @@ -211,6 +226,11 @@ msgid "" "message and then re-raise the exception (allowing a caller to handle the " "exception as well)::" msgstr "" +"El último :keyword:`except` puede omitir nombrar qué excepción captura, para" +" servir como comodín. Usá esto con extremo cuidado, ya que de esta manera " +"es fácil ocultar un error real de programación. También puede usarse para " +"mostrar un mensaje de error y luego re-generar la excepción (permitiéndole " +"al que llama, manejar también la excepción)::" #: ../Doc/tutorial/errors.rst:169 msgid "" @@ -219,54 +239,80 @@ msgid "" "for code that must be executed if the try clause does not raise an " "exception. For example::" msgstr "" +"Las declaraciones :keyword:`try` ... :keyword:`except` tienen un *bloque " +"else* opcional, el cual, cuando está presente, debe seguir a los except. Es" +" útil para aquel código que debe ejecutarse si el *bloque try* no genera una" +" excepción. Por ejemplo::" #: ../Doc/tutorial/errors.rst:183 msgid "" -"The use of the :keyword:`!else` clause is better than adding additional code " -"to the :keyword:`try` clause because it avoids accidentally catching an " -"exception that wasn't raised by the code being protected by the :keyword:`!" -"try` ... :keyword:`!except` statement." +"The use of the :keyword:`!else` clause is better than adding additional code" +" to the :keyword:`try` clause because it avoids accidentally catching an " +"exception that wasn't raised by the code being protected by the " +":keyword:`!try` ... :keyword:`!except` statement." msgstr "" +"El uso de :keyword:`else` es mejor que agregar código adicional en el " +":keyword:`try` porque evita capturar accidentalmente una excepción que no " +"fue generada por el código que está protegido por la declaración " +":keyword:`try` ... :keyword:`except`." #: ../Doc/tutorial/errors.rst:188 msgid "" -"When an exception occurs, it may have an associated value, also known as the " -"exception's *argument*. The presence and type of the argument depend on the " -"exception type." +"When an exception occurs, it may have an associated value, also known as the" +" exception's *argument*. The presence and type of the argument depend on the" +" exception type." msgstr "" +"Cuando ocurre una excepción, puede tener un valor asociado, también conocido" +" como el *argumento* de la excepción. La presencia y el tipo de argumento " +"depende del tipo de excepción." #: ../Doc/tutorial/errors.rst:192 msgid "" "The except clause may specify a variable after the exception name. The " "variable is bound to an exception instance with the arguments stored in " -"``instance.args``. For convenience, the exception instance defines :meth:" -"`__str__` so the arguments can be printed directly without having to " +"``instance.args``. For convenience, the exception instance defines " +":meth:`__str__` so the arguments can be printed directly without having to " "reference ``.args``. One may also instantiate an exception first before " "raising it and add any attributes to it as desired. ::" msgstr "" +"El :keyword:`except` puede especificar una variable luego del nombre de " +"excepción. La variable se vincula a una instancia de excepción con los " +"argumentos almacenados en ``instance.args``. Por conveniencia, la instancia" +" de excepción define :meth:`__str__` para que se pueda mostrar los " +"argumentos directamente, sin necesidad de hacer referencia a ``.args``. " +"También se puede instanciar la excepción primero, antes de generarla, y " +"agregarle los atributos que se desee::" #: ../Doc/tutorial/errors.rst:216 msgid "" "If an exception has arguments, they are printed as the last part ('detail') " "of the message for unhandled exceptions." msgstr "" +"Si una excepción tiene argumentos, estos se imprimen como la última parte " +"(el 'detalle') del mensaje para las excepciones que no están manejadas." #: ../Doc/tutorial/errors.rst:219 msgid "" -"Exception handlers don't just handle exceptions if they occur immediately in " -"the try clause, but also if they occur inside functions that are called " +"Exception handlers don't just handle exceptions if they occur immediately in" +" the try clause, but also if they occur inside functions that are called " "(even indirectly) in the try clause. For example::" msgstr "" +"Los manejadores de excepciones no manejan solamente las excepciones que " +"ocurren en el *bloque try*, también manejan las excepciones que ocurren " +"dentro de las funciones que se llaman (inclusive indirectamente) dentro del " +"*bloque try*. Por ejemplo::" #: ../Doc/tutorial/errors.rst:237 msgid "Raising Exceptions" -msgstr "" +msgstr "Levantando excepciones" #: ../Doc/tutorial/errors.rst:239 msgid "" "The :keyword:`raise` statement allows the programmer to force a specified " "exception to occur. For example::" msgstr "" +"La declaración :keyword:`raise` permite al programador forzar a que ocurra " +"una excepción específica. Por ejemplo::" #: ../Doc/tutorial/errors.rst:247 msgid "" @@ -276,17 +322,25 @@ msgid "" "will be implicitly instantiated by calling its constructor with no " "arguments::" msgstr "" +"El único argumento a :keyword:`raise` indica la excepción a generarse. Tiene" +" que ser o una instancia de excepción, o una clase de excepción (una clase " +"que hereda de :class:`Exception`). Si se pasa una clase de excepción, la " +"misma sera instanciada implicitamente llamandoa su constructor sin " +"argumentos::" #: ../Doc/tutorial/errors.rst:254 msgid "" -"If you need to determine whether an exception was raised but don't intend to " -"handle it, a simpler form of the :keyword:`raise` statement allows you to re-" -"raise the exception::" +"If you need to determine whether an exception was raised but don't intend to" +" handle it, a simpler form of the :keyword:`raise` statement allows you to " +"re-raise the exception::" msgstr "" +"Si necesitás determinar cuando una excepción fue lanzada pero no querés " +"manejarla, una forma simplificada de la instrucción :keyword:`raise` te " +"permite relanzarla::" #: ../Doc/tutorial/errors.rst:273 msgid "User-defined Exceptions" -msgstr "" +msgstr "Excepciones definidas por el usuario" #: ../Doc/tutorial/errors.rst:275 msgid "" @@ -295,34 +349,48 @@ msgid "" "typically be derived from the :exc:`Exception` class, either directly or " "indirectly." msgstr "" +"Los programas pueden nombrar sus propias excepciones creando una nueva clase" +" excepción (mirá :ref:`tut-classes` para más información sobre las clases de" +" Python). Las excepciones, típicamente, deberán derivar de la clase " +":exc:`Exception`, directa o indirectamente." #: ../Doc/tutorial/errors.rst:279 msgid "" "Exception classes can be defined which do anything any other class can do, " -"but are usually kept simple, often only offering a number of attributes that " -"allow information about the error to be extracted by handlers for the " -"exception. When creating a module that can raise several distinct errors, a " -"common practice is to create a base class for exceptions defined by that " -"module, and subclass that to create specific exception classes for different " -"error conditions::" -msgstr "" +"but are usually kept simple, often only offering a number of attributes that" +" allow information about the error to be extracted by handlers for the " +"exception. When creating a module that can raise several distinct errors, a" +" common practice is to create a base class for exceptions defined by that " +"module, and subclass that to create specific exception classes for different" +" error conditions::" +msgstr "" +"Las clases de Excepciones pueden ser definidas de la misma forma que " +"cualquier otra clase, pero usualmente se mantienen simples, a menudo solo " +"ofreciendo un número de atributos con información sobre el error que leerán " +"los manejadores de la excepción. Al crear un módulo que puede lanzar varios" +" errores distintos, una práctica común es crear una clase base para " +"excepciones definidas en ese módulo y extenderla para crear clases " +"excepciones específicas para distintas condiciones de error::" #: ../Doc/tutorial/errors.rst:317 msgid "" -"Most exceptions are defined with names that end in \"Error\", similar to the " -"naming of the standard exceptions." +"Most exceptions are defined with names that end in \"Error\", similar to the" +" naming of the standard exceptions." msgstr "" #: ../Doc/tutorial/errors.rst:320 msgid "" "Many standard modules define their own exceptions to report errors that may " -"occur in functions they define. More information on classes is presented in " -"chapter :ref:`tut-classes`." +"occur in functions they define. More information on classes is presented in" +" chapter :ref:`tut-classes`." msgstr "" +"Muchos módulos estándar definen sus propias excepciones para reportar " +"errores que pueden ocurrir en funciones propias. Se puede encontrar más " +"información sobre clases en el capítulo :ref:`tut-classes`." #: ../Doc/tutorial/errors.rst:328 msgid "Defining Clean-up Actions" -msgstr "" +msgstr "Definiendo acciones de limpieza" #: ../Doc/tutorial/errors.rst:330 msgid "" @@ -330,27 +398,43 @@ msgid "" "to define clean-up actions that must be executed under all circumstances. " "For example::" msgstr "" +"La declaración :keyword:`try` tiene otra cláusula opcional que intenta " +"definir acciones de limpieza que deben ser ejecutadas bajo ciertas " +"circunstancias. Por ejemplo::" #: ../Doc/tutorial/errors.rst:344 msgid "" "A *finally clause* is always executed before leaving the :keyword:`try` " "statement, whether an exception has occurred or not. When an exception has " -"occurred in the :keyword:`!try` clause and has not been handled by an :" -"keyword:`except` clause (or it has occurred in an :keyword:`!except` or :" -"keyword:`!else` clause), it is re-raised after the :keyword:`finally` clause " -"has been executed. The :keyword:`!finally` clause is also executed \"on the " -"way out\" when any other clause of the :keyword:`!try` statement is left via " -"a :keyword:`break`, :keyword:`continue` or :keyword:`return` statement. A " -"more complicated example::" -msgstr "" +"occurred in the :keyword:`!try` clause and has not been handled by an " +":keyword:`except` clause (or it has occurred in an :keyword:`!except` or " +":keyword:`!else` clause), it is re-raised after the :keyword:`finally` " +"clause has been executed. The :keyword:`!finally` clause is also executed " +"\"on the way out\" when any other clause of the :keyword:`!try` statement is" +" left via a :keyword:`break`, :keyword:`continue` or :keyword:`return` " +"statement. A more complicated example::" +msgstr "" +"Una *cláusula finally* siempre es ejecutada antes de salir de la declaración" +" :keyword:`try`, ya sea que una excepción haya ocurrido o no. Cuando ocurre" +" una excepción en la cláusula :keyword:`try` y no fue manejada por una " +"cláusula :keyword:`except` (o ocurrió en una cláusula :keyword:`except` o " +":keyword:`else`), es relanzada luego de que se ejecuta la cláusula " +":keyword:`finally`. El :keyword:`finally` es también ejecutado \"a la " +"salida\" cuando cualquier otra cláusula de la declaración :keyword:`try` es " +"dejada via :keyword:`break`, :keyword:`continue` or :keyword:`return`. Un " +"ejemplo más complicado::" #: ../Doc/tutorial/errors.rst:377 msgid "" -"As you can see, the :keyword:`finally` clause is executed in any event. " -"The :exc:`TypeError` raised by dividing two strings is not handled by the :" -"keyword:`except` clause and therefore re-raised after the :keyword:`!" -"finally` clause has been executed." +"As you can see, the :keyword:`finally` clause is executed in any event. The" +" :exc:`TypeError` raised by dividing two strings is not handled by the " +":keyword:`except` clause and therefore re-raised after the " +":keyword:`!finally` clause has been executed." msgstr "" +"Como podés ver, la cláusula :keyword:`finally` es ejecutada siempre. La " +"excepción :exc:`TypeError` lanzada al dividir dos cadenas de texto no es " +"manejado por la cláusula :keyword:`except` y por lo tanto es relanzada luego" +" de que se ejecuta la cláusula :keyword:`finally`." #: ../Doc/tutorial/errors.rst:382 msgid "" @@ -358,28 +442,42 @@ msgid "" "releasing external resources (such as files or network connections), " "regardless of whether the use of the resource was successful." msgstr "" +"En aplicaciones reales, la cláusula :keyword:`finally` es útil para liberar " +"recursos externos (como archivos o conexiones de red), sin importar si el " +"uso del recurso fue exitoso." #: ../Doc/tutorial/errors.rst:390 msgid "Predefined Clean-up Actions" -msgstr "" +msgstr "Acciones predefinidas de limpieza" #: ../Doc/tutorial/errors.rst:392 msgid "" "Some objects define standard clean-up actions to be undertaken when the " -"object is no longer needed, regardless of whether or not the operation using " -"the object succeeded or failed. Look at the following example, which tries " +"object is no longer needed, regardless of whether or not the operation using" +" the object succeeded or failed. Look at the following example, which tries " "to open a file and print its contents to the screen. ::" msgstr "" +"Algunos objetos definen acciones de limpieza estándar que llevar a cabo " +"cuando el objeto no es más necesitado, independientemente de que las " +"operaciones sobre el objeto hayan sido exitosas o no. Mirá el siguiente " +"ejemplo, que intenta abrir un archivo e imprimir su contenido en la " +"pantalla.::" #: ../Doc/tutorial/errors.rst:400 msgid "" "The problem with this code is that it leaves the file open for an " "indeterminate amount of time after this part of the code has finished " "executing. This is not an issue in simple scripts, but can be a problem for " -"larger applications. The :keyword:`with` statement allows objects like files " -"to be used in a way that ensures they are always cleaned up promptly and " +"larger applications. The :keyword:`with` statement allows objects like files" +" to be used in a way that ensures they are always cleaned up promptly and " "correctly. ::" msgstr "" +"El problema con este código es que deja el archivo abierto por un periodo de" +" tiempo indeterminado luego de que esta parte termine de ejecutarse. Esto " +"no es un problema en scripts simples, pero puede ser un problema en " +"aplicaciones más grandes. La declaración :keyword:`with` permite que " +"objetos como archivos sean usados de una forma que asegure que siempre se " +"los libera rápido y en forma correcta.::" #: ../Doc/tutorial/errors.rst:410 msgid "" From 0dc54d591fbc4b3026e929664be25f95fec7ad54 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 16:59:24 +0200 Subject: [PATCH 20/24] modules.po --- .migration/tutorialpyar | 2 +- tutorial/modules.po | 287 ++++++++++++++++++++++++++++++---------- 2 files changed, 215 insertions(+), 74 deletions(-) diff --git a/.migration/tutorialpyar b/.migration/tutorialpyar index 43a6dc73a0..8bb4ab0479 160000 --- a/.migration/tutorialpyar +++ b/.migration/tutorialpyar @@ -1 +1 @@ -Subproject commit 43a6dc73a0611b66b34f358c3145f2f6fbbdaa11 +Subproject commit 8bb4ab04790be542df8b4346077fdcac26a09754 diff --git a/tutorial/modules.po b/tutorial/modules.po index 7db02fd2fa..c31c46d700 100644 --- a/tutorial/modules.po +++ b/tutorial/modules.po @@ -312,24 +312,40 @@ msgid "" "directory containing the script being run is placed at the beginning of the " "search path, ahead of the standard library path. This means that scripts in " "that directory will be loaded instead of modules of the same name in the " -"library directory. This is an error unless the replacement is intended. See " -"section :ref:`tut-standardmodules` for more information." +"library directory. This is an error unless the replacement is intended. See" +" section :ref:`tut-standardmodules` for more information." msgstr "" +"Luego de la inicialización, los programas Python pueden modificar " +":data:`sys.path`. El directorio que contiene el script que se está " +"ejecutando se ubica al principio de la búsqueda, adelante de la biblioteca " +"estándar. Esto significa que se cargarán scripts en ese directorio en lugar " +"de módulos de la biblioteca estándar con el mismo nombre. Esto es un error a" +" menos que se esté reemplazando intencionalmente. Mirá la sección :ref:`tut-" +"standardmodules` para más información." #: ../Doc/tutorial/modules.rst:212 msgid "\"Compiled\" Python files" -msgstr "" +msgstr "Archivos \"compilados\" de Python" #: ../Doc/tutorial/modules.rst:214 msgid "" "To speed up loading modules, Python caches the compiled version of each " -"module in the ``__pycache__`` directory under the name :file:`module." -"{version}.pyc`, where the version encodes the format of the compiled file; " -"it generally contains the Python version number. For example, in CPython " -"release 3.3 the compiled version of spam.py would be cached as ``__pycache__/" -"spam.cpython-33.pyc``. This naming convention allows compiled modules from " -"different releases and different versions of Python to coexist." -msgstr "" +"module in the ``__pycache__`` directory under the name " +":file:`module.{version}.pyc`, where the version encodes the format of the " +"compiled file; it generally contains the Python version number. For " +"example, in CPython release 3.3 the compiled version of spam.py would be " +"cached as ``__pycache__/spam.cpython-33.pyc``. This naming convention " +"allows compiled modules from different releases and different versions of " +"Python to coexist." +msgstr "" +"Para acelerar la carga de módulos, Python cachea las versiones compiladas de" +" cada módulo en el directorio ``__pycache__`` bajo el nombre " +":file:`module.{version}.pyc` dónde la versión codifica el formato del " +"archivo compilado; generalmente contiene el número de version de Python. Por" +" ejemplo, en CPython release 3.3 la version compilada de spam.py sería " +"cacheada como ``__pycache__/spam.cpython-33.pyc``. Este convensión de nombre" +" permite compilar módulos desde diferentes releases y versiones de Python " +"para coexistir." #: ../Doc/tutorial/modules.rst:222 msgid "" @@ -339,6 +355,11 @@ msgid "" "independent, so the same library can be shared among systems with different " "architectures." msgstr "" +"Python chequea la fecha de modificación de la fuente contra la versión " +"compilada para evr si esta es obsoleta y necesita ser recompilada. Esto es " +"un proceso completamente automático. También, los módulos compilados son " +"independientes de la plataforma, así que la misma librería puede ser " +"compartida a través de sistemas con diferentes arquitecturas." #: ../Doc/tutorial/modules.rst:227 msgid "" @@ -346,21 +367,24 @@ msgid "" "recompiles and does not store the result for the module that's loaded " "directly from the command line. Second, it does not check the cache if " "there is no source module. To support a non-source (compiled only) " -"distribution, the compiled module must be in the source directory, and there " -"must not be a source module." +"distribution, the compiled module must be in the source directory, and there" +" must not be a source module." msgstr "" +"Python no chequea el caché en dos circuntancias. Primero, siempre recompila " +"y no graba el resultado del módulo que es cargado directamente desde la " +"línea de comando. Segundo, no chequea el caché si no hay módulo fuente." #: ../Doc/tutorial/modules.rst:234 msgid "Some tips for experts:" -msgstr "" +msgstr "Algunos consejos para expertos:" #: ../Doc/tutorial/modules.rst:236 msgid "" -"You can use the :option:`-O` or :option:`-OO` switches on the Python command " -"to reduce the size of a compiled module. The ``-O`` switch removes assert " +"You can use the :option:`-O` or :option:`-OO` switches on the Python command" +" to reduce the size of a compiled module. The ``-O`` switch removes assert " "statements, the ``-OO`` switch removes both assert statements and __doc__ " -"strings. Since some programs may rely on having these available, you should " -"only use this option if you know what you're doing. \"Optimized\" modules " +"strings. Since some programs may rely on having these available, you should" +" only use this option if you know what you're doing. \"Optimized\" modules " "have an ``opt-`` tag and are usually smaller. Future releases may change " "the effects of optimization." msgstr "" @@ -386,7 +410,7 @@ msgstr "" #: ../Doc/tutorial/modules.rst:258 msgid "Standard Modules" -msgstr "" +msgstr "Módulos estándar" #: ../Doc/tutorial/modules.rst:262 msgid "" @@ -402,61 +426,89 @@ msgid "" "into every Python interpreter. The variables ``sys.ps1`` and ``sys.ps2`` " "define the strings used as primary and secondary prompts::" msgstr "" +"Python viene con una biblioteca de módulos estándar, descrita en un " +"documento separado, la Referencia de la Biblioteca de Python (de aquí en " +"más, \"Referencia de la Biblioteca\"). Algunos módulos se integran en el " +"intérprete; estos proveen acceso a operaciones que no son parte del núcleo " +"del lenguaje pero que sin embargo están integrados, tanto por eficiencia " +"como para proveer acceso a primitivas del sistema operativo, como llamadas " +"al sistema. El conjunto de tales módulos es una opción de configuración el " +"cual también depende de la plataforma subyacente. Por ejemplo, el módulo " +":mod:`winreg` sólo se provee en sistemas Windows. Un módulo en particular " +"merece algo de atención: :mod:`sys`, el que está integrado en todos los " +"intérpretes de Python. Las variables ``sys.ps1`` y ``sys.ps2`` definen las " +"cadenas usadas como cursores primarios y secundarios::" #: ../Doc/tutorial/modules.rst:285 msgid "" "These two variables are only defined if the interpreter is in interactive " "mode." msgstr "" +"Estas dos variables están solamente definidas si el intérprete está en modo " +"interactivo." #: ../Doc/tutorial/modules.rst:287 msgid "" "The variable ``sys.path`` is a list of strings that determines the " "interpreter's search path for modules. It is initialized to a default path " -"taken from the environment variable :envvar:`PYTHONPATH`, or from a built-in " -"default if :envvar:`PYTHONPATH` is not set. You can modify it using " +"taken from the environment variable :envvar:`PYTHONPATH`, or from a built-in" +" default if :envvar:`PYTHONPATH` is not set. You can modify it using " "standard list operations::" msgstr "" +"La variable ``sys.path`` es una lista de cadenas que determinan el camino " +"de búsqueda del intérprete para los módulos. Se inicializa por omisión a un" +" camino tomado de la variable de entorno :envvar:`PYTHONPATH`, o a un valor " +"predefinido en el intérprete si :envvar:`PYTHONPATH` no está configurada. " +"Lo podés modificar usando las operaciones estándar de listas::" #: ../Doc/tutorial/modules.rst:300 msgid "The :func:`dir` Function" -msgstr "" +msgstr "La función :func:`dir`" #: ../Doc/tutorial/modules.rst:302 msgid "" "The built-in function :func:`dir` is used to find out which names a module " "defines. It returns a sorted list of strings::" msgstr "" +"La función integrada :func:`dir` se usa para encontrar qué nombres define un" +" módulo. Devuelve una lista ordenada de cadenas::" #: ../Doc/tutorial/modules.rst:327 msgid "" "Without arguments, :func:`dir` lists the names you have defined currently::" msgstr "" +"Sin argumentos, :func:`dir` lista los nombres que tenés actualmente " +"definidos::" #: ../Doc/tutorial/modules.rst:335 msgid "" "Note that it lists all types of names: variables, modules, functions, etc." msgstr "" +"Notá que lista todos los tipos de nombres: variables, módulos, funciones, " +"etc." #: ../Doc/tutorial/modules.rst:339 msgid "" -":func:`dir` does not list the names of built-in functions and variables. If " -"you want a list of those, they are defined in the standard module :mod:" -"`builtins`::" +":func:`dir` does not list the names of built-in functions and variables. If" +" you want a list of those, they are defined in the standard module " +":mod:`builtins`::" msgstr "" +":func:`dir` no lista los nombres de las funciones y variables integradas. " +"Si querés una lista de esos, están definidos en el módulo estándar " +":mod:`builtins`::" #: ../Doc/tutorial/modules.rst:378 msgid "Packages" -msgstr "" +msgstr "Paquetes" #: ../Doc/tutorial/modules.rst:380 msgid "" "Packages are a way of structuring Python's module namespace by using " -"\"dotted module names\". For example, the module name :mod:`A.B` designates " -"a submodule named ``B`` in a package named ``A``. Just like the use of " +"\"dotted module names\". For example, the module name :mod:`A.B` designates" +" a submodule named ``B`` in a package named ``A``. Just like the use of " "modules saves the authors of different modules from having to worry about " -"each other's global variable names, the use of dotted module names saves the " -"authors of multi-module packages like NumPy or Pillow from having to worry " +"each other's global variable names, the use of dotted module names saves the" +" authors of multi-module packages like NumPy or Pillow from having to worry " "about each other's module names." msgstr "" @@ -474,12 +526,26 @@ msgid "" "operations. Here's a possible structure for your package (expressed in " "terms of a hierarchical filesystem):" msgstr "" +"Suponete que querés designar una colección de módulos (un \"paquete\") para " +"el manejo uniforme de archivos y datos de sonidos. Hay diferentes formatos " +"de archivos de sonido (normalmente reconocidos por su extensión, por " +"ejemplo: :file:`.wav`, :file:`.aiff`, :file:`.au`), por lo que tenés que " +"crear y mantener una colección siempre creciente de módulos para la " +"conversión entre los distintos formatos de archivos. Hay muchas operaciones" +" diferentes que quizás quieras ejecutar en los datos de sonido (como " +"mezclarlos, añadir eco, aplicar una función ecualizadora, crear un efecto " +"estéreo artificial), por lo que ademas estarás escribiendo una lista sin fin" +" de módulos para realizar estas operaciones. Aquí hay una posible " +"estructura para tu paquete (expresados en términos de un sistema jerárquico " +"de archivos):" #: ../Doc/tutorial/modules.rst:425 msgid "" -"When importing the package, Python searches through the directories on ``sys." -"path`` looking for the package subdirectory." +"When importing the package, Python searches through the directories on " +"``sys.path`` looking for the package subdirectory." msgstr "" +"Al importar el paquete, Python busca a través de los directorios en " +"``sys.path``, buscando el subdirectorio del paquete." #: ../Doc/tutorial/modules.rst:428 msgid "" @@ -496,56 +562,75 @@ msgid "" "Users of the package can import individual modules from the package, for " "example::" msgstr "" +"Los usuarios del paquete pueden importar módulos individuales del mismo, por" +" ejemplo::" #: ../Doc/tutorial/modules.rst:440 msgid "" "This loads the submodule :mod:`sound.effects.echo`. It must be referenced " "with its full name. ::" msgstr "" +"Esto carga el submódulo :mod:`sound.effects.echo`. Debe hacerse referencia " +"al mismo con el nombre completo. ::" #: ../Doc/tutorial/modules.rst:445 msgid "An alternative way of importing the submodule is::" -msgstr "" +msgstr "Otra alternativa para importar el submódulos es::" #: ../Doc/tutorial/modules.rst:449 msgid "" "This also loads the submodule :mod:`echo`, and makes it available without " "its package prefix, so it can be used as follows::" msgstr "" +"Esto también carga el submódulo :mod:`echo`, lo deja disponible sin su " +"prefijo de paquete, por lo que puede usarse así::" #: ../Doc/tutorial/modules.rst:454 msgid "" "Yet another variation is to import the desired function or variable " "directly::" msgstr "" +"Otra variación más es importar la función o variable deseadas directamente::" #: ../Doc/tutorial/modules.rst:458 msgid "" -"Again, this loads the submodule :mod:`echo`, but this makes its function :" -"func:`echofilter` directly available::" +"Again, this loads the submodule :mod:`echo`, but this makes its function " +":func:`echofilter` directly available::" msgstr "" +"De nuevo, esto carga el submódulo :mod:`echo`, pero deja directamente " +"disponible a la función :func:`echofilter`::" #: ../Doc/tutorial/modules.rst:463 msgid "" "Note that when using ``from package import item``, the item can be either a " -"submodule (or subpackage) of the package, or some other name defined in the " -"package, like a function, class or variable. The ``import`` statement first " -"tests whether the item is defined in the package; if not, it assumes it is a " -"module and attempts to load it. If it fails to find it, an :exc:" -"`ImportError` exception is raised." -msgstr "" +"submodule (or subpackage) of the package, or some other name defined in the" +" package, like a function, class or variable. The ``import`` statement " +"first tests whether the item is defined in the package; if not, it assumes " +"it is a module and attempts to load it. If it fails to find it, an " +":exc:`ImportError` exception is raised." +msgstr "" +"Notá que al usar ``from package import item`` el ítem puede ser tanto un " +"submódulo (o subpaquete) del paquete, o algún otro nombre definido en el " +"paquete, como una función, clase, o variable. La declaración ``import`` " +"primero verifica si el ítem está definido en el paquete; si no, asume que es" +" un módulo y trata de cargarlo. Si no lo puede encontrar, se genera una " +"excepción :exc:`ImportError`." #: ../Doc/tutorial/modules.rst:470 msgid "" "Contrarily, when using syntax like ``import item.subitem.subsubitem``, each " -"item except for the last must be a package; the last item can be a module or " -"a package but can't be a class or function or variable defined in the " +"item except for the last must be a package; the last item can be a module or" +" a package but can't be a class or function or variable defined in the " "previous item." msgstr "" +"Por otro lado, cuando se usa la sintaxis como ``import " +"item.subitem.subsubitem``, cada ítem excepto el último debe ser un paquete; " +"el mismo puede ser un módulo o un paquete pero no puede ser una clase, " +"función o variable definida en el ítem previo." #: ../Doc/tutorial/modules.rst:479 msgid "Importing \\* From a Package" -msgstr "" +msgstr "Importando \\* desde un paquete" #: ../Doc/tutorial/modules.rst:483 msgid "" @@ -555,46 +640,78 @@ msgid "" "could take a long time and importing sub-modules might have unwanted side-" "effects that should only happen when the sub-module is explicitly imported." msgstr "" +"Ahora, ¿qué sucede cuando el usuario escribe ``from sound.effects import " +"*``? Idealmente, uno esperaría que esto de alguna manera vaya al sistema de " +"archivos, encuentre cuales submódulos están presentes en el paquete, y los " +"importe a todos. Esto puede tardar mucho y el importar sub-módulos puede " +"tener efectos secundarios no deseados que sólo deberían ocurrir cuando se " +"importe explícitamente el sub-módulo." #: ../Doc/tutorial/modules.rst:489 msgid "" "The only solution is for the package author to provide an explicit index of " -"the package. The :keyword:`import` statement uses the following convention: " -"if a package's :file:`__init__.py` code defines a list named ``__all__``, it " -"is taken to be the list of module names that should be imported when ``from " -"package import *`` is encountered. It is up to the package author to keep " -"this list up-to-date when a new version of the package is released. Package " -"authors may also decide not to support it, if they don't see a use for " -"importing \\* from their package. For example, the file :file:`sound/" -"effects/__init__.py` could contain the following code::" -msgstr "" +"the package. The :keyword:`import` statement uses the following convention:" +" if a package's :file:`__init__.py` code defines a list named ``__all__``, " +"it is taken to be the list of module names that should be imported when " +"``from package import *`` is encountered. It is up to the package author to" +" keep this list up-to-date when a new version of the package is released. " +"Package authors may also decide not to support it, if they don't see a use " +"for importing \\* from their package. For example, the file " +":file:`sound/effects/__init__.py` could contain the following code::" +msgstr "" +"La única solución es que el autor del paquete provea un índice explícito del" +" paquete. La declaración :keyword:`import` usa la siguiente convención: si " +"el código del :file:`__init__.py` de un paquete define una lista llamada " +"``__all__``, se toma como la lista de los nombres de módulos que deberían " +"ser importados cuando se hace ``from package import *``. Es tarea del autor" +" del paquete mantener actualizada esta lista cuando se libera una nueva " +"versión del paquete. Los autores de paquetes podrían decidir no soportarlo," +" si no ven un uso para importar \\* en sus paquetes. Por ejemplo, el " +"archivo :file:`sound/effects/__init__.py` podría contener el siguiente " +"código::" #: ../Doc/tutorial/modules.rst:501 msgid "" "This would mean that ``from sound.effects import *`` would import the three " "named submodules of the :mod:`sound` package." msgstr "" +"Esto significaría que ``from sound.effects import *`` importaría esos tres " +"submódulos del paquete :mod:`sound`." #: ../Doc/tutorial/modules.rst:504 msgid "" -"If ``__all__`` is not defined, the statement ``from sound.effects import *`` " -"does *not* import all submodules from the package :mod:`sound.effects` into " -"the current namespace; it only ensures that the package :mod:`sound.effects` " -"has been imported (possibly running any initialization code in :file:" -"`__init__.py`) and then imports whatever names are defined in the package. " -"This includes any names defined (and submodules explicitly loaded) by :file:" -"`__init__.py`. It also includes any submodules of the package that were " -"explicitly loaded by previous :keyword:`import` statements. Consider this " -"code::" -msgstr "" +"If ``__all__`` is not defined, the statement ``from sound.effects import *``" +" does *not* import all submodules from the package :mod:`sound.effects` into" +" the current namespace; it only ensures that the package " +":mod:`sound.effects` has been imported (possibly running any initialization " +"code in :file:`__init__.py`) and then imports whatever names are defined in " +"the package. This includes any names defined (and submodules explicitly " +"loaded) by :file:`__init__.py`. It also includes any submodules of the " +"package that were explicitly loaded by previous :keyword:`import` " +"statements. Consider this code::" +msgstr "" +"Si no se define ``__all__``, la declaración ``from sound.effects import *`` " +"*no* importa todos los submódulos del paquete :mod:`sound.effects` al " +"espacio de nombres actual; sólo se asegura que se haya importado el paquete " +":mod:`sound.effects` (posiblemente ejecutando algún código de inicialización" +" que haya en :file:`__init__.py`) y luego importa aquellos nombres que estén" +" definidos en el paquete. Esto incluye cualquier nombre definido (y " +"submódulos explícitamente cargados) por :file:`__init__.py`. También " +"incluye cualquier submódulo del paquete que pudiera haber sido " +"explícitamente cargado por declaraciones :keyword:`import` previas. " +"Considerá este código::" #: ../Doc/tutorial/modules.rst:517 msgid "" -"In this example, the :mod:`echo` and :mod:`surround` modules are imported in " -"the current namespace because they are defined in the :mod:`sound.effects` " +"In this example, the :mod:`echo` and :mod:`surround` modules are imported in" +" the current namespace because they are defined in the :mod:`sound.effects` " "package when the ``from...import`` statement is executed. (This also works " "when ``__all__`` is defined.)" msgstr "" +"En este ejemplo, los módulos *echo* y *surround* se importan en el espacio " +"de nombre actual porque están definidos en el paquete :mod:`sound.effects` " +"cuando se ejecuta la declaración ``from...import``. (Esto también funciona " +"cuando se define ``__all__``)." #: ../Doc/tutorial/modules.rst:522 msgid "" @@ -602,6 +719,9 @@ msgid "" "certain patterns when you use ``import *``, it is still considered bad " "practice in production code." msgstr "" +"A pesar de que ciertos módulos están diseñados para exportar solo nombres " +"que siguen ciertos patrones cuando usás ``import *``, también se considera " +"una mala práctica en código de producción." #: ../Doc/tutorial/modules.rst:526 msgid "" @@ -613,24 +733,34 @@ msgstr "" #: ../Doc/tutorial/modules.rst:533 msgid "Intra-package References" -msgstr "" +msgstr "Referencias internas en paquetes" #: ../Doc/tutorial/modules.rst:535 msgid "" "When packages are structured into subpackages (as with the :mod:`sound` " -"package in the example), you can use absolute imports to refer to submodules " -"of siblings packages. For example, if the module :mod:`sound.filters." -"vocoder` needs to use the :mod:`echo` module in the :mod:`sound.effects` " -"package, it can use ``from sound.effects import echo``." -msgstr "" +"package in the example), you can use absolute imports to refer to submodules" +" of siblings packages. For example, if the module " +":mod:`sound.filters.vocoder` needs to use the :mod:`echo` module in the " +":mod:`sound.effects` package, it can use ``from sound.effects import echo``." +msgstr "" +"Cuando se estructuran los paquetes en subpaquetes (como en el ejemplo " +":mod:`sound`), podés usar ``import`` absolutos para referirte a submódulos " +"de paquetes hermanos. Por ejemplo, si el módulo " +":mod:`sound.filters.vocoder` necesita usar el módulo :mod:`echo` en el " +"paquete :mod:`sound.effects`, puede hacer ``from sound.effects import " +"echo``." #: ../Doc/tutorial/modules.rst:541 msgid "" "You can also write relative imports, with the ``from module import name`` " "form of import statement. These imports use leading dots to indicate the " -"current and parent packages involved in the relative import. From the :mod:" -"`surround` module for example, you might use::" +"current and parent packages involved in the relative import. From the " +":mod:`surround` module for example, you might use::" msgstr "" +"También podés escribir ``import`` relativos con la forma ``from module " +"import name``. Estos imports usan puntos adelante para indicar los paquetes" +" actual o padres involucrados en el import relativo. En el ejemplo " +":mod:`surround`, podrías hacer::" #: ../Doc/tutorial/modules.rst:550 msgid "" @@ -639,10 +769,14 @@ msgid "" "intended for use as the main module of a Python application must always use " "absolute imports." msgstr "" +"Notá que los imports relativos se basan en el nombre del módulo actual. Ya " +"que el nombre del módulo principal es siempre ``\"__main__\"``, los módulos" +" pensados para usarse como módulo principal de una aplicación Python siempre" +" deberían usar ``import`` absolutos." #: ../Doc/tutorial/modules.rst:556 msgid "Packages in Multiple Directories" -msgstr "" +msgstr "Paquetes en múltiples directorios" #: ../Doc/tutorial/modules.rst:558 msgid "" @@ -652,12 +786,19 @@ msgid "" "This variable can be modified; doing so affects future searches for modules " "and subpackages contained in the package." msgstr "" +"Los paquetes soportan un atributo especial más, :attr:`__path__`. Este se " +"inicializa, antes de que el código en ese archivo se ejecute, a una lista " +"que contiene el nombre del directorio donde está el paquete. Esta variable " +"puede modificarse, afectando búsquedas futuras de módulos y subpaquetes " +"contenidos en el paquete." #: ../Doc/tutorial/modules.rst:564 msgid "" "While this feature is not often needed, it can be used to extend the set of " "modules found in a package." msgstr "" +"Aunque esta característica no se necesita frecuentemente, puede usarse para " +"extender el conjunto de módulos que se encuentran en el paquete." #: ../Doc/tutorial/modules.rst:569 msgid "Footnotes" From a4d592e3603be6188925423c881d8ef251610a25 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Sat, 2 May 2020 17:25:54 +0200 Subject: [PATCH 21/24] stdlib.po translated from pyar tutorial --- .migration/tutorialpyar | 2 +- tutorial/stdlib.po | 85 ++++++++++++++++++++++++++++++----------- 2 files changed, 64 insertions(+), 23 deletions(-) diff --git a/.migration/tutorialpyar b/.migration/tutorialpyar index 8bb4ab0479..e2b12223cb 160000 --- a/.migration/tutorialpyar +++ b/.migration/tutorialpyar @@ -1 +1 @@ -Subproject commit 8bb4ab04790be542df8b4346077fdcac26a09754 +Subproject commit e2b12223cb8ee754129cd31dd32f1a29d4eb0ae5 diff --git a/tutorial/stdlib.po b/tutorial/stdlib.po index d95a348e4e..73223fea75 100644 --- a/tutorial/stdlib.po +++ b/tutorial/stdlib.po @@ -182,38 +182,52 @@ msgid "" "internet protocols. Two of the simplest are :mod:`urllib.request` for " "retrieving data from URLs and :mod:`smtplib` for sending mail::" msgstr "" +"Hay varios módulos para acceder a internet y procesar sus protocolos. Dos " +"de los más simples son :mod:`urllib.request` para traer data de URLs y " +":mod:`smtplib` para mandar correos::" #: ../Doc/tutorial/stdlib.rst:186 -msgid "(Note that the second example needs a mailserver running on localhost.)" +msgid "" +"(Note that the second example needs a mailserver running on localhost.)" msgstr "" +"(Notá que el segundo ejemplo necesita un servidor de correo corriendo en la " +"máquina local)" #: ../Doc/tutorial/stdlib.rst:192 msgid "Dates and Times" -msgstr "" +msgstr "Fechas y tiempos" #: ../Doc/tutorial/stdlib.rst:194 msgid "" -"The :mod:`datetime` module supplies classes for manipulating dates and times " -"in both simple and complex ways. While date and time arithmetic is " -"supported, the focus of the implementation is on efficient member extraction " -"for output formatting and manipulation. The module also supports objects " +"The :mod:`datetime` module supplies classes for manipulating dates and times" +" in both simple and complex ways. While date and time arithmetic is " +"supported, the focus of the implementation is on efficient member extraction" +" for output formatting and manipulation. The module also supports objects " "that are timezone aware. ::" msgstr "" +"El módulo :mod:`datetime` ofrece clases para manejar fechas y tiempos tanto " +"de manera simple como compleja. Aunque soporta aritmética sobre fechas y " +"tiempos, el foco de la implementación es en la extracción eficiente de " +"partes para manejarlas o formatear la salida. El módulo también soporta " +"objetos que son conscientes de la zona horaria. ::" #: ../Doc/tutorial/stdlib.rst:218 msgid "Data Compression" -msgstr "" +msgstr "Compresión de datos" #: ../Doc/tutorial/stdlib.rst:220 msgid "" "Common data archiving and compression formats are directly supported by " -"modules including: :mod:`zlib`, :mod:`gzip`, :mod:`bz2`, :mod:`lzma`, :mod:" -"`zipfile` and :mod:`tarfile`. ::" +"modules including: :mod:`zlib`, :mod:`gzip`, :mod:`bz2`, :mod:`lzma`, " +":mod:`zipfile` and :mod:`tarfile`. ::" msgstr "" +"Los formatos para archivar y comprimir datos se soportan directamente con " +"los módulos: :mod:`zlib`, :mod:`gzip`, :mod:`bz2`, :mod:`lzma`, " +":mod:`zipfile` y :mod:`tarfile`. ::" #: ../Doc/tutorial/stdlib.rst:240 msgid "Performance Measurement" -msgstr "" +msgstr "Medición de rendimiento" #: ../Doc/tutorial/stdlib.rst:242 msgid "" @@ -221,41 +235,62 @@ msgid "" "performance of different approaches to the same problem. Python provides a " "measurement tool that answers those questions immediately." msgstr "" +"Algunos usuarios de Python desarrollan un profundo interés en saber el " +"rendimiento relativo de las diferentes soluciones al mismo problema. Python" +" provee una herramienta de medición que responde esas preguntas " +"inmediatamente." #: ../Doc/tutorial/stdlib.rst:246 msgid "" "For example, it may be tempting to use the tuple packing and unpacking " -"feature instead of the traditional approach to swapping arguments. The :mod:" -"`timeit` module quickly demonstrates a modest performance advantage::" +"feature instead of the traditional approach to swapping arguments. The " +":mod:`timeit` module quickly demonstrates a modest performance advantage::" msgstr "" +"Por ejemplo, puede ser tentador usar la característica de empaquetamiento y " +"desempaquetamiento de las tuplas en lugar de la solución tradicional para " +"intercambiar argumentos. El módulo :mod:`timeit` muestra rapidamente una " +"modesta ventaja de rendimiento::" #: ../Doc/tutorial/stdlib.rst:256 msgid "" -"In contrast to :mod:`timeit`'s fine level of granularity, the :mod:`profile` " -"and :mod:`pstats` modules provide tools for identifying time critical " +"In contrast to :mod:`timeit`'s fine level of granularity, the :mod:`profile`" +" and :mod:`pstats` modules provide tools for identifying time critical " "sections in larger blocks of code." msgstr "" +"En contraste con el fino nivel de granularidad del módulo :mod:`timeit`, los" +" módulos :mod:`profile` y :mod:`pstats` proveen herramientas para " +"identificar secciones críticas de tiempo en bloques de código más grandes." #: ../Doc/tutorial/stdlib.rst:264 msgid "Quality Control" -msgstr "" +msgstr "Control de calidad" #: ../Doc/tutorial/stdlib.rst:266 msgid "" -"One approach for developing high quality software is to write tests for each " -"function as it is developed and to run those tests frequently during the " +"One approach for developing high quality software is to write tests for each" +" function as it is developed and to run those tests frequently during the " "development process." msgstr "" +"Una forma para desarrollar software de alta calidad es escribir pruebas para" +" cada función mientras se la desarrolla, y correr esas pruebas " +"frecuentemente durante el proceso de desarrollo." #: ../Doc/tutorial/stdlib.rst:270 msgid "" "The :mod:`doctest` module provides a tool for scanning a module and " "validating tests embedded in a program's docstrings. Test construction is " "as simple as cutting-and-pasting a typical call along with its results into " -"the docstring. This improves the documentation by providing the user with an " -"example and it allows the doctest module to make sure the code remains true " -"to the documentation::" -msgstr "" +"the docstring. This improves the documentation by providing the user with an" +" example and it allows the doctest module to make sure the code remains true" +" to the documentation::" +msgstr "" +"El módulo :mod:`doctest` provee una herramienta para revisar un módulo y " +"validar las pruebas integradas en las cadenas de documentación (o " +"*docstring*) del programa. La construcción de las pruebas es tan sencillo " +"como cortar y pegar una ejecución típica junto con sus resultados en los " +"docstrings. Esto mejora la documentación al proveer al usuario un ejemplo y" +" permite que el módulo :mod:`doctest` se asegure que el código permanece " +"fiel a la documentación::" #: ../Doc/tutorial/stdlib.rst:288 msgid "" @@ -263,10 +298,13 @@ msgid "" "module, but it allows a more comprehensive set of tests to be maintained in " "a separate file::" msgstr "" +"El módulo :mod:`unittest` necesita más esfuerzo que el módulo " +":mod:`doctest`, pero permite que se mantenga en un archivo separado un " +"conjunto más comprensivo de pruebas::" #: ../Doc/tutorial/stdlib.rst:310 msgid "Batteries Included" -msgstr "" +msgstr "Las pilas incluidas" #: ../Doc/tutorial/stdlib.rst:312 msgid "" @@ -274,6 +312,9 @@ msgid "" "the sophisticated and robust capabilities of its larger packages. For " "example:" msgstr "" +"Python tiene una filosofía de \"pilas incluidas\". Esto se ve mejor en las " +"capacidades robustas y sofisticadas de sus paquetes más grandes. Por " +"ejemplo:" #: ../Doc/tutorial/stdlib.rst:315 msgid "" From 3b5c9d0c4682eff1c4277b8c146de12990669058 Mon Sep 17 00:00:00 2001 From: gilgamezh Date: Sat, 2 May 2020 18:01:41 +0200 Subject: [PATCH 22/24] update stdlib2 translation (migration) --- tutorial/stdlib2.po | 137 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 109 insertions(+), 28 deletions(-) diff --git a/tutorial/stdlib2.po b/tutorial/stdlib2.po index 4063aef7e8..f9a4b99ab7 100644 --- a/tutorial/stdlib2.po +++ b/tutorial/stdlib2.po @@ -135,24 +135,36 @@ msgid "" "details of multiple output formats. This makes it possible to substitute " "custom templates for XML files, plain text reports, and HTML web reports." msgstr "" +"Las plantillas también pueden ser usadas para separar la lógica del programa" +" de los detalles de múltiples formatos de salida. Esto permite sustituir " +"plantillas específicas para archivos XML, reportes en texto plano, y " +"reportes web en HTML." #: ../Doc/tutorial/stdlib2.rst:133 msgid "Working with Binary Data Record Layouts" -msgstr "" +msgstr "Trabajar con registros estructurados conteniendo datos binarios" #: ../Doc/tutorial/stdlib2.rst:135 msgid "" -"The :mod:`struct` module provides :func:`~struct.pack` and :func:`~struct." -"unpack` functions for working with variable length binary record formats. " -"The following example shows how to loop through header information in a ZIP " -"file without using the :mod:`zipfile` module. Pack codes ``\"H\"`` and ``\"I" -"\"`` represent two and four byte unsigned numbers respectively. The ``\"<" -"\"`` indicates that they are standard size and in little-endian byte order::" -msgstr "" +"The :mod:`struct` module provides :func:`~struct.pack` and " +":func:`~struct.unpack` functions for working with variable length binary " +"record formats. The following example shows how to loop through header " +"information in a ZIP file without using the :mod:`zipfile` module. Pack " +"codes ``\"H\"`` and ``\"I\"`` represent two and four byte unsigned numbers " +"respectively. The ``\"<\"`` indicates that they are standard size and in " +"little-endian byte order::" +msgstr "" +"El módulo :mod:`struct` provee las funciones :func:`~struct.pack` y " +":func:`~struct.unpack` para trabajar con formatos de registros binarios de " +"longitud variable. El siguiente ejemplo muestra cómo recorrer la " +"información de encabezado en un archivo ZIP sin usar el módulo " +":mod:`zipfile`. Los códigos ``\"H\"`` e ``\"I\"`` representan números sin " +"signo de dos y cuatro bytes respectivamente. El ``\"<\"`` indica que son de" +" tamaño estándar y los bytes tienen ordenamiento `little-endian`::" #: ../Doc/tutorial/stdlib2.rst:166 msgid "Multi-threading" -msgstr "" +msgstr "Multi-hilos" #: ../Doc/tutorial/stdlib2.rst:168 msgid "" @@ -162,12 +174,20 @@ msgid "" "background. A related use case is running I/O in parallel with computations " "in another thread." msgstr "" +"La técnica de multi-hilos (o multi-threading) permite desacoplar tareas que " +"no tienen dependencia secuencial. Los hilos se pueden usar para mejorar el " +"grado de reacción de las aplicaciones que aceptan entradas del usuario " +"mientras otras tareas se ejecutan en segundo plano. Un caso de uso " +"relacionado es ejecutar E/S en paralelo con cálculos en otro hilo." #: ../Doc/tutorial/stdlib2.rst:173 msgid "" "The following code shows how the high level :mod:`threading` module can run " "tasks in background while the main program continues to run::" msgstr "" +"El código siguiente muestra cómo el módulo de alto nivel :mod:`threading` " +"puede ejecutar tareas en segundo plano mientras el programa principal " +"continúa su ejecución::" #: ../Doc/tutorial/stdlib2.rst:197 msgid "" @@ -176,6 +196,10 @@ msgid "" "module provides a number of synchronization primitives including locks, " "events, condition variables, and semaphores." msgstr "" +"El desafío principal de las aplicaciones multi-hilo es la coordinación entre" +" los hilos que comparten datos u otros recursos. A ese fin, el módulo " +"threading provee una serie de primitivas de sincronización que incluyen " +"locks, eventos, variables de condición, y semáforos." #: ../Doc/tutorial/stdlib2.rst:202 msgid "" @@ -187,31 +211,49 @@ msgid "" "thread communication and coordination are easier to design, more readable, " "and more reliable." msgstr "" +"Aún cuando esas herramientas son poderosas, pequeños errores de diseño " +"pueden resultar en problemas difíciles de reproducir. La forma preferida de" +" coordinar tareas es concentrar todos los accesos a un recurso en un único " +"hilo y después usar el módulo :mod:`queue` para alimentar dicho hilo con " +"pedidos desde otros hilos. Las aplicaciones que usan objetos " +":class:`~queue.Queue` para comunicación y coordinación entre hilos son más " +"fáciles de diseñar, más legibles, y más confiables." #: ../Doc/tutorial/stdlib2.rst:213 msgid "Logging" -msgstr "" +msgstr "Registrando" #: ../Doc/tutorial/stdlib2.rst:215 msgid "" "The :mod:`logging` module offers a full featured and flexible logging " -"system. At its simplest, log messages are sent to a file or to ``sys." -"stderr``::" +"system. At its simplest, log messages are sent to a file or to " +"``sys.stderr``::" msgstr "" +"El módulo :mod:`logging` ofrece un sistema de registros (logs) completo y " +"flexible. En su forma más simple, los mensajes de registro se envían a un " +"archivo o a ``sys.stderr``::" #: ../Doc/tutorial/stdlib2.rst:225 msgid "This produces the following output:" -msgstr "" +msgstr "Ésta es la salida obtenida::" #: ../Doc/tutorial/stdlib2.rst:233 msgid "" "By default, informational and debugging messages are suppressed and the " "output is sent to standard error. Other output options include routing " "messages through email, datagrams, sockets, or to an HTTP Server. New " -"filters can select different routing based on message priority: :const:" -"`~logging.DEBUG`, :const:`~logging.INFO`, :const:`~logging.WARNING`, :const:" -"`~logging.ERROR`, and :const:`~logging.CRITICAL`." -msgstr "" +"filters can select different routing based on message priority: " +":const:`~logging.DEBUG`, :const:`~logging.INFO`, :const:`~logging.WARNING`, " +":const:`~logging.ERROR`, and :const:`~logging.CRITICAL`." +msgstr "" +"De forma predeterminada, los mensajes de depuración e informativos se " +"suprimen, y la salida se envía al error estándar. Otras opciones de salida " +"incluyen mensajes de ruteo a través de correo electrónico, datagramas, " +"sockets, o un servidor HTTP. Nuevos filtros pueden seleccionar diferentes " +"rutas basadas en la prioridad del mensaje: :const:`~logging.DEBUG`, " +":const:`~logging.INFO`, :const:`~logging.WARNING`, :const:`~logging.ERROR`, " +"and :const:`~logging.CRITICAL` (Depuración, Informativo, Atención, Error y " +"Crítico respectivamente)" #: ../Doc/tutorial/stdlib2.rst:240 msgid "" @@ -245,7 +287,7 @@ msgstr "" #: ../Doc/tutorial/stdlib2.rst:289 msgid "Tools for Working with Lists" -msgstr "" +msgstr "Herramientas para trabajar con listas" #: ../Doc/tutorial/stdlib2.rst:291 msgid "" @@ -253,15 +295,24 @@ msgid "" "sometimes there is a need for alternative implementations with different " "performance trade-offs." msgstr "" +"Muchas necesidades de estructuras de datos pueden ser satisfechas con el " +"tipo integrado lista. Sin embargo, a veces se hacen necesarias " +"implementaciones alternativas con rendimientos distintos." #: ../Doc/tutorial/stdlib2.rst:295 msgid "" "The :mod:`array` module provides an :class:`~array.array()` object that is " -"like a list that stores only homogeneous data and stores it more compactly. " -"The following example shows an array of numbers stored as two byte unsigned " -"binary numbers (typecode ``\"H\"``) rather than the usual 16 bytes per entry " -"for regular lists of Python int objects::" -msgstr "" +"like a list that stores only homogeneous data and stores it more compactly." +" The following example shows an array of numbers stored as two byte " +"unsigned binary numbers (typecode ``\"H\"``) rather than the usual 16 bytes " +"per entry for regular lists of Python int objects::" +msgstr "" +"El módulo :mod:`array` provee un objeto :class:`~array.array()` (vector) que" +" es como una lista que almacena sólo datos homogéneos y de una manera más " +"compacta. Los ejemplos a continuación muestran un vector de números " +"guardados como dos números binarios sin signo de dos bytes (código de tipo " +"``\"H\"``) en lugar de los 16 bytes por elemento habituales en listas de " +"objetos int de Python::" #: ../Doc/tutorial/stdlib2.rst:308 msgid "" @@ -270,25 +321,36 @@ msgid "" "but slower lookups in the middle. These objects are well suited for " "implementing queues and breadth first tree searches::" msgstr "" +"El módulo :mod:`collections` provee un objeto :class:`~collections.deque()` " +"que es como una lista más rápida para agregar y quitar elementos por el lado" +" izquierdo pero con búsquedas más lentas por el medio. Estos objetos son " +"adecuados para implementar colas y árboles de búsqueda a lo ancho::" #: ../Doc/tutorial/stdlib2.rst:329 msgid "" "In addition to alternative list implementations, the library also offers " -"other tools such as the :mod:`bisect` module with functions for manipulating " -"sorted lists::" +"other tools such as the :mod:`bisect` module with functions for manipulating" +" sorted lists::" msgstr "" +"Además de las implementaciones alternativas de listas, la biblioteca ofrece " +"otras herramientas como el módulo :mod:`bisect` con funciones para manipular" +" listas ordenadas::" #: ../Doc/tutorial/stdlib2.rst:339 msgid "" "The :mod:`heapq` module provides functions for implementing heaps based on " "regular lists. The lowest valued entry is always kept at position zero. " -"This is useful for applications which repeatedly access the smallest element " -"but do not want to run a full list sort::" +"This is useful for applications which repeatedly access the smallest element" +" but do not want to run a full list sort::" msgstr "" +"El módulo :mod:`heapq` provee funciones para implementar heaps basados en " +"listas comunes. El menor valor ingresado se mantiene en la posición cero. " +"Esto es útil para aplicaciones que acceden a menudo al elemento más chico " +"pero no quieren hacer un orden completo de la lista::" #: ../Doc/tutorial/stdlib2.rst:355 msgid "Decimal Floating Point Arithmetic" -msgstr "" +msgstr "Aritmética de punto flotante decimal" #: ../Doc/tutorial/stdlib2.rst:357 msgid "" @@ -296,6 +358,10 @@ msgid "" "decimal floating point arithmetic. Compared to the built-in :class:`float` " "implementation of binary floating point, the class is especially helpful for" msgstr "" +"El módulo :mod:`decimal` provee un tipo de dato :class:`~decimal.Decimal` " +"para soportar aritmética de punto flotante decimal. Comparado con " +":class:`float`, la implementación de punto flotante binario incluida, la " +"clase es muy útil especialmente para:" #: ../Doc/tutorial/stdlib2.rst:361 msgid "" @@ -327,6 +393,10 @@ msgid "" "results in decimal floating point and binary floating point. The difference " "becomes significant if the results are rounded to the nearest cent::" msgstr "" +"Por ejemplo, calcular un impuesto del 5% de una tarifa telefónica de 70 " +"centavos da resultados distintos con punto flotante decimal y punto flotante" +" binario. La diferencia se vuelve significativa si los resultados se " +"redondean al centavo más próximo::" #: ../Doc/tutorial/stdlib2.rst:379 msgid "" @@ -336,6 +406,12 @@ msgid "" "issues that can arise when binary floating point cannot exactly represent " "decimal quantities." msgstr "" +"El resultado con :class:`~decimal.Decimal` conserva un cero al final, " +"calculando automáticamente cuatro cifras significativas a partir de los " +"multiplicandos con dos cifras significativas. Decimal reproduce la " +"matemática como se la hace a mano, y evita problemas que pueden surgir " +"cuando el punto flotante binario no puede representar exactamente cantidades" +" decimales." #: ../Doc/tutorial/stdlib2.rst:385 msgid "" @@ -343,9 +419,14 @@ msgid "" "modulo calculations and equality tests that are unsuitable for binary " "floating point::" msgstr "" +"La representación exacta permite a la clase :class:`~decimal.Decimal` hacer " +"cálculos de modulo y pruebas de igualdad que son inadecuadas para punto " +"flotante binario::" #: ../Doc/tutorial/stdlib2.rst:399 msgid "" "The :mod:`decimal` module provides arithmetic with as much precision as " "needed::" msgstr "" +"El módulo :mod:`decimal` provee aritmética con tanta precisión como haga " +"falta::" From edd15055bde8175617dac2322089543e44a1305a Mon Sep 17 00:00:00 2001 From: gilgamezh Date: Sat, 2 May 2020 18:02:34 +0200 Subject: [PATCH 23/24] update stdlib2 translation (migration) --- tutorial/stdlib2.po | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tutorial/stdlib2.po b/tutorial/stdlib2.po index f9a4b99ab7..eb26c286ea 100644 --- a/tutorial/stdlib2.po +++ b/tutorial/stdlib2.po @@ -261,10 +261,13 @@ msgid "" "from a user editable configuration file for customized logging without " "altering the application." msgstr "" +"El sistema de registro puede configurarse directamente desde Python o puede " +"cargarse la configuración desde un archivo editable por el usuario para " +"personalizar el registro sin alterar la aplicación." #: ../Doc/tutorial/stdlib2.rst:248 msgid "Weak References" -msgstr "" +msgstr "Referencias débiles" #: ../Doc/tutorial/stdlib2.rst:250 msgid "" @@ -272,6 +275,10 @@ msgid "" "and :term:`garbage collection` to eliminate cycles). The memory is freed " "shortly after the last reference to it has been eliminated." msgstr "" +"Python realiza administración de memoria automática (cuenta de referencias " +"para la mayoría de los objetos, y `garbage collection` (recolección de " +"basura) para eliminar ciclos). La memoria se libera poco después de que la " +"última referencia a la misma haya sido eliminada." #: ../Doc/tutorial/stdlib2.rst:254 msgid "" From 322f1a723536f552d2f90d8c77d5d1ecc4630f8f Mon Sep 17 00:00:00 2001 From: gilgamezh Date: Sat, 2 May 2020 18:08:22 +0200 Subject: [PATCH 24/24] update submodule --- .migration/tutorialpyar | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.migration/tutorialpyar b/.migration/tutorialpyar index e2b12223cb..0349d894bf 160000 --- a/.migration/tutorialpyar +++ b/.migration/tutorialpyar @@ -1 +1 @@ -Subproject commit e2b12223cb8ee754129cd31dd32f1a29d4eb0ae5 +Subproject commit 0349d894bfa3545ded8b596867d64d9578a83e8d