# Copyright (C) 2001-2020, Python Software Foundation # This file is distributed under the same license as the Python package. # Maintained by the python-doc-es workteam. # docs-es@python.org / # https://mail.python.org/mailman3/lists/docs-es.python.org/ # Check https://github.com/python/python-docs-es/blob/3.8/TRANSLATORS to # get the list of volunteers # msgid "" msgstr "" "Project-Id-Version: Python 3.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-10-25 19:47+0200\n" "PO-Revision-Date: 2021-08-07 15:42+0200\n" "Last-Translator: Cristián Maureira-Fredes \n" "Language: es\n" "Language-Team: python-doc-es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.10.3\n" #: ../Doc/library/difflib.rst:2 msgid ":mod:`difflib` --- Helpers for computing deltas" msgstr ":mod:`difflib` --- Funciones auxiliares para calcular deltas" #: ../Doc/library/difflib.rst:11 msgid "**Source code:** :source:`Lib/difflib.py`" msgstr "**Código fuente:** :source:`Lib/difflib.py`" #: ../Doc/library/difflib.rst:20 msgid "" "This module provides classes and functions for comparing sequences. It can " "be used for example, for comparing files, and can produce information about " "file differences in various formats, including HTML and context and unified " "diffs. For comparing directories and files, see also, the :mod:`filecmp` " "module." msgstr "" "Este módulo proporciona clases y funciones para comparar secuencias. Se " "puede utilizar, por ejemplo, para comparar archivos y puede producir " "información sobre diferencias de archivo en varios formatos, incluidos HTML " "y contexto y diferencias unificadas. Para comparar directorios y archivos, " "consulte también el módulo :mod:`filecmp`." #: ../Doc/library/difflib.rst:29 msgid "" "This is a flexible class for comparing pairs of sequences of any type, so " "long as the sequence elements are :term:`hashable`. The basic algorithm " "predates, and is a little fancier than, an algorithm published in the late " "1980's by Ratcliff and Obershelp under the hyperbolic name \"gestalt pattern " "matching.\" The idea is to find the longest contiguous matching subsequence " "that contains no \"junk\" elements; these \"junk\" elements are ones that " "are uninteresting in some sense, such as blank lines or whitespace. " "(Handling junk is an extension to the Ratcliff and Obershelp algorithm.) The " "same idea is then applied recursively to the pieces of the sequences to the " "left and to the right of the matching subsequence. This does not yield " "minimal edit sequences, but does tend to yield matches that \"look right\" " "to people." msgstr "" "Esta es una clase flexible para comparar pares de secuencias de cualquier " "tipo, siempre que los elementos de la secuencia sean :term:`hashable`. El " "algoritmo básico es anterior, y un poco mas agradable, que el publicado a " "fines de los 80' por Ratcliff y Obershelp, bajo el nombre hiperbólico de " "\"*gestalt pattern matching*\". La idea es encontrar la subsecuencia " "coincidente contigua mas larga que no contenga elementos \"no deseados\"; " "estos elementos \"no deseados\" son aquellos que no son de interés por algún " "motivo, como ser lineas en blanco o espacios. (El tratamiento de elementos " "no deseados es una extensión al algoritmo de Ratcliff y Obershelp). La misma " "idea se aplica recursivamente a las partes de la secuencia a la derecha e " "izquierda de cada subsecuencia correspondiente. Esto no proporciona " "secuencias de edición mínimas, pero tiende a producir coincidencias que " "\"parecen correctas\" a las personas." #: ../Doc/library/difflib.rst:41 msgid "" "**Timing:** The basic Ratcliff-Obershelp algorithm is cubic time in the " "worst case and quadratic time in the expected case. :class:`SequenceMatcher` " "is quadratic time for the worst case and has expected-case behavior " "dependent in a complicated way on how many elements the sequences have in " "common; best case time is linear." msgstr "" "**Complejidad temporal:** En el peor de los casos el algoritmo Ratcliff-" "Obershelp básico es de complejidad cúbica y de complejidad temporal " "cuadrática en el caso esperado. :class:`SequenceMatcher` es de complejidad " "temporal cuadrática en el peor de los casos y el comportamiento del caso " "esperado depende de manera complicada de cuántos elementos tienen en común " "las secuencias; en el mejor de los casos la complejidad temporal es lineal." #: ../Doc/library/difflib.rst:47 #, python-format msgid "" "**Automatic junk heuristic:** :class:`SequenceMatcher` supports a heuristic " "that automatically treats certain sequence items as junk. The heuristic " "counts how many times each individual item appears in the sequence. If an " "item's duplicates (after the first one) account for more than 1% of the " "sequence and the sequence is at least 200 items long, this item is marked as " "\"popular\" and is treated as junk for the purpose of sequence matching. " "This heuristic can be turned off by setting the ``autojunk`` argument to " "``False`` when creating the :class:`SequenceMatcher`." msgstr "" "**Heurística automática de elementos no deseados:** :class:`SequenceMatcher` " "implementa un método heurístico que identifica automáticamente a ciertos " "elementos como no deseados. El método heurístico consiste en contar " "cuantas veces aparece cada elemento en la secuencia. Si las apariciones del " "duplicado de un elemento (después del primero) contabilizan mas del 1% de la " "secuencia, y a su vez la secuencia contiene mas de 200 elementos, este es " "identificado como \"popular\" y es considerado no deseado. Este método " "heurístico puede desactivarse estableciendo el argumento ``autojunk`` como " "``False`` al crear la clase :class:`SequenceMatcher`." #: ../Doc/library/difflib.rst:55 ../Doc/library/difflib.rst:388 msgid "The *autojunk* parameter." msgstr "El parámetro *autojunk*." #: ../Doc/library/difflib.rst:61 msgid "" "This is a class for comparing sequences of lines of text, and producing " "human-readable differences or deltas. Differ uses :class:`SequenceMatcher` " "both to compare sequences of lines, and to compare sequences of characters " "within similar (near-matching) lines." msgstr "" "Esta clase se utiliza para comparar secuencias de lineas de texto y producir " "diferencias o deltas en una forma legible por humanos. Differ usa :class:" "`SequenceMatcher` tanto para comparar secuencias de lineas, como para " "comparar secuencias de caracteres entre lineas similares." #: ../Doc/library/difflib.rst:66 msgid "Each line of a :class:`Differ` delta begins with a two-letter code:" msgstr "" "Cada linea de un delta de :class:`Differ` comienza con un código de dos " "letras:" #: ../Doc/library/difflib.rst:69 msgid "Code" msgstr "Código" #: ../Doc/library/difflib.rst:69 ../Doc/library/difflib.rst:498 msgid "Meaning" msgstr "Significado" #: ../Doc/library/difflib.rst:71 msgid "``'- '``" msgstr "``'- '``" #: ../Doc/library/difflib.rst:71 msgid "line unique to sequence 1" msgstr "línea única para la secuencia 1" #: ../Doc/library/difflib.rst:73 msgid "``'+ '``" msgstr "``'+ '``" #: ../Doc/library/difflib.rst:73 msgid "line unique to sequence 2" msgstr "línea única para la secuencia 2" #: ../Doc/library/difflib.rst:75 msgid "``' '``" msgstr "``' '``" #: ../Doc/library/difflib.rst:75 msgid "line common to both sequences" msgstr "línea común a ambas secuencias" #: ../Doc/library/difflib.rst:77 msgid "``'? '``" msgstr "``'? '``" #: ../Doc/library/difflib.rst:77 msgid "line not present in either input sequence" msgstr "línea ausente en todas las secuencias de entrada" #: ../Doc/library/difflib.rst:80 msgid "" "Lines beginning with '``?``' attempt to guide the eye to intraline " "differences, and were not present in either input sequence. These lines can " "be confusing if the sequences contain tab characters." msgstr "" "Las líneas que empiezan con '``?``' intentan guiar al ojo hacia las " "diferencias intralíneas, y no estuvieron presentes en ninguna de las " "secuencias de entrada. Estas líneas pueden ser confusas si la secuencia " "contiene caracteres de tabulación." #: ../Doc/library/difflib.rst:87 msgid "" "This class can be used to create an HTML table (or a complete HTML file " "containing the table) showing a side by side, line by line comparison of " "text with inter-line and intra-line change highlights. The table can be " "generated in either full or contextual difference mode." msgstr "" "Esta clase puede ser usada para crear una tabla HTML (o un archivo HTML " "completo que contenga la tabla) mostrando comparaciones lado a lado y linea " "por linea del texto, con cambios interlineales e intralineales. La tabla se " "puede generar en modo de diferencia completa o contextual." #: ../Doc/library/difflib.rst:92 msgid "The constructor for this class is:" msgstr "El constructor de esta clase es:" #: ../Doc/library/difflib.rst:97 msgid "Initializes instance of :class:`HtmlDiff`." msgstr "Inicializa una instancia de :class:`HtmlDiff`." #: ../Doc/library/difflib.rst:99 msgid "" "*tabsize* is an optional keyword argument to specify tab stop spacing and " "defaults to ``8``." msgstr "" "*tabsize* es un argumento por palabra clave opcional para especificar el " "espaciado de tabulación. Su valor predeterminado es ``8``." #: ../Doc/library/difflib.rst:102 msgid "" "*wrapcolumn* is an optional keyword to specify column number where lines are " "broken and wrapped, defaults to ``None`` where lines are not wrapped." msgstr "" "*wrapcolumn* es un argumento por palabra clave opcional para especificar el " "número de columnas donde las lineas serán divididas y ajustadas al ancho de " "columna, su valor por defecto es ``None``, donde las lineas no son ajustadas." #: ../Doc/library/difflib.rst:105 msgid "" "*linejunk* and *charjunk* are optional keyword arguments passed into :func:" "`ndiff` (used by :class:`HtmlDiff` to generate the side by side HTML " "differences). See :func:`ndiff` documentation for argument default values " "and descriptions." msgstr "" "*linejunk* y *charjunk* son argumentos por palabra clave opcionales que " "serán pasados a :func:`ndiff` (que es utilizado por :class:`HtmlDiff` para " "generar las diferencias lado a lado en HTML). Refiérase a la documentación " "de :func:`ndiff` para conocer los detalles y valores por defecto de sus " "argumentos." #: ../Doc/library/difflib.rst:109 msgid "The following methods are public:" msgstr "Los siguientes métodos son públicos:" #: ../Doc/library/difflib.rst:114 msgid "" "Compares *fromlines* and *tolines* (lists of strings) and returns a string " "which is a complete HTML file containing a table showing line by line " "differences with inter-line and intra-line changes highlighted." msgstr "" "Compara *fromlines* y *tolines* (listas de cadenas de texto) y retorna una " "cadena de caracteres que representa un archivo HTML completo que contiene " "una tabla mostrando diferencias línea por línea del texto con cambios " "interlineales e intralineales resaltados." #: ../Doc/library/difflib.rst:118 msgid "" "*fromdesc* and *todesc* are optional keyword arguments to specify from/to " "file column header strings (both default to an empty string)." msgstr "" "*fromdesc* y *todesc* son argumentos por palabra clave opcionales para " "especificar los encabezados de las columnas desde *fromdesc* hasta *todesc* " "en el archivo (ambas cadenas están vacías por defecto)." #: ../Doc/library/difflib.rst:121 msgid "" "*context* and *numlines* are both optional keyword arguments. Set *context* " "to ``True`` when contextual differences are to be shown, else the default is " "``False`` to show the full files. *numlines* defaults to ``5``. When " "*context* is ``True`` *numlines* controls the number of context lines which " "surround the difference highlights. When *context* is ``False`` *numlines* " "controls the number of lines which are shown before a difference highlight " "when using the \"next\" hyperlinks (setting to zero would cause the \"next\" " "hyperlinks to place the next difference highlight at the top of the browser " "without any leading context)." msgstr "" "*context* y *numlines* son parámetros opcionales. Establezca *context* como " "``True`` para mostrar diferencias contextuales, de lo contrario su valor por " "defecto es ``False`` que muestra los archivos completos. El valor por " "defecto de *numlines* es ``5``. Cuando *context* es ``True``, *numlines* " "controla el número de lineas de contexto que rodean las diferencias " "resaltadas. Cuando *context* es ``False``, *numlines* controla el número de " "líneas que se muestran antes de una diferencia resaltada cuando se usan los " "hipervínculos \"next\" (un valor de cero produce que los hipervínculos " "\"next\" ubiquen el siguiente resaltado en la parte superior del navegador, " "sin ningún contexto principal)." #: ../Doc/library/difflib.rst:132 msgid "" "*fromdesc* and *todesc* are interpreted as unescaped HTML and should be " "properly escaped while receiving input from untrusted sources." msgstr "" "*fromdesc* y *todesc* se interpretan como HTML no escapado y se deben " "escapar correctamente si los datos son recibidos de fuentes no confiables." #: ../Doc/library/difflib.rst:135 msgid "" "*charset* keyword-only argument was added. The default charset of HTML " "document changed from ``'ISO-8859-1'`` to ``'utf-8'``." msgstr "" "Se agregó el argumento sólo de palabra clave *charset*. La codificación de " "caracteres por defecto para documentos HTML se cambió de ``'ISO-8859-1'`` a " "``'utf-8'``." #: ../Doc/library/difflib.rst:141 msgid "" "Compares *fromlines* and *tolines* (lists of strings) and returns a string " "which is a complete HTML table showing line by line differences with inter-" "line and intra-line changes highlighted." msgstr "" "Compara *fromlines* y *tolines* (listas de cadenas de texto) y retorna una " "cadena de caracteres que representa una tabla HTML mostrando comparaciones " "lado a lado y línea por línea del texto con cambios interlineales e " "intralineales." #: ../Doc/library/difflib.rst:145 msgid "" "The arguments for this method are the same as those for the :meth:" "`make_file` method." msgstr "" "Los argumentos para este método son los mismos que los del método :meth:" "`make_file`." #: ../Doc/library/difflib.rst:148 msgid "" ":file:`Tools/scripts/diff.py` is a command-line front-end to this class and " "contains a good example of its use." msgstr "" ":file:`Tools/scripts/diff.py` es una herramienta de línea de comandos para " "esta clase y contiene un buen ejemplo sobre su uso." #: ../Doc/library/difflib.rst:154 msgid "" "Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " "generating the delta lines) in context diff format." msgstr "" "Compara *a* y *b* (listas de cadenas de texto); retorna un delta (un :term:" "`generator` que genera las lineas delta) en formato de diferencias de " "contexto." #: ../Doc/library/difflib.rst:157 msgid "" "Context diffs are a compact way of showing just the lines that have changed " "plus a few lines of context. The changes are shown in a before/after " "style. The number of context lines is set by *n* which defaults to three." msgstr "" "El formato de diferencias de contexto es una forma compacta de mostrar " "solamente las líneas que fueron modificadas y algunas líneas adicionales de " "contexto. Los cambios son mostrados utilizando el estilo antes/después. El " "número de líneas de contexto es determinado por *n*, cuyo valor por defecto " "es ``3``." #: ../Doc/library/difflib.rst:161 msgid "" "By default, the diff control lines (those with ``***`` or ``---``) are " "created with a trailing newline. This is helpful so that inputs created " "from :func:`io.IOBase.readlines` result in diffs that are suitable for use " "with :func:`io.IOBase.writelines` since both the inputs and outputs have " "trailing newlines." msgstr "" "Por defecto, las líneas de control (aquellas que comienzan con ``***`` o " "``---``) son creadas con una línea nueva. Esto es de ayuda para que las " "entradas creadas por :func:`io.IOBase.readlines` generen diferencias que " "puedan ser utilizadas con :func:`io.IOBase.writelines` ya que ambas, la " "entrada y la salida, tienen líneas nuevas al final." #: ../Doc/library/difflib.rst:167 ../Doc/library/difflib.rst:298 msgid "" "For inputs that do not have trailing newlines, set the *lineterm* argument " "to ``\"\"`` so that the output will be uniformly newline free." msgstr "" "Para entradas que no tienen nuevas líneas finales, establezca el argumento " "*lineterm* como ``\"\"`` de forma que la salida sea uniforme y libre de " "nuevas líneas." #: ../Doc/library/difflib.rst:170 ../Doc/library/difflib.rst:301 msgid "" "The context diff format normally has a header for filenames and modification " "times. Any or all of these may be specified using strings for *fromfile*, " "*tofile*, *fromfiledate*, and *tofiledate*. The modification times are " "normally expressed in the ISO 8601 format. If not specified, the strings " "default to blanks." msgstr "" "El formato de diferencias de contexto normalmente tiene un encabezado para " "nombres de archivos y tiempos de modificaciones. Alguno o todos estos debe " "ser especificado utilizando las cadenas de texto para *fromfile*, *tofile*, " "*fromfiledate* y *tofiledate*. Los tiempos de modificación son normalmente " "expresados en formato ISO 8601. Si no es especificado las cadenas por " "defecto son espacios en blanco." #: ../Doc/library/difflib.rst:193 ../Doc/library/difflib.rst:322 msgid "See :ref:`difflib-interface` for a more detailed example." msgstr "Vea :ref:`difflib-interface` para un ejemplo mas detallado." #: ../Doc/library/difflib.rst:198 msgid "" "Return a list of the best \"good enough\" matches. *word* is a sequence for " "which close matches are desired (typically a string), and *possibilities* is " "a list of sequences against which to match *word* (typically a list of " "strings)." msgstr "" "Retorna una lista de las mejores coincidencias \"lo suficientemente " "buenas\". *word* es una secuencia para la cual coincidencias cercanas son " "deseadas (usualmente una cadena de texto), y *possibilities* es una lista de " "secuencias contra la cual se compara *word* (comúnmente una lista de cadenas " "de caracteres)." #: ../Doc/library/difflib.rst:202 msgid "" "Optional argument *n* (default ``3``) is the maximum number of close matches " "to return; *n* must be greater than ``0``." msgstr "" "Argumento opcional *n* (por defecto ``3``) es el máximo número de " "coincidencias cercanas a retornar; *n* debe ser mayor que ``0``." #: ../Doc/library/difflib.rst:205 msgid "" "Optional argument *cutoff* (default ``0.6``) is a float in the range [0, 1]. " "Possibilities that don't score at least that similar to *word* are ignored." msgstr "" "Argumento opcional *cutoff* (por defecto ``0.6``) es un flotante en el rango " "[0, 1]. Las posibilidades que no alcanzan un puntaje al menos similar al de " "*word* son ignoradas." #: ../Doc/library/difflib.rst:208 msgid "" "The best (no more than *n*) matches among the possibilities are returned in " "a list, sorted by similarity score, most similar first." msgstr "" "Las mejores (no mas de *n*) coincidencias entre las posibilidades son " "retornadas en una lista, ordenadas por similitud de puntaje, las mas " "similares primero." #: ../Doc/library/difflib.rst:224 msgid "" "Compare *a* and *b* (lists of strings); return a :class:`Differ`\\ -style " "delta (a :term:`generator` generating the delta lines)." msgstr "" "Compara *a* y *b* (listas de cadenas de texto); retorna un delta del estilo :" "class:`Differ` (un :term:`generator` que genera los deltas de las líneas)." #: ../Doc/library/difflib.rst:227 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are filtering " "functions (or ``None``):" msgstr "" "Parámetros de palabra clave opcional *linejunk* y *charjunk* son funciones " "de filtrado (o ``None``):" #: ../Doc/library/difflib.rst:230 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk, or false if not. The default is ``None``. There " "is also a module-level function :func:`IS_LINE_JUNK`, which filters out " "lines without visible characters, except for at most one pound character " "(``'#'``) -- however the underlying :class:`SequenceMatcher` class does a " "dynamic analysis of which lines are so frequent as to constitute noise, and " "this usually works better than using this function." msgstr "" "*linejunk*: Una función que acepta una sola cadena de caracteres como " "argumento, y retorna verdadero si la cadena de texto es un elemento no " "deseado, o falso si no lo es. Su valor por defecto es ``None``. Hay también " "una función a nivel del módulo :func:`IS_LINE_JUNK`, que filtra líneas sin " "caracteres visibles, excepto como mucho un carácter de libra (``'#'``) -- de " "cualquier forma la clase subyacente :class:`SequenceMatcher` realiza un " "análisis dinámico sobre cuáles lineas son tan frecuentes como para " "constituir ruido, y esto usualmente funciona mejor que utilizando esta " "función." #: ../Doc/library/difflib.rst:238 msgid "" "*charjunk*: A function that accepts a character (a string of length 1), and " "returns if the character is junk, or false if not. The default is module-" "level function :func:`IS_CHARACTER_JUNK`, which filters out whitespace " "characters (a blank or tab; it's a bad idea to include newline in this!)." msgstr "" "*charjunk*: Una función que acepta un carácter (una cadena de caracteres de " "longitud 1) como argumento, y retorna `True` si el carácter es un elemento " "no deseado, o `False` si no lo es. El valor por defecto es una función a " "nivel del módulo :func:`IS_CHARACTER_JUNK`, que filtra caracteres de " "espacios en blanco (un espacio en blanco o tabulación; es una mala idea " "incluir saltos de lineas en esto!)" #: ../Doc/library/difflib.rst:243 msgid "" ":file:`Tools/scripts/ndiff.py` is a command-line front-end to this function." msgstr "" ":file:`Tools/scripts/ndiff.py` es una interfaz de línea de comandos para " "esta función." #: ../Doc/library/difflib.rst:261 msgid "Return one of the two sequences that generated a delta." msgstr "Retorna uno de las dos secuencias que generaron un delta." #: ../Doc/library/difflib.rst:263 msgid "" "Given a *sequence* produced by :meth:`Differ.compare` or :func:`ndiff`, " "extract lines originating from file 1 or 2 (parameter *which*), stripping " "off line prefixes." msgstr "" "Dada una *sequence* producida por :meth:`Differ.compare` o :func:`ndiff`, " "extrae las líneas originadas por el archivo 1 o 2 (parámetro *which*), " "quitando los prefijos de la línea." #: ../Doc/library/difflib.rst:267 msgid "Example:" msgstr "Ejemplo:" #: ../Doc/library/difflib.rst:284 msgid "" "Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " "generating the delta lines) in unified diff format." msgstr "" "Compara *a* y *b* (listas de cadenas de caracteres); retorna un delta (un :" "term:`generator` que genera los delta de líneas) en formato de diferencias " "unificado." #: ../Doc/library/difflib.rst:287 msgid "" "Unified diffs are a compact way of showing just the lines that have changed " "plus a few lines of context. The changes are shown in an inline style " "(instead of separate before/after blocks). The number of context lines is " "set by *n* which defaults to three." msgstr "" "Las diferencias unificadas son una forma compacta de mostrar sólo las líneas " "que presentan cambios y algunas líneas de contexto adicionales. Los cambios " "son mostrados en una sola línea (en lugar de bloques separados antes y " "después). El número de líneas de contexto se establece mediante *n*, cuyo " "valor por defecto es tres." #: ../Doc/library/difflib.rst:292 msgid "" "By default, the diff control lines (those with ``---``, ``+++``, or ``@@``) " "are created with a trailing newline. This is helpful so that inputs created " "from :func:`io.IOBase.readlines` result in diffs that are suitable for use " "with :func:`io.IOBase.writelines` since both the inputs and outputs have " "trailing newlines." msgstr "" "Por defecto, las líneas de control de diferencias (aquellas con ``---``, ``++" "+``, o ``@@``) son creadas con un salto de línea nuevo. Esto es de ayuda " "para que las entradas creadas por :func:`io.IOBase.readlines` generen " "diferencias que puedan ser utilizadas con :func:`io.IOBase.writelines` ya " "que ambas, la entrada y la salida, tienen líneas nuevas al final." #: ../Doc/library/difflib.rst:326 msgid "" "Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a sequence " "of delta lines (also bytes) in the format returned by *dfunc*. *dfunc* must " "be a callable, typically either :func:`unified_diff` or :func:`context_diff`." msgstr "" "Compara *a* y *b* (listas de objetos de bytes) usando *dfunc*; produce una " "secuencia de líneas delta (también bytes) en el formato retornado por " "*dfunc*. *dfunc* debe ser invocable, comúnmente cualquiera de :func:" "`unified_diff` o :func:`context_diff`." #: ../Doc/library/difflib.rst:331 msgid "" "Allows you to compare data with unknown or inconsistent encoding. All inputs " "except *n* must be bytes objects, not str. Works by losslessly converting " "all inputs (except *n*) to str, and calling ``dfunc(a, b, fromfile, tofile, " "fromfiledate, tofiledate, n, lineterm)``. The output of *dfunc* is then " "converted back to bytes, so the delta lines that you receive have the same " "unknown/inconsistent encodings as *a* and *b*." msgstr "" "Permite comparar datos con codificación desconocida o inconsistente. Todas " "las entradas, excepto *n*, deben ser objetos de bytes, no cadenas de texto. " "Funciona convirtiendo sin pérdidas todas las entradas (excepto *n*) a " "cadenas de texto, e invoca ``dfunc(a, b, fromfile, tofile, fromfiledate, " "tofiledate, n, lineterm)``. La salida de *dfunc* es entonces convertida " "nuevamente a bytes, de forma que las líneas delta que son recibidas tienen " "la misma codificación desconocida/inconsistente que *a* y *b*." #: ../Doc/library/difflib.rst:342 msgid "" "Return ``True`` for ignorable lines. The line *line* is ignorable if *line* " "is blank or contains a single ``'#'``, otherwise it is not ignorable. Used " "as a default for parameter *linejunk* in :func:`ndiff` in older versions." msgstr "" "Retorna ``True`` para líneas que deben ser ignoradas. La línea *line* es " "ignorada si *line* es un espacio vacío o contiene un solo ``'#'``, en " "cualquier otro caso no es ignorado. Es usado como valor por defecto para el " "parámetro *linejunk* por :func:`ndiff` en versiones anteriores." #: ../Doc/library/difflib.rst:349 msgid "" "Return ``True`` for ignorable characters. The character *ch* is ignorable " "if *ch* is a space or tab, otherwise it is not ignorable. Used as a default " "for parameter *charjunk* in :func:`ndiff`." msgstr "" "Retorna ``True`` para los caracteres que deben ser ignorados. El carácter " "*ch* es ignorado si *ch* es un espacio en blanco o tabulación, en cualquier " "otro caso no es ignorado. Es utilizado como valor por defecto para el " "parámetro *charjunk* en :func:`ndiff`." #: ../Doc/library/difflib.rst:357 #, fuzzy msgid "" "`Pattern Matching: The Gestalt Approach `_" msgstr "" "`Pattern Matching: The Gestalt Approach `_" #: ../Doc/library/difflib.rst:357 #, fuzzy msgid "" "Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. " "This was published in `Dr. Dobb's Journal `_ in " "July, 1988." msgstr "" "Discusión de un algoritmo similar por John W. Ratcliff y D. E. Metzener. " "Esto fue publicado en `Dr. Dobb's Journal `_ en " "Julio de 1988." #: ../Doc/library/difflib.rst:364 msgid "SequenceMatcher Objects" msgstr "Objetos *SequenceMatcher*" #: ../Doc/library/difflib.rst:366 msgid "The :class:`SequenceMatcher` class has this constructor:" msgstr "La clase :class:`SequenceMatcher` tiene este constructor:" #: ../Doc/library/difflib.rst:371 msgid "" "Optional argument *isjunk* must be ``None`` (the default) or a one-argument " "function that takes a sequence element and returns true if and only if the " "element is \"junk\" and should be ignored. Passing ``None`` for *isjunk* is " "equivalent to passing ``lambda x: False``; in other words, no elements are " "ignored. For example, pass::" msgstr "" "El argumento opcional *isjunk* debe ser ``None`` (que es su valor por " "defecto) o una función de un solo argumento que reciba un elemento de la " "secuencia y retorne verdadero si y solo si el elemento es no deseado y deba " "ser ignorado. Pasar el argumento *isjunk* como ``None`` es equivalente a " "pasar ``lambda x: False``; en otras palabras, ningún elemento es ignorado. " "Por ejemplo, pasar:" #: ../Doc/library/difflib.rst:379 msgid "" "if you're comparing lines as sequences of characters, and don't want to " "synch up on blanks or hard tabs." msgstr "" "si se están comparando líneas como secuencias de caracteres, y no se quiere " "sincronizar en espacios blancos o tabulaciones." #: ../Doc/library/difflib.rst:382 msgid "" "The optional arguments *a* and *b* are sequences to be compared; both " "default to empty strings. The elements of both sequences must be :term:" "`hashable`." msgstr "" "Los argumentos opcionales *a* y *b* son las secuencias a comparar; ambos " "tienen como valor por defecto una cadena de texto vacía. Los elementos de " "ambas secuencias deben ser :term:`hashable`." #: ../Doc/library/difflib.rst:385 msgid "" "The optional argument *autojunk* can be used to disable the automatic junk " "heuristic." msgstr "" "El argumento opcional *autojunk* puede ser usado para deshabilitar la " "heurística automática de elementos no deseados." #: ../Doc/library/difflib.rst:391 msgid "" "SequenceMatcher objects get three data attributes: *bjunk* is the set of " "elements of *b* for which *isjunk* is ``True``; *bpopular* is the set of non-" "junk elements considered popular by the heuristic (if it is not disabled); " "*b2j* is a dict mapping the remaining elements of *b* to a list of positions " "where they occur. All three are reset whenever *b* is reset with :meth:" "`set_seqs` or :meth:`set_seq2`." msgstr "" "Los objetos `SequenceMatcher` reciben tres atributos: *bjunk* es el conjunto " "de elementos de *b* para los cuales *isjunk* es ``True``; *bpopular* es el " "set de elementos que no son basura considerados populares por la heurística " "(si no es que fue deshabilitada); *b2j* es un diccionario que mapea " "elementos de *b* a una lista de posiciones donde estos ocurren. Los tres " "atributos son reseteados cuando *b* es reseteado mediante :meth:`set_seqs` " "o :meth:`set_seq2`." #: ../Doc/library/difflib.rst:398 msgid "The *bjunk* and *bpopular* attributes." msgstr "Los atributos *bjunk* y *bpopular*." #: ../Doc/library/difflib.rst:401 msgid ":class:`SequenceMatcher` objects have the following methods:" msgstr "Los objetos :class:`SequenceMatcher` tienen los siguientes métodos:" #: ../Doc/library/difflib.rst:405 msgid "Set the two sequences to be compared." msgstr "Establece las dos secuencias a ser comparadas." #: ../Doc/library/difflib.rst:407 msgid "" ":class:`SequenceMatcher` computes and caches detailed information about the " "second sequence, so if you want to compare one sequence against many " "sequences, use :meth:`set_seq2` to set the commonly used sequence once and " "call :meth:`set_seq1` repeatedly, once for each of the other sequences." msgstr "" ":class:`SequenceMatcher` calcula y almacena información detallada sobre la " "segunda secuencia, con lo cual si quieres comparar una secuencia contra " "muchas otras, usa :meth:`set_seq2` para establecer la secuencia común una " "sola vez y llamar :meth:`set_seq1` repetidamente, una vez por cada una de " "las otras secuencias." #: ../Doc/library/difflib.rst:415 msgid "" "Set the first sequence to be compared. The second sequence to be compared " "is not changed." msgstr "" "Establece la primer secuencia a ser comparada. La segunda secuencia a ser " "comparada no es modificada." #: ../Doc/library/difflib.rst:421 msgid "" "Set the second sequence to be compared. The first sequence to be compared " "is not changed." msgstr "" "Establece la segunda secuencia a ser comparada. La primera secuencia a ser " "comparada no es modificada." #: ../Doc/library/difflib.rst:427 msgid "Find longest matching block in ``a[alo:ahi]`` and ``b[blo:bhi]``." msgstr "" "Encuentra el bloque de coincidencia mas largo en ``a[alo:ahi]`` y ``b[blo:" "bhi]``." #: ../Doc/library/difflib.rst:429 msgid "" "If *isjunk* was omitted or ``None``, :meth:`find_longest_match` returns " "``(i, j, k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``alo " "<= i <= i+k <= ahi`` and ``blo <= j <= j+k <= bhi``. For all ``(i', j', " "k')`` meeting those conditions, the additional conditions ``k >= k'``, ``i " "<= i'``, and if ``i == i'``, ``j <= j'`` are also met. In other words, of " "all maximal matching blocks, return one that starts earliest in *a*, and of " "all those maximal matching blocks that start earliest in *a*, return the one " "that starts earliest in *b*." msgstr "" "Si *isjunk* fue omitido o es ``None``, :meth:`find_longest_match` retorna " "``(i, j, k)`` tal que ``a[i:i+k]`` es igual a ``b[j:j+k]``, donde ``alo <= i " "<= i+k <= ahi`` y ``blo <= j <= j+k <= bhi``. Para todo ``(i', j', k')`` " "cumpliendo esas condiciones, las condiciones adicionales ``k >= k'``, ``i <= " "i'``, y si ``i == i'``, ``j <= j'`` también se cumplen. En otras palabras, " "de todos los bloques coincidentes máximos, retorna aquel que comienza antes " "en *a*, y de todos esos bloques coincidentes máximos que comienzan antes en " "*a*, retorna aquel que comienza antes en *b*." #: ../Doc/library/difflib.rst:442 msgid "" "If *isjunk* was provided, first the longest matching block is determined as " "above, but with the additional restriction that no junk element appears in " "the block. Then that block is extended as far as possible by matching " "(only) junk elements on both sides. So the resulting block never matches on " "junk except as identical junk happens to be adjacent to an interesting match." msgstr "" "Si se porporcionó *isjunk*, primero se determina el bloque coincidente mas " "largo como fue indicado anteriormente, pero con la restricción adicional de " "que no aparezca ningún elemento no deseado en el bloque. Entonces, ese " "bloque se extiende tan lejos como sea posible haciendo coincidir (solo) " "elementos no deseados de ambos lados. Por lo tanto, el bloque resultante " "nunca hará coincidir ningún elemento no deseado, excepto que un elemento no " "deseado idéntico pase a ser adyacente a una coincidencia interesante." #: ../Doc/library/difflib.rst:449 msgid "" "Here's the same example as before, but considering blanks to be junk. That " "prevents ``' abcd'`` from matching the ``' abcd'`` at the tail end of the " "second sequence directly. Instead only the ``'abcd'`` can match, and " "matches the leftmost ``'abcd'`` in the second sequence:" msgstr "" "Este es el mismo ejemplo que el mostrado anteriormente, pero considerando " "elementos en blanco como no deseados. Esto previene que ``' abcd'`` sea " "coincidente con ``'abcd'`` en el final de la segunda secuencia directamente. " "En cambio, sólo el ``'abcd'`` puede coincidir, y coincide con el ``'abcd'`` " "que se encuentre mas a la izquierda en la segunda secuencia:" #: ../Doc/library/difflib.rst:458 msgid "If no blocks match, this returns ``(alo, blo, 0)``." msgstr "Si no coincide ningún bloque, esto retorna ``(alo, blo, 0)``." #: ../Doc/library/difflib.rst:460 msgid "This method returns a :term:`named tuple` ``Match(a, b, size)``." msgstr "Este método retorna un :term:`named tuple` ``Match(a, b, size)``." #: ../Doc/library/difflib.rst:462 msgid "Added default arguments." msgstr "Se agregaron argumentos predeterminados." #: ../Doc/library/difflib.rst:468 msgid "" "Return list of triples describing non-overlapping matching subsequences. " "Each triple is of the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:" "j+n]``. The triples are monotonically increasing in *i* and *j*." msgstr "" "Retorna una lista de triplas (tuplas de tres elementos) describiendo " "subsecuencias coincidentes no superpuestas. Cada tripla sigue el formato " "``(i, j, n)``, y significa que ``a[i:i+n] == b[j:j+n]``. Las triplas son " "monótonamente crecientes en *i* y *j*." #: ../Doc/library/difflib.rst:473 msgid "" "The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It " "is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` " "are adjacent triples in the list, and the second is not the last triple in " "the list, then ``i+n < i'`` or ``j+n < j'``; in other words, adjacent " "triples always describe non-adjacent equal blocks." msgstr "" "La última tripla es un objeto ficticio (dummy), y tiene el valor ``(len(a), " "len(b), 0)``. Es la única tripla con ``n == 0``. Si ``(i, j, n)`` y ``(i', " "j', n')`` son triplas adyacentes en la lista, y la segunda no es el último " "elemento de la lista, entonces ``i+n < i'`` o ``j+n < j'``; en otras " "palabras, las triplas adyacentes describen bloques iguales no adyacentes." #: ../Doc/library/difflib.rst:490 msgid "" "Return list of 5-tuples describing how to turn *a* into *b*. Each tuple is " "of the form ``(tag, i1, i2, j1, j2)``. The first tuple has ``i1 == j1 == " "0``, and remaining tuples have *i1* equal to the *i2* from the preceding " "tuple, and, likewise, *j1* equal to the previous *j2*." msgstr "" "Retorna una lista de quíntuplas (tuplas de cinco elementos) describiendo " "como convertir *a* en *b*. Cada tupla tiene la forma ``(tag, i1, i2, j1, " "j2)``. En la primer tupla se cumple que ``i1 == j1 == 0``, y las tuplas " "restantes tienen *i1* igual al *i2* de la tupla precedente, y de igual " "manera, *j1* igual al *j2* de la tupla anterior." #: ../Doc/library/difflib.rst:495 msgid "The *tag* values are strings, with these meanings:" msgstr "" "Los valores de *tag* son cadenas de caracteres, con el siguiente significado:" #: ../Doc/library/difflib.rst:498 msgid "Value" msgstr "Valor" #: ../Doc/library/difflib.rst:500 msgid "``'replace'``" msgstr "``'replace'``" #: ../Doc/library/difflib.rst:500 msgid "``a[i1:i2]`` should be replaced by ``b[j1:j2]``." msgstr "``a[i1:i2]`` debe ser reemplazado por ``b[j1:j2]``." #: ../Doc/library/difflib.rst:503 msgid "``'delete'``" msgstr "``'delete'``" #: ../Doc/library/difflib.rst:503 msgid "``a[i1:i2]`` should be deleted. Note that ``j1 == j2`` in this case." msgstr "" "``a[i1:i2]`` debe ser eliminado. Nótese que en este caso ``j1 == j2``." #: ../Doc/library/difflib.rst:506 msgid "``'insert'``" msgstr "``'insert'``" #: ../Doc/library/difflib.rst:506 msgid "" "``b[j1:j2]`` should be inserted at ``a[i1:i1]``. Note that ``i1 == i2`` in " "this case." msgstr "" "``b[j1:j2]`` debe ser insertado en ``a[i1:i1]``. Nótese que en este caso " "``i1 == i2``." #: ../Doc/library/difflib.rst:510 msgid "``'equal'``" msgstr "``'equal'``" #: ../Doc/library/difflib.rst:510 msgid "``a[i1:i2] == b[j1:j2]`` (the sub-sequences are equal)." msgstr "``a[i1:i2] == b[j1:j2]`` (las subsecuencias son iguales)." #: ../Doc/library/difflib.rst:514 msgid "For example::" msgstr "Por ejemplo:" #: ../Doc/library/difflib.rst:531 msgid "Return a :term:`generator` of groups with up to *n* lines of context." msgstr "" "Retorna un :term:`generator` de grupos de hasta *n* líneas de contexto." #: ../Doc/library/difflib.rst:533 msgid "" "Starting with the groups returned by :meth:`get_opcodes`, this method splits " "out smaller change clusters and eliminates intervening ranges which have no " "changes." msgstr "" "Empezando con los grupos retornados por :meth:`get_opcodes`, este método " "separa grupos con cambios menores y elimina los rangos intermedios que no " "tienen cambios." #: ../Doc/library/difflib.rst:537 msgid "The groups are returned in the same format as :meth:`get_opcodes`." msgstr "Los grupos son retornados en el mismo formato que :meth:`get_opcodes`." #: ../Doc/library/difflib.rst:542 msgid "" "Return a measure of the sequences' similarity as a float in the range [0, 1]." msgstr "" "Retorna una medida de la similitud de las secuencias como un flotante en el " "rango [0, 1]." #: ../Doc/library/difflib.rst:545 msgid "" "Where T is the total number of elements in both sequences, and M is the " "number of matches, this is 2.0\\*M / T. Note that this is ``1.0`` if the " "sequences are identical, and ``0.0`` if they have nothing in common." msgstr "" "Donde T es el número total de elementos en ambas secuencias y M es el número " "de coincidencias, esto es 2.0\\*M / T. Nótese que esto es ``1.0`` si las " "secuencias son idénticas y ``0.0`` si no tienen nada en común." #: ../Doc/library/difflib.rst:549 msgid "" "This is expensive to compute if :meth:`get_matching_blocks` or :meth:" "`get_opcodes` hasn't already been called, in which case you may want to try :" "meth:`quick_ratio` or :meth:`real_quick_ratio` first to get an upper bound." msgstr "" "Esto es computacionalmente costoso si :meth:`get_matching_blocks` o :meth:" "`get_opcodes` no fueron ejecutados, in tal caso deberías considerar primero :" "meth:`quick_ratio` o :meth:`real_quick_ratio` para obtener un límite " "superior." #: ../Doc/library/difflib.rst:556 msgid "" "Caution: The result of a :meth:`ratio` call may depend on the order of the " "arguments. For instance::" msgstr "" "Precaución: El resultado de una llamada a :meth:`ratio` puede depender del " "orden de los argumentos. Por ejemplo::" #: ../Doc/library/difflib.rst:567 msgid "Return an upper bound on :meth:`ratio` relatively quickly." msgstr "Retorna un límite superior en :meth:`ratio` relativamente rápido." #: ../Doc/library/difflib.rst:572 msgid "Return an upper bound on :meth:`ratio` very quickly." msgstr "Retorna un límite superior en :meth:`ratio` muy rápido." #: ../Doc/library/difflib.rst:575 msgid "" "The three methods that return the ratio of matching to total characters can " "give different results due to differing levels of approximation, although :" "meth:`quick_ratio` and :meth:`real_quick_ratio` are always at least as large " "as :meth:`ratio`:" msgstr "" "Los tres métodos que retornan la proporción de coincidencias con el total de " "caracteres pueden dar diferentes resultados debido a los distintos niveles " "de aproximación, a pesar de que :meth:`quick_ratio` y :meth:" "`real_quick_ratio` son siempre al menos tan grandes como :meth:`ratio`:" #: ../Doc/library/difflib.rst:592 msgid "SequenceMatcher Examples" msgstr ":class:`SequenceMatcher` Ejemplos" #: ../Doc/library/difflib.rst:594 msgid "This example compares two strings, considering blanks to be \"junk\":" msgstr "" "Este ejemplo compara dos cadenas de texto, considerando los espacios en " "blanco como caracteres no deseados:" #: ../Doc/library/difflib.rst:600 msgid "" ":meth:`ratio` returns a float in [0, 1], measuring the similarity of the " "sequences. As a rule of thumb, a :meth:`ratio` value over 0.6 means the " "sequences are close matches:" msgstr "" ":meth:`ratio` retorna un flotante en el rango [0, 1], cuantificando la " "similitud entre las secuencias. Siguiendo la regla del pulgar, un :meth:" "`ratio` por encima de 0.6 significa que las secuencias son coincidencias " "cercanas:" #: ../Doc/library/difflib.rst:607 msgid "" "If you're only interested in where the sequences match, :meth:" "`get_matching_blocks` is handy:" msgstr "" "Si solamente estás interesado en cuándo las secuencias coinciden, :meth:" "`get_matching_blocks` es útil:" #: ../Doc/library/difflib.rst:616 msgid "" "Note that the last tuple returned by :meth:`get_matching_blocks` is always a " "dummy, ``(len(a), len(b), 0)``, and this is the only case in which the last " "tuple element (number of elements matched) is ``0``." msgstr "" "Nótese que la última tupla retornada por :meth:`get_matching_blocks` es " "siempre un objeto ficticio (dummy), ``(len(a), len(b), 0)``, y este es el " "único caso en el cual el último elemento de la tupla (el número de elementos " "coincidentes) es ``0``." #: ../Doc/library/difflib.rst:620 msgid "" "If you want to know how to change the first sequence into the second, use :" "meth:`get_opcodes`:" msgstr "" "Si quieres saber como cambiar la primer secuencia con la segunda, usa :meth:" "`get_opcodes`:" #: ../Doc/library/difflib.rst:631 msgid "" "The :func:`get_close_matches` function in this module which shows how simple " "code building on :class:`SequenceMatcher` can be used to do useful work." msgstr "" "La función :func:`get_close_matches` en este módulo que muestra lo simple " "que es el código que construye :class:`SequenceMatcher` puede ser utilizada " "para hacer un trabajo útil." #: ../Doc/library/difflib.rst:635 msgid "" "`Simple version control recipe `_ for a small application built with :class:`SequenceMatcher`." msgstr "" "`Una receta simple de un controlador de versiones `_ para una aplicación pequeña construida con :class:" "`SequenceMatcher`." #: ../Doc/library/difflib.rst:643 msgid "Differ Objects" msgstr "Objetos *Differ*" #: ../Doc/library/difflib.rst:645 msgid "" "Note that :class:`Differ`\\ -generated deltas make no claim to be " "**minimal** diffs. To the contrary, minimal diffs are often counter-" "intuitive, because they synch up anywhere possible, sometimes accidental " "matches 100 pages apart. Restricting synch points to contiguous matches " "preserves some notion of locality, at the occasional cost of producing a " "longer diff." msgstr "" "Nótese que los deltas generados por :class:`Differ` no dicen ser diferencias " "**mínimas**. Todo lo contrario, las diferencias mínimas suelen ser contra-" "intuitivas, ya que se sincronizan en cualquier lugar posible, a veces " "coinciden accidentalmente con 100 páginas de diferencia. Restringiendo los " "puntos de sincronización a coincidencias contiguas se preserva cierta noción " "de cercanía, con el costo adicional de producir diferencias mas largas." #: ../Doc/library/difflib.rst:651 msgid "The :class:`Differ` class has this constructor:" msgstr "La clase :class:`Differ` tiene el siguiente constructor:" #: ../Doc/library/difflib.rst:657 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are for filter " "functions (or ``None``):" msgstr "" "Parámetros de palabra clave opcionales *linejunk* y *charjunk* son para " "funciones de filtrado (o ``None``):" #: ../Doc/library/difflib.rst:660 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk. The default is ``None``, meaning that no line " "is considered junk." msgstr "" "*linejunk*: Una función que acepta una sola cadena de texto como argumento y " "retorna verdadero si la cadena de texto es un elemento no deseado. Su valor " "por defecto es ``None``, lo que significa que ninguna línea es considerada " "no deseada." #: ../Doc/library/difflib.rst:664 msgid "" "*charjunk*: A function that accepts a single character argument (a string of " "length 1), and returns true if the character is junk. The default is " "``None``, meaning that no character is considered junk." msgstr "" "*charjunk*: Una función que acepta un solo carácter como argumento (una " "cadena de caracteres de longitud 1) y retorna verdadero si el carácter es un " "elemento no deseado. Su valor por defecto es ``None``, lo que significa que " "ningún carácter es considerado no deseado." #: ../Doc/library/difflib.rst:668 msgid "" "These junk-filtering functions speed up matching to find differences and do " "not cause any differing lines or characters to be ignored. Read the " "description of the :meth:`~SequenceMatcher.find_longest_match` method's " "*isjunk* parameter for an explanation." msgstr "" "Estas funciones de elementos no deseados aceleran la coincidencia para " "encontrar diferencies y no hacen que se ignoren líneas o caracteres " "diferentes. Lea la descripción del parámetro *isjunk* en el método :meth:" "`~SequenceMatcher.find_longest_match` para una explicación mas detallada." #: ../Doc/library/difflib.rst:674 msgid "" ":class:`Differ` objects are used (deltas generated) via a single method:" msgstr "" "Los objetos :class:`Differ` son usados (una vez generados los deltas) " "mediante un solo método:" #: ../Doc/library/difflib.rst:679 msgid "" "Compare two sequences of lines, and generate the delta (a sequence of lines)." msgstr "" "Compara dos secuencias de líneas y genera el delta correspondiente (una " "secuencia de líneas)." #: ../Doc/library/difflib.rst:681 msgid "" "Each sequence must contain individual single-line strings ending with " "newlines. Such sequences can be obtained from the :meth:`~io.IOBase." "readlines` method of file-like objects. The delta generated also consists " "of newline-terminated strings, ready to be printed as-is via the :meth:`~io." "IOBase.writelines` method of a file-like object." msgstr "" "Cada secuencia debe contener cadenas de texto individuales de una sola linea " "terminadas con una línea nueva. Este tipo de secuencias pueden ser obtenidas " "mediante el método :meth:`~io.IOBase.readlines` de objetos de tipo archivo. " "Los delta generados consisten también en cadenas de texto terminadas en " "nuevas lineas, listas para imprimirse tal cual a través del método :meth:" "`~io.IOBase.writelines` de un objeto de tipo archivo." #: ../Doc/library/difflib.rst:692 msgid "Differ Example" msgstr "Ejemplo de *Differ*" #: ../Doc/library/difflib.rst:694 msgid "" "This example compares two texts. First we set up the texts, sequences of " "individual single-line strings ending with newlines (such sequences can also " "be obtained from the :meth:`~io.BaseIO.readlines` method of file-like " "objects):" msgstr "" "Este ejemplo compara dos textos. Primero preparamos los textos, secuencias " "de cadenas de texto individuales de una sola línea terminadas con una línea " "nueva (este tipo de secuencias también pueden ser obtenidas mediante el " "método :meth:`~io.BaseIO.readlines` de objetos de tipo archivo):" #: ../Doc/library/difflib.rst:713 msgid "Next we instantiate a Differ object:" msgstr "Luego instanciamos el objeto *Differ*:" #: ../Doc/library/difflib.rst:717 msgid "" "Note that when instantiating a :class:`Differ` object we may pass functions " "to filter out line and character \"junk.\" See the :meth:`Differ` " "constructor for details." msgstr "" "Nótese que cuando instanciamos un objeto :class:`Differ` deberíamos pasar " "funciones para filtrar lineas y caracteres no deseados. Consulte el " "constructor de :meth:`Differ` para mas detalles." #: ../Doc/library/difflib.rst:721 msgid "Finally, we compare the two:" msgstr "Finalmente, comparamos las dos:" #: ../Doc/library/difflib.rst:725 msgid "``result`` is a list of strings, so let's pretty-print it:" msgstr "" "``result`` es una lista de cadenas de caracteres, entonces vamos a mostrarlo " "de una forma elegante:" #: ../Doc/library/difflib.rst:740 msgid "As a single multi-line string it looks like this:" msgstr "" "Representado como una sola cadena de caracteres de múltiples líneas se ve " "así:" #: ../Doc/library/difflib.rst:759 msgid "A command-line interface to difflib" msgstr "Una interfaz de línea de comandos para :mod:`difflib`" #: ../Doc/library/difflib.rst:761 msgid "" "This example shows how to use difflib to create a ``diff``-like utility. It " "is also contained in the Python source distribution, as :file:`Tools/scripts/" "diff.py`." msgstr "" "Este ejemplo muestra como usar difflib para crear una herramienta de " "diferencias. También puedes encontrarla en la distribución estándar de " "Python como :file:`Tools/scripts/diff.py`."