# 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-12-12 13:26-0500\n" "Last-Translator: Adolfo Hristo David Roque Gámez \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/collections.rst:2 msgid ":mod:`collections` --- Container datatypes" msgstr ":mod:`collections` --- Tipos de datos contenedor" #: ../Doc/library/collections.rst:10 msgid "**Source code:** :source:`Lib/collections/__init__.py`" msgstr "**Source code:** :source:`Lib/collections/__init__.py`" #: ../Doc/library/collections.rst:20 msgid "" "This module implements specialized container datatypes providing " "alternatives to Python's general purpose built-in containers, :class:" "`dict`, :class:`list`, :class:`set`, and :class:`tuple`." msgstr "" "Este módulo implementa tipos de datos de contenedores especializados que " "proporcionan alternativas a los contenedores integrados de uso general de " "Python, :class:`dict`, :class:`list`, :class:`set`, and :class:`tuple`." #: ../Doc/library/collections.rst:25 msgid ":func:`namedtuple`" msgstr ":func:`namedtuple`" #: ../Doc/library/collections.rst:25 msgid "factory function for creating tuple subclasses with named fields" msgstr "" "función *factory* para crear subclases de *tuplas* con campos con nombre" #: ../Doc/library/collections.rst:26 msgid ":class:`deque`" msgstr ":class:`deque`" #: ../Doc/library/collections.rst:26 msgid "list-like container with fast appends and pops on either end" msgstr "" "contenedor similar a una lista con *appends* y *pops* rápidos en ambos " "extremos" #: ../Doc/library/collections.rst:27 msgid ":class:`ChainMap`" msgstr ":class:`ChainMap`" #: ../Doc/library/collections.rst:27 msgid "dict-like class for creating a single view of multiple mappings" msgstr "" "clase similar a *dict* para crear una vista única de múltiples *mapeados*" #: ../Doc/library/collections.rst:28 msgid ":class:`Counter`" msgstr ":class:`Counter`" #: ../Doc/library/collections.rst:28 msgid "dict subclass for counting hashable objects" msgstr "subclase de *dict* para contar objetos *hashables*" #: ../Doc/library/collections.rst:29 msgid ":class:`OrderedDict`" msgstr ":class:`OrderedDict`" #: ../Doc/library/collections.rst:29 msgid "dict subclass that remembers the order entries were added" msgstr "" "subclase de *dict* que recuerda las entradas de la orden que se agregaron" #: ../Doc/library/collections.rst:30 msgid ":class:`defaultdict`" msgstr ":class:`defaultdict`" #: ../Doc/library/collections.rst:30 msgid "dict subclass that calls a factory function to supply missing values" msgstr "" "subclase de *dict* que llama a una función de *factory* para suministrar " "valores faltantes" #: ../Doc/library/collections.rst:31 msgid ":class:`UserDict`" msgstr ":class:`UserDict`" #: ../Doc/library/collections.rst:31 msgid "wrapper around dictionary objects for easier dict subclassing" msgstr "" "envoltura alrededor de los objetos de diccionario para facilitar " "subclasificaciones *dict*" #: ../Doc/library/collections.rst:32 msgid ":class:`UserList`" msgstr ":class:`UserList`" #: ../Doc/library/collections.rst:32 msgid "wrapper around list objects for easier list subclassing" msgstr "" "envoltura alrededor de los objetos de lista para facilitar la " "subclasificación de un *list*" #: ../Doc/library/collections.rst:33 msgid ":class:`UserString`" msgstr ":class:`UserString`" #: ../Doc/library/collections.rst:33 msgid "wrapper around string objects for easier string subclassing" msgstr "" "envoltura alrededor de objetos de cadena para facilitar la subclasificación " "de *string*" #: ../Doc/library/collections.rst:38 msgid ":class:`ChainMap` objects" msgstr "Objetos :class:`ChainMap`" #: ../Doc/library/collections.rst:42 msgid "" "A :class:`ChainMap` class is provided for quickly linking a number of " "mappings so they can be treated as a single unit. It is often much faster " "than creating a new dictionary and running multiple :meth:`~dict.update` " "calls." msgstr "" "Una clase :class:`ChainMap` se proporciona para vincular rápidamente una " "serie de *mappings* de modo que puedan tratarse como una sola unidad. Suele " "ser mucho más rápido que crear un diccionario nuevo y ejecutar varias " "llamadas a :meth:`~dict.update`." #: ../Doc/library/collections.rst:46 msgid "" "The class can be used to simulate nested scopes and is useful in templating." msgstr "" "La clase se puede utilizar para simular ámbitos anidados y es útil para " "crear plantillas." #: ../Doc/library/collections.rst:50 msgid "" "A :class:`ChainMap` groups multiple dicts or other mappings together to " "create a single, updateable view. If no *maps* are specified, a single " "empty dictionary is provided so that a new chain always has at least one " "mapping." msgstr "" "Un :class:`ChainMap` agrupa varios diccionarios u otros *mappings* para " "crear una vista única y actualizable. Si no se especifican *maps*, se " "proporciona un solo diccionario vacío para que una nueva cadena siempre " "tenga al menos un *mapeo*." #: ../Doc/library/collections.rst:54 msgid "" "The underlying mappings are stored in a list. That list is public and can " "be accessed or updated using the *maps* attribute. There is no other state." msgstr "" "Las asignaciones subyacentes se almacenan en una lista. Esa lista es pública " "y se puede acceder a ella o actualizarla usando el atributo *maps*. No hay " "otro estado." #: ../Doc/library/collections.rst:57 msgid "" "Lookups search the underlying mappings successively until a key is found. " "In contrast, writes, updates, and deletions only operate on the first " "mapping." msgstr "" "Las búsquedas buscan los mapeos subyacentes sucesivamente hasta que se " "encuentra una clave. Por el contrario, las escrituras, actualizaciones y " "eliminaciones solo operan en el primer *mapeo*." #: ../Doc/library/collections.rst:60 msgid "" "A :class:`ChainMap` incorporates the underlying mappings by reference. So, " "if one of the underlying mappings gets updated, those changes will be " "reflected in :class:`ChainMap`." msgstr "" "Un :class:`ChainMap` incorpora los mapeos subyacentes por referencia. " "Entonces, si una de los mapeos subyacentes se actualiza, esos cambios se " "reflejarán en :class:`ChainMap`." #: ../Doc/library/collections.rst:64 msgid "" "All of the usual dictionary methods are supported. In addition, there is a " "*maps* attribute, a method for creating new subcontexts, and a property for " "accessing all but the first mapping:" msgstr "" "Se admiten todos los métodos habituales de un diccionario. Además, hay un " "atributo *maps*, un método para crear nuevos sub contextos y una propiedad " "para acceder a todos menos al primer mapeo:" #: ../Doc/library/collections.rst:70 msgid "" "A user updateable list of mappings. The list is ordered from first-searched " "to last-searched. It is the only stored state and can be modified to change " "which mappings are searched. The list should always contain at least one " "mapping." msgstr "" "Una lista de mapeos actualizable por el usuario. La lista está ordenada " "desde la primera búsqueda hasta la última búsqueda. Es el único estado " "almacenado y se puede modificar para cambiar los mapeos que se buscan. La " "lista siempre debe contener al menos un mapeo." #: ../Doc/library/collections.rst:77 msgid "" "Returns a new :class:`ChainMap` containing a new map followed by all of the " "maps in the current instance. If ``m`` is specified, it becomes the new map " "at the front of the list of mappings; if not specified, an empty dict is " "used, so that a call to ``d.new_child()`` is equivalent to: ``ChainMap({}, " "*d.maps)``. If any keyword arguments are specified, they update passed map " "or new empty dict. This method is used for creating subcontexts that can be " "updated without altering values in any of the parent mappings." msgstr "" "Retorna un nuevo :class:`ChainMap` conteniendo un nuevo mapa seguido de " "todos los mapas de la instancia actual. Si se especifica ``m``, se " "convierte en el nuevo mapa al principio de la lista de asignaciones; si no " "se especifica, se usa un diccionario vacío, de modo que una llamada a ``d." "new_child()`` es equivalente a: ``ChainMap({}, *d.maps)``. Si se especifica " "algún argumento de palabra clave, actualiza el mapa pasado o el nuevo " "diccionario vacío. Este método se utiliza para crear sub contextos que se " "pueden actualizar sin alterar los valores en ninguna de los mapeos padre." #: ../Doc/library/collections.rst:86 msgid "The optional ``m`` parameter was added." msgstr "Se agregó el parámetro opcional ``m`` ." #: ../Doc/library/collections.rst:89 msgid "Keyword arguments support was added." msgstr "Se añadió soporte para argumentos por palabras clave." #: ../Doc/library/collections.rst:94 msgid "" "Property returning a new :class:`ChainMap` containing all of the maps in the " "current instance except the first one. This is useful for skipping the " "first map in the search. Use cases are similar to those for the :keyword:" "`nonlocal` keyword used in :term:`nested scopes `. The use " "cases also parallel those for the built-in :func:`super` function. A " "reference to ``d.parents`` is equivalent to: ``ChainMap(*d.maps[1:])``." msgstr "" "Propiedad que retorna un nuevo :class:`ChainMap` conteniendo todos los mapas " "de la instancia actual excepto el primero. Esto es útil para omitir el " "primer mapa en la búsqueda. Los casos de uso son similares a los de :" "keyword:`nonlocal` la palabra clave usada en :term:`alcances anidados " "`. Los casos de uso también son paralelos a los de la función " "incorporada :func:`super`. Una referencia a ``d.parents`` es equivalente a: " "``ChainMap(*d.maps[1:])``." #: ../Doc/library/collections.rst:102 msgid "" "Note, the iteration order of a :class:`ChainMap()` is determined by scanning " "the mappings last to first::" msgstr "" "Tenga en cuenta que el orden de iteración de a :class:`ChainMap()` se " "determina escaneando los mapeos del último al primero::" #: ../Doc/library/collections.rst:110 msgid "" "This gives the same ordering as a series of :meth:`dict.update` calls " "starting with the last mapping::" msgstr "" "Esto da el mismo orden que una serie de llamadas a :meth:`dict.update` " "comenzando con el último mapeo::" #: ../Doc/library/collections.rst:118 msgid "Added support for ``|`` and ``|=`` operators, specified in :pep:`584`." msgstr "" "Se agregó soporte para los operadores ``|`` y ``|=``, especificados en :pep:" "`584`." #: ../Doc/library/collections.rst:123 msgid "" "The `MultiContext class `_ in the Enthought `CodeTools package " "`_ has options to support writing to " "any mapping in the chain." msgstr "" "La `clase MultiContext `_ en el paquete de Enthought llamado " "`CodeTools `_ tiene opciones para " "admitir la escritura en cualquier mapeo de la cadena." #: ../Doc/library/collections.rst:129 msgid "" "Django's `Context class `_ for templating is a read-only chain of mappings. It " "also features pushing and popping of contexts similar to the :meth:" "`~collections.ChainMap.new_child` method and the :attr:`~collections." "ChainMap.parents` property." msgstr "" "La clase de Django `Context `_ para crear plantillas es una cadena de mapeo " "de solo lectura. También presenta características de pushing y popping de " "contextos similar al método :meth:`~collections.ChainMap.new_child` y a la " "propiedad :attr:`~collections.ChainMap.parents` ." #: ../Doc/library/collections.rst:136 msgid "" "The `Nested Contexts recipe `_ " "has options to control whether writes and other mutations apply only to the " "first mapping or to any mapping in the chain." msgstr "" "La `receta de Contextos Anidados `_ tiene opciones para controlar si las escrituras y otras " "mutaciones se aplican solo al primer mapeo o a cualquier mapeo en la cadena." #: ../Doc/library/collections.rst:141 msgid "" "A `greatly simplified read-only version of Chainmap `_." msgstr "" "Una `versión de solo lectura muy simplificada de Chainmap `_." #: ../Doc/library/collections.rst:146 msgid ":class:`ChainMap` Examples and Recipes" msgstr "Ejemplos y recetas :class:`ChainMap`" #: ../Doc/library/collections.rst:148 msgid "This section shows various approaches to working with chained maps." msgstr "" "Esta sección muestra varios enfoques para trabajar con mapas encadenados." #: ../Doc/library/collections.rst:151 msgid "Example of simulating Python's internal lookup chain::" msgstr "Ejemplo de simulación de la cadena de búsqueda interna de Python:" #: ../Doc/library/collections.rst:156 msgid "" "Example of letting user specified command-line arguments take precedence " "over environment variables which in turn take precedence over default " "values::" msgstr "" "Ejemplo de dejar que los argumentos de la línea de comandos especificados " "por el usuario tengan prioridad sobre las variables de entorno que, a su " "vez, tienen prioridad sobre los valores predeterminados::" #: ../Doc/library/collections.rst:173 msgid "" "Example patterns for using the :class:`ChainMap` class to simulate nested " "contexts::" msgstr "" "Patrones de ejemplo para usar la clase :class:`ChainMap` para simular " "contextos anidados::" #: ../Doc/library/collections.rst:192 msgid "" "The :class:`ChainMap` class only makes updates (writes and deletions) to the " "first mapping in the chain while lookups will search the full chain. " "However, if deep writes and deletions are desired, it is easy to make a " "subclass that updates keys found deeper in the chain::" msgstr "" "La clase :class:`ChainMap` solo realiza actualizaciones (escrituras y " "eliminaciones) en el primer mapeo de la cadena, mientras que las búsquedas " "buscarán en la cadena completa. Sin embargo, si se desean escrituras y " "eliminaciones profundas, es fácil crear una subclase que actualice las " "llaves que se encuentran más profundas en la cadena::" #: ../Doc/library/collections.rst:223 msgid ":class:`Counter` objects" msgstr "Objetos :class:`Counter`" #: ../Doc/library/collections.rst:225 msgid "" "A counter tool is provided to support convenient and rapid tallies. For " "example::" msgstr "" "Se proporciona una herramienta de contador para respaldar recuentos rápidos " "y convenientes. Por ejemplo::" #: ../Doc/library/collections.rst:244 msgid "" "A :class:`Counter` is a :class:`dict` subclass for counting hashable " "objects. It is a collection where elements are stored as dictionary keys and " "their counts are stored as dictionary values. Counts are allowed to be any " "integer value including zero or negative counts. The :class:`Counter` class " "is similar to bags or multisets in other languages." msgstr "" "Una clase :class:`Counter` es una subclase :class:`dict` para contar objetos " "hashables. Es una colección donde los elementos se almacenan como llaves de " "diccionario y sus conteos se almacenan como valores de diccionario. Se " "permite que los conteos sean cualquier valor entero, incluidos los conteos " "de cero o negativos. La clase :class:`Counter` es similar a los *bags* o " "multiconjuntos en otros idiomas." #: ../Doc/library/collections.rst:250 msgid "" "Elements are counted from an *iterable* or initialized from another " "*mapping* (or counter):" msgstr "" "Los elementos se cuentan desde un *iterable* o se inicializan desde otro " "*mapeo* (o contador):" #: ../Doc/library/collections.rst:258 msgid "" "Counter objects have a dictionary interface except that they return a zero " "count for missing items instead of raising a :exc:`KeyError`:" msgstr "" "Los objetos Counter tienen una interfaz de diccionario, excepto que retornan " "un conteo de cero para los elementos faltantes en lugar de levantar una :exc:" "`KeyError`:" #: ../Doc/library/collections.rst:265 msgid "" "Setting a count to zero does not remove an element from a counter. Use " "``del`` to remove it entirely:" msgstr "" "Establecer un conteo en cero no elimina un elemento de un contador. Utilice " "``del`` para eliminarlo por completo:" #: ../Doc/library/collections.rst:273 #, fuzzy msgid "" "As a :class:`dict` subclass, :class:`Counter` inherited the capability to " "remember insertion order. Math operations on *Counter* objects also " "preserve order. Results are ordered according to when an element is first " "encountered in the left operand and then by the order encountered in the " "right operand." msgstr "" "Como subclase de :class:`dict` , :class:`Counter` heredó la capacidad de " "recordar el orden de inserción. Las operaciones matemáticas en objetos " "*Counter* también preserva el orden. Los resultados se ordenan cuando se " "encuentra un elemento por primera vez en el operando izquierdo y luego según " "el orden encontrado en el operando derecho." #: ../Doc/library/collections.rst:279 #, fuzzy msgid "" "Counter objects support additional methods beyond those available for all " "dictionaries:" msgstr "" "Los objetos Counter admiten tres métodos más allá de los disponibles para " "todos los diccionarios:" #: ../Doc/library/collections.rst:284 msgid "" "Return an iterator over elements repeating each as many times as its count. " "Elements are returned in the order first encountered. If an element's count " "is less than one, :meth:`elements` will ignore it." msgstr "" "Retorna un iterador sobre los elementos que se repiten tantas veces como su " "conteo. Los elementos se retornan en el orden en que se encontraron por " "primera vez. Si el conteo de un elemento es menor que uno, :meth:`elements` " "lo ignorará." #: ../Doc/library/collections.rst:294 msgid "" "Return a list of the *n* most common elements and their counts from the most " "common to the least. If *n* is omitted or ``None``, :meth:`most_common` " "returns *all* elements in the counter. Elements with equal counts are " "ordered in the order first encountered:" msgstr "" "Retorna una lista de los *n* elementos mas comunes y sus conteos, del mas " "común al menos común. Si se omite *n* o ``None``, :meth:`most_common` " "retorna *todos* los elementos del contador. Los elementos con conteos " "iguales se ordenan en el orden en que se encontraron por primera vez:" #: ../Doc/library/collections.rst:304 msgid "" "Elements are subtracted from an *iterable* or from another *mapping* (or " "counter). Like :meth:`dict.update` but subtracts counts instead of " "replacing them. Both inputs and outputs may be zero or negative." msgstr "" "Los elementos se restan de un *iterable* o de otro *mapeo* (o contador). " "Como :meth:`dict.update` pero resta los conteos en lugar de reemplazarlos. " "Tanto las entradas como las salidas pueden ser cero o negativas." #: ../Doc/library/collections.rst:318 msgid "Compute the sum of the counts." msgstr "Computa la suma de las cuentas." #: ../Doc/library/collections.rst:326 msgid "" "The usual dictionary methods are available for :class:`Counter` objects " "except for two which work differently for counters." msgstr "" "Los métodos de diccionario habituales están disponibles para objetos :class:" "`Counter` excepto dos que funcionan de manera diferente para los contadores." #: ../Doc/library/collections.rst:331 msgid "This class method is not implemented for :class:`Counter` objects." msgstr "" "Este método de clase no está implementado para objetos :class:`Counter` ." #: ../Doc/library/collections.rst:335 msgid "" "Elements are counted from an *iterable* or added-in from another *mapping* " "(or counter). Like :meth:`dict.update` but adds counts instead of replacing " "them. Also, the *iterable* is expected to be a sequence of elements, not a " "sequence of ``(key, value)`` pairs." msgstr "" "Los elementos se cuentan desde un *iterable* o agregados desde otro *mapeo* " "(o contador). Como :meth:`dict.update` pero agrega conteos en lugar de " "reemplazarlos. Además, se espera que el *iterable* sea una secuencia de " "elementos, no una secuencia de parejas ``(llave, valor)`` ." #: ../Doc/library/collections.rst:340 msgid "" "Counters support rich comparison operators for equality, subset, and " "superset relationships: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``. All of " "those tests treat missing elements as having zero counts so that " "``Counter(a=1) == Counter(a=1, b=0)`` returns true." msgstr "" "Los contadores admiten operadores de comparación ricos para las relaciones " "de igualdad, subconjunto, y superconjunto: ``==``, ``!=``, ``<``, ``<=``, " "``>``, ``>=``. Todas esas pruebas tratan los elementos faltantes como si " "tuvieran cero recuentos, por lo que ``Counter(a=1) == Counter(a=1, b=0)`` " "retorne verdadero." #: ../Doc/library/collections.rst:345 #, fuzzy msgid "Rich comparison operations were added." msgstr "Se añadieron comparaciones de operaciones ricas" #: ../Doc/library/collections.rst:348 msgid "" "In equality tests, missing elements are treated as having zero counts. " "Formerly, ``Counter(a=3)`` and ``Counter(a=3, b=0)`` were considered " "distinct." msgstr "" "En pruebas de igualdad, los elementos faltantes son tratados como si " "tuvieran cero recuentos. Anteriormente, ``Counter(a=3)`` y ``Counter(a=3, " "b=0)`` se consideraban distintos." #: ../Doc/library/collections.rst:353 msgid "Common patterns for working with :class:`Counter` objects::" msgstr "Patrones comunes para trabajar con objetos :class:`Counter`::" #: ../Doc/library/collections.rst:365 #, fuzzy msgid "" "Several mathematical operations are provided for combining :class:`Counter` " "objects to produce multisets (counters that have counts greater than zero). " "Addition and subtraction combine counters by adding or subtracting the " "counts of corresponding elements. Intersection and union return the minimum " "and maximum of corresponding counts. Equality and inclusion compare " "corresponding counts. Each operation can accept inputs with signed counts, " "but the output will exclude results with counts of zero or less." msgstr "" "Se proporcionan varias operaciones matemáticas para combinar objetos :class:" "`Counter` para producir multiconjuntos (contadores que tienen conteos " "mayores que cero). La suma y la resta combinan contadores sumando o restando " "los conteos de los elementos correspondientes. La Intersección y unión " "retornan el mínimo y el máximo de conteos correspondientes. Cada operación " "puede aceptar entradas con conteos con signo, pero la salida excluirá los " "resultados con conteos de cero o menos." #: ../Doc/library/collections.rst:390 msgid "" "Unary addition and subtraction are shortcuts for adding an empty counter or " "subtracting from an empty counter." msgstr "" "La suma y resta unaria son atajos para agregar un contador vacío o restar de " "un contador vacío." #: ../Doc/library/collections.rst:399 msgid "" "Added support for unary plus, unary minus, and in-place multiset operations." msgstr "" "Se agregó soporte para operaciones unarias de adición, resta y multiconjunto " "en su lugar (*in-place*)." #: ../Doc/library/collections.rst:404 msgid "" "Counters were primarily designed to work with positive integers to represent " "running counts; however, care was taken to not unnecessarily preclude use " "cases needing other types or negative values. To help with those use cases, " "this section documents the minimum range and type restrictions." msgstr "" "Los Counters se diseñaron principalmente para trabajar con números enteros " "positivos para representar conteos continuos; sin embargo, se tuvo cuidado " "de no excluir innecesariamente los casos de uso que necesitan otros tipos o " "valores negativos. Para ayudar con esos casos de uso, esta sección documenta " "el rango mínimo y las restricciones de tipo." #: ../Doc/library/collections.rst:409 msgid "" "The :class:`Counter` class itself is a dictionary subclass with no " "restrictions on its keys and values. The values are intended to be numbers " "representing counts, but you *could* store anything in the value field." msgstr "" "La clase :class:`Counter` en sí misma es una subclase de diccionario sin " "restricciones en sus llaves y valores. Los valores están pensados para ser " "números que representan conteos, pero *podría* almacenar cualquier cosa en " "el campo de valor." #: ../Doc/library/collections.rst:413 msgid "" "The :meth:`~Counter.most_common` method requires only that the values be " "orderable." msgstr "" "El método :meth:`~Counter.most_common` solo requiere que los valores se " "puedan ordenar." #: ../Doc/library/collections.rst:415 msgid "" "For in-place operations such as ``c[key] += 1``, the value type need only " "support addition and subtraction. So fractions, floats, and decimals would " "work and negative values are supported. The same is also true for :meth:" "`~Counter.update` and :meth:`~Counter.subtract` which allow negative and " "zero values for both inputs and outputs." msgstr "" "Para operaciones en su lugar (*in-place*) como ``c[key] += 1``, el tipo de " "valor solo necesita admitir la suma y la resta. Por lo tanto, las " "fracciones, flotantes y decimales funcionarían y se admiten valores " "negativos. Lo mismo ocurre con :meth:`~Counter.update` y :meth:`~Counter." "subtract` que permiten valores negativos y cero para las entradas y salidas." #: ../Doc/library/collections.rst:421 msgid "" "The multiset methods are designed only for use cases with positive values. " "The inputs may be negative or zero, but only outputs with positive values " "are created. There are no type restrictions, but the value type needs to " "support addition, subtraction, and comparison." msgstr "" "Los métodos de multiconjuntos están diseñados solo para casos de uso con " "valores positivos. Las entradas pueden ser negativas o cero, pero solo se " "crean salidas con valores positivos. No hay restricciones de tipo, pero el " "tipo de valor debe admitir la suma, la resta y la comparación." #: ../Doc/library/collections.rst:426 msgid "" "The :meth:`~Counter.elements` method requires integer counts. It ignores " "zero and negative counts." msgstr "" "El método :meth:`~Counter.elements` requiere conteos enteros. Ignora los " "conteos de cero y negativos." #: ../Doc/library/collections.rst:431 msgid "" "`Bag class `_ in Smalltalk." msgstr "" "`Clase Bag `_ en Smalltalk." #: ../Doc/library/collections.rst:434 msgid "" "Wikipedia entry for `Multisets `_." msgstr "" "Entrada de Wikipedia para `Multiconjuntos `_." #: ../Doc/library/collections.rst:436 msgid "" "`C++ multisets `_ tutorial with examples." msgstr "" "Tutorial de `multiconjuntos de C++ `_ con ejemplos." #: ../Doc/library/collections.rst:439 msgid "" "For mathematical operations on multisets and their use cases, see *Knuth, " "Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise " "19*." msgstr "" "Para operaciones matemáticas en multiconjuntos y sus casos de uso, consulte " "*Knuth, Donald. The Art of Computer Programming Volume II, Sección 4.6.3, " "Ejercicio 19*." #: ../Doc/library/collections.rst:443 msgid "" "To enumerate all distinct multisets of a given size over a given set of " "elements, see :func:`itertools.combinations_with_replacement`::" msgstr "" "Para enumerar todos los distintos multiconjuntos de un tamaño dado sobre un " "conjunto dado de elementos, consulte :func:`itertools." "combinations_with_replacement`::" #: ../Doc/library/collections.rst:450 msgid ":class:`deque` objects" msgstr "Objetos :class:`deque`" #: ../Doc/library/collections.rst:454 msgid "" "Returns a new deque object initialized left-to-right (using :meth:`append`) " "with data from *iterable*. If *iterable* is not specified, the new deque is " "empty." msgstr "" "Retorna un nuevo objeto deque inicializado de izquierda a derecha (usando :" "meth:`append`) con datos de *iterable*. Si no se especifica *iterable*, el " "nuevo deque estará vacío." #: ../Doc/library/collections.rst:457 msgid "" "Deques are a generalization of stacks and queues (the name is pronounced " "\"deck\" and is short for \"double-ended queue\"). Deques support thread-" "safe, memory efficient appends and pops from either side of the deque with " "approximately the same O(1) performance in either direction." msgstr "" "Los deques son una generalización de pilas y colas (el nombre se pronuncia " "“baraja”, *deck* en inglés, y es la abreviatura de “cola de dos extremos”, " "*double-ended queue* en inglés). Los Deques admiten hilos seguros, appends y " "pops eficientes en memoria desde cualquier lado del deque con " "aproximadamente el mismo rendimiento O(1) en cualquier dirección." #: ../Doc/library/collections.rst:462 msgid "" "Though :class:`list` objects support similar operations, they are optimized " "for fast fixed-length operations and incur O(n) memory movement costs for " "``pop(0)`` and ``insert(0, v)`` operations which change both the size and " "position of the underlying data representation." msgstr "" "Aunque los objetos :class:`list` admiten operaciones similares, están " "optimizados para operaciones rápidas de longitud fija e incurren en costos " "de movimiento de memoria O(n) para operaciones ``pop(0)`` y ``insert(0, v)`` " "que cambian tanto el tamaño como la posición de la representación de datos " "subyacente." #: ../Doc/library/collections.rst:468 msgid "" "If *maxlen* is not specified or is ``None``, deques may grow to an arbitrary " "length. Otherwise, the deque is bounded to the specified maximum length. " "Once a bounded length deque is full, when new items are added, a " "corresponding number of items are discarded from the opposite end. Bounded " "length deques provide functionality similar to the ``tail`` filter in Unix. " "They are also useful for tracking transactions and other pools of data where " "only the most recent activity is of interest." msgstr "" "Si no se especifica *maxlen* o es ``None``, los deques pueden crecer hasta " "una longitud arbitraria. De lo contrario, el deque está limitado a la " "longitud máxima especificada. Una vez que un deque de longitud limitada esta " "lleno, cuando se agregan nuevos elementos, se descarta el número " "correspondiente de elementos del extremo opuesto. Los deques de longitud " "limitada proporcionan una funcionalidad similar al filtro ``tail`` en Unix. " "También son útiles para rastrear transacciones y otros grupos de datos donde " "solo la actividad más reciente es de interés." #: ../Doc/library/collections.rst:477 msgid "Deque objects support the following methods:" msgstr "Los objetos deque admiten los siguientes métodos:" #: ../Doc/library/collections.rst:481 msgid "Add *x* to the right side of the deque." msgstr "Agregue *x* al lado derecho del deque." #: ../Doc/library/collections.rst:486 msgid "Add *x* to the left side of the deque." msgstr "Agregue *x* al lado izquierdo del deque." #: ../Doc/library/collections.rst:491 msgid "Remove all elements from the deque leaving it with length 0." msgstr "Retire todos los elementos del deque dejándolo con longitud 0." #: ../Doc/library/collections.rst:496 msgid "Create a shallow copy of the deque." msgstr "Crea una copia superficial del deque." #: ../Doc/library/collections.rst:503 msgid "Count the number of deque elements equal to *x*." msgstr "Cuente el número de elementos deque igual a *x*." #: ../Doc/library/collections.rst:510 msgid "" "Extend the right side of the deque by appending elements from the iterable " "argument." msgstr "" "Extienda el lado derecho del deque agregando elementos del argumento " "iterable." #: ../Doc/library/collections.rst:516 msgid "" "Extend the left side of the deque by appending elements from *iterable*. " "Note, the series of left appends results in reversing the order of elements " "in the iterable argument." msgstr "" "Extienda el lado izquierdo del deque agregando elementos de *iterable*. " "Tenga en cuenta que la serie de appends a la izquierda da como resultado la " "inversión del orden de los elementos en el argumento iterable." #: ../Doc/library/collections.rst:523 msgid "" "Return the position of *x* in the deque (at or after index *start* and " "before index *stop*). Returns the first match or raises :exc:`ValueError` " "if not found." msgstr "" "Retorna la posición de *x* en el deque (en o después del índice *start* y " "antes del índice *stop*). Retorna la primera coincidencia o lanza :exc:" "`ValueError` si no se encuentra." #: ../Doc/library/collections.rst:532 msgid "Insert *x* into the deque at position *i*." msgstr "Ingrese *x* en el dique en la posición *i*." #: ../Doc/library/collections.rst:534 msgid "" "If the insertion would cause a bounded deque to grow beyond *maxlen*, an :" "exc:`IndexError` is raised." msgstr "" "Si la inserción causara que un deque limitado crezca más allá de *maxlen*, " "se lanza un :exc:`IndexError`." #: ../Doc/library/collections.rst:542 msgid "" "Remove and return an element from the right side of the deque. If no " "elements are present, raises an :exc:`IndexError`." msgstr "" "Elimina y retorna un elemento del lado derecho del deque. Si no hay " "elementos presentes, lanza un :exc:`IndexError`." #: ../Doc/library/collections.rst:548 msgid "" "Remove and return an element from the left side of the deque. If no elements " "are present, raises an :exc:`IndexError`." msgstr "" "Elimina y retorna un elemento del lado izquierdo del deque. Si no hay " "elementos presentes, lanza un :exc:`IndexError`." #: ../Doc/library/collections.rst:554 msgid "" "Remove the first occurrence of *value*. If not found, raises a :exc:" "`ValueError`." msgstr "" "Elimina la primera aparición de *value*. Si no se encuentra, lanza un :exc:" "`ValueError`." #: ../Doc/library/collections.rst:560 msgid "Reverse the elements of the deque in-place and then return ``None``." msgstr "" "Invierte los elementos del deque en su lugar (*in-place*) y luego retorna " "``None``." #: ../Doc/library/collections.rst:567 msgid "" "Rotate the deque *n* steps to the right. If *n* is negative, rotate to the " "left." msgstr "" "Gira el deque *n* pasos a la derecha. Si *n* es negativo, lo gira hacia la " "izquierda." #: ../Doc/library/collections.rst:570 msgid "" "When the deque is not empty, rotating one step to the right is equivalent to " "``d.appendleft(d.pop())``, and rotating one step to the left is equivalent " "to ``d.append(d.popleft())``." msgstr "" "Cuando el deque no está vacío, girar un paso hacia la derecha equivale a ``d." "appendleft(d.pop())``, y girar un paso hacia la izquierda equivale a ``d." "append(d.popleft())``." #: ../Doc/library/collections.rst:575 msgid "Deque objects also provide one read-only attribute:" msgstr "Los objetos deque también proporcionan un atributo de solo lectura:" #: ../Doc/library/collections.rst:579 msgid "Maximum size of a deque or ``None`` if unbounded." msgstr "Tamaño máximo de un deque o ``None`` si no está limitado." #: ../Doc/library/collections.rst:584 msgid "" "In addition to the above, deques support iteration, pickling, ``len(d)``, " "``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing " "with the :keyword:`in` operator, and subscript references such as ``d[0]`` " "to access the first element. Indexed access is O(1) at both ends but slows " "to O(n) in the middle. For fast random access, use lists instead." msgstr "" "Además de lo anterior, los deques admiten iteración, pickling, ``len(d)``, " "``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, prueba de " "pertenencia con el operador :keyword:`in` , y referencias de subíndices como " "``d[0]`` para acceder al primer elemento. El acceso indexado es O(1) en " "ambos extremos, pero se ralentiza hasta O(n) en el medio. Para un acceso " "aleatorio rápido, use listas en su lugar." #: ../Doc/library/collections.rst:590 msgid "" "Starting in version 3.5, deques support ``__add__()``, ``__mul__()``, and " "``__imul__()``." msgstr "" "A partir de la versión 3.5, los deques admiten ``__add__()``, ``__mul__()``, " "y ``__imul__()``." #: ../Doc/library/collections.rst:593 msgid "Example:" msgstr "Ejemplo:" #: ../Doc/library/collections.rst:650 msgid ":class:`deque` Recipes" msgstr "Recetas :class:`deque`" #: ../Doc/library/collections.rst:652 msgid "This section shows various approaches to working with deques." msgstr "Esta sección muestra varios enfoques para trabajar con deques." #: ../Doc/library/collections.rst:654 msgid "" "Bounded length deques provide functionality similar to the ``tail`` filter " "in Unix::" msgstr "" "Los deques de longitud limitada proporcionan una funcionalidad similar al " "filtro ``tail`` en Unix::" #: ../Doc/library/collections.rst:662 msgid "" "Another approach to using deques is to maintain a sequence of recently added " "elements by appending to the right and popping to the left::" msgstr "" "Otro enfoque para usar deques es mantener una secuencia de elementos " "agregados recientemente haciendo appending a la derecha y popping a la " "izquierda:" #: ../Doc/library/collections.rst:677 msgid "" "A `round-robin scheduler `_ can be implemented with input iterators stored in a :" "class:`deque`. Values are yielded from the active iterator in position " "zero. If that iterator is exhausted, it can be removed with :meth:`~deque." "popleft`; otherwise, it can be cycled back to the end with the :meth:`~deque." "rotate` method::" msgstr "" "Un `scheduler round-robin `_ se puede implementar con iteradores de entrada " "almacenados en :class:`deque`. Los valores son producidos del iterador " "activo en la posición cero. Si ese iterador está agotado, se puede eliminar " "con :meth:`~deque.popleft`; de lo contrario, se puede volver en ciclos al " "final con el método :meth:`~deque.rotate` ::" #: ../Doc/library/collections.rst:696 msgid "" "The :meth:`~deque.rotate` method provides a way to implement :class:`deque` " "slicing and deletion. For example, a pure Python implementation of ``del " "d[n]`` relies on the ``rotate()`` method to position elements to be popped::" msgstr "" "El método :meth:`~deque.rotate` proporciona una forma de implementar " "eliminación y rebanado de :class:`deque`. Por ejemplo, una implementación " "pura de Python de ``del d[n]`` se basa en el método ``rotate()`` para " "colocar los elementos que se van a extraer::" #: ../Doc/library/collections.rst:705 msgid "" "To implement :class:`deque` slicing, use a similar approach applying :meth:" "`~deque.rotate` to bring a target element to the left side of the deque. " "Remove old entries with :meth:`~deque.popleft`, add new entries with :meth:" "`~deque.extend`, and then reverse the rotation. With minor variations on " "that approach, it is easy to implement Forth style stack manipulations such " "as ``dup``, ``drop``, ``swap``, ``over``, ``pick``, ``rot``, and ``roll``." msgstr "" "Para implementar el rebanado de un :class:`deque`, use un enfoque similar " "aplicando :meth:`~deque.rotate` para traer un elemento objetivo al lado " "izquierdo del deque. Elimine las entradas antiguas con :meth:`~deque." "popleft`, agregue nuevas entradas con :meth:`~deque.extend`, y luego " "invierta la rotación. Con variaciones menores en ese enfoque, es fácil " "implementar manipulaciones de pila de estilo hacia adelante como ``dup``, " "``drop``, ``swap``, ``over``, ``pick``, ``rot``, y ``roll``." #: ../Doc/library/collections.rst:715 msgid ":class:`defaultdict` objects" msgstr "Objetos :class:`defaultdict`" #: ../Doc/library/collections.rst:719 msgid "" "Return a new dictionary-like object. :class:`defaultdict` is a subclass of " "the built-in :class:`dict` class. It overrides one method and adds one " "writable instance variable. The remaining functionality is the same as for " "the :class:`dict` class and is not documented here." msgstr "" "Retorna un nuevo objeto similar a un diccionario. :class:`defaultdict` es " "una subclase de la clase incorporada :class:`dict`. Anula un método y " "agrega una variable de instancia de escritura. La funcionalidad restante es " "la misma que para la clase :class:`dict` y no está documentada aquí." #: ../Doc/library/collections.rst:724 msgid "" "The first argument provides the initial value for the :attr:" "`default_factory` attribute; it defaults to ``None``. All remaining " "arguments are treated the same as if they were passed to the :class:`dict` " "constructor, including keyword arguments." msgstr "" "El primer argumento proporciona el valor inicial para el atributo :attr:" "`default_factory`; por defecto es ``None``. Todos los argumentos restantes " "se tratan de la misma forma que si se pasaran al constructor :class:`dict`, " "incluidos los argumentos de palabras clave." #: ../Doc/library/collections.rst:730 msgid "" ":class:`defaultdict` objects support the following method in addition to the " "standard :class:`dict` operations:" msgstr "" "Los objetos :class:`defaultdict` admiten el siguiente método además de las " "operaciones estándar de :class:`dict`:" #: ../Doc/library/collections.rst:735 msgid "" "If the :attr:`default_factory` attribute is ``None``, this raises a :exc:" "`KeyError` exception with the *key* as argument." msgstr "" "Si el atributo :attr:`default_factory` es ``None``, lanza una excepción :exc:" "`KeyError` con la *llave* como argumento." #: ../Doc/library/collections.rst:738 msgid "" "If :attr:`default_factory` is not ``None``, it is called without arguments " "to provide a default value for the given *key*, this value is inserted in " "the dictionary for the *key*, and returned." msgstr "" "Si :attr:`default_factory` no es ``None``, se llama sin argumentos para " "proporcionar un valor predeterminado para la *llave* dada, este valor se " "inserta en el diccionario para la *llave* y se retorna." #: ../Doc/library/collections.rst:742 msgid "" "If calling :attr:`default_factory` raises an exception this exception is " "propagated unchanged." msgstr "" "Si llamar a :attr:`default_factory` lanza una excepción, esta excepción se " "propaga sin cambios." #: ../Doc/library/collections.rst:745 msgid "" "This method is called by the :meth:`__getitem__` method of the :class:`dict` " "class when the requested key is not found; whatever it returns or raises is " "then returned or raised by :meth:`__getitem__`." msgstr "" "Este método es llamado por el método :meth:`__getitem__` de la clase :class:" "`dict` cuando no se encuentra la llave solicitada; todo lo que retorna o " "lanza es retornado o lanzado por :meth:`__getitem__`." #: ../Doc/library/collections.rst:749 msgid "" "Note that :meth:`__missing__` is *not* called for any operations besides :" "meth:`__getitem__`. This means that :meth:`get` will, like normal " "dictionaries, return ``None`` as a default rather than using :attr:" "`default_factory`." msgstr "" "Tenga en cuenta que :meth:`__missing__` *no* se llama para ninguna operación " "aparte de :meth:`__getitem__`. Esto significa que :meth:`get`, como los " "diccionarios normales, retornará ``None`` por defecto en lugar de usar :attr:" "`default_factory`." #: ../Doc/library/collections.rst:755 msgid ":class:`defaultdict` objects support the following instance variable:" msgstr "" "los objetos :class:`defaultdict` admiten la siguiente variable de instancia:" #: ../Doc/library/collections.rst:760 msgid "" "This attribute is used by the :meth:`__missing__` method; it is initialized " "from the first argument to the constructor, if present, or to ``None``, if " "absent." msgstr "" "Este atributo es utilizado por el método :meth:`__missing__` ; se inicializa " "desde el primer argumento al constructor, si está presente, o en ``None``, " "si está ausente." #: ../Doc/library/collections.rst:764 ../Doc/library/collections.rst:1180 msgid "" "Added merge (``|``) and update (``|=``) operators, specified in :pep:`584`." msgstr "" "Se agregaron los operadores unir (``|``) y actualizar (``|=``), " "especificados en :pep:`584`." #: ../Doc/library/collections.rst:770 msgid ":class:`defaultdict` Examples" msgstr "Ejemplos :class:`defaultdict`" #: ../Doc/library/collections.rst:772 msgid "" "Using :class:`list` as the :attr:`~defaultdict.default_factory`, it is easy " "to group a sequence of key-value pairs into a dictionary of lists:" msgstr "" "Usando :class:`list` como :attr:`~defaultdict.default_factory`, es fácil " "agrupar una secuencia de pares llave-valor en un diccionario de listas:" #: ../Doc/library/collections.rst:783 msgid "" "When each key is encountered for the first time, it is not already in the " "mapping; so an entry is automatically created using the :attr:`~defaultdict." "default_factory` function which returns an empty :class:`list`. The :meth:" "`list.append` operation then attaches the value to the new list. When keys " "are encountered again, the look-up proceeds normally (returning the list for " "that key) and the :meth:`list.append` operation adds another value to the " "list. This technique is simpler and faster than an equivalent technique " "using :meth:`dict.setdefault`:" msgstr "" "Cuando se encuentra cada llave por primera vez, no está ya en el mapping; " "por lo que una entrada se crea automáticamente usando la función :attr:" "`~defaultdict.default_factory` que retorna una :class:`list` vacía. La " "operación :meth:`list.append` luego adjunta el valor a la nueva lista. " "Cuando se vuelven a encontrar llaves, la búsqueda procede normalmente " "(retornando la lista para esa llave) y la operación :meth:`list.append` " "agrega otro valor a la lista. Esta técnica es más simple y rápida que una " "técnica equivalente usando :meth:`dict.setdefault`:" #: ../Doc/library/collections.rst:798 msgid "" "Setting the :attr:`~defaultdict.default_factory` to :class:`int` makes the :" "class:`defaultdict` useful for counting (like a bag or multiset in other " "languages):" msgstr "" "Establecer :attr:`~defaultdict.default_factory` en :class:`int` hace que :" "class:`defaultdict` sea útil para contar (como un bag o multiconjunto en " "otros idiomas):" #: ../Doc/library/collections.rst:810 msgid "" "When a letter is first encountered, it is missing from the mapping, so the :" "attr:`~defaultdict.default_factory` function calls :func:`int` to supply a " "default count of zero. The increment operation then builds up the count for " "each letter." msgstr "" "Cuando se encuentra una letra por primera vez, falta en el mapping, por lo " "que la función :attr:`~defaultdict.default_factory` llama a :func:`int` para " "proporcionar una cuenta predeterminada de cero. La operación de incremento " "luego acumula el conteo de cada letra." #: ../Doc/library/collections.rst:814 msgid "" "The function :func:`int` which always returns zero is just a special case of " "constant functions. A faster and more flexible way to create constant " "functions is to use a lambda function which can supply any constant value " "(not just zero):" msgstr "" "La función :func:`int` que siempre retorna cero es solo un caso especial de " "funciones constantes. Una forma más rápida y flexible de crear funciones " "constantes es utilizar una función lambda que pueda proporcionar cualquier " "valor constante (no solo cero):" #: ../Doc/library/collections.rst:826 msgid "" "Setting the :attr:`~defaultdict.default_factory` to :class:`set` makes the :" "class:`defaultdict` useful for building a dictionary of sets:" msgstr "" "Establecer :attr:`~defaultdict.default_factory` en :class:`set` hace que :" "class:`defaultdict` sea útil para construir un diccionario de conjuntos:" #: ../Doc/library/collections.rst:839 msgid ":func:`namedtuple` Factory Function for Tuples with Named Fields" msgstr "" ":func:`namedtuple` Funciones *Factory* para Tuplas y Campos con Nombres" #: ../Doc/library/collections.rst:841 msgid "" "Named tuples assign meaning to each position in a tuple and allow for more " "readable, self-documenting code. They can be used wherever regular tuples " "are used, and they add the ability to access fields by name instead of " "position index." msgstr "" "Las tuplas con nombre asignan significado a cada posición en una tupla y " "permiten un código más legible y autodocumentado. Se pueden usar donde se " "usen tuplas regulares y agregan la capacidad de acceder a los campos por " "nombre en lugar del índice de posición." #: ../Doc/library/collections.rst:847 msgid "" "Returns a new tuple subclass named *typename*. The new subclass is used to " "create tuple-like objects that have fields accessible by attribute lookup as " "well as being indexable and iterable. Instances of the subclass also have a " "helpful docstring (with typename and field_names) and a helpful :meth:" "`__repr__` method which lists the tuple contents in a ``name=value`` format." msgstr "" "Retorna una nueva subclase de tupla llamada *typename*. La nueva subclase se " "utiliza para crear objetos tipo tupla que tienen campos accesibles mediante " "búsqueda de atributos, además de ser indexables e iterables. Las instancias " "de la subclase también tienen un docstring útil (con typename y field_names) " "y un método útil :meth:`__repr__` que lista el contenido de la tupla en un " "formato de ``nombre=valor``." #: ../Doc/library/collections.rst:853 msgid "" "The *field_names* are a sequence of strings such as ``['x', 'y']``. " "Alternatively, *field_names* can be a single string with each fieldname " "separated by whitespace and/or commas, for example ``'x y'`` or ``'x, y'``." msgstr "" "Los *nombres de campo* son una secuencia de cadenas como ``[‘x’, ‘y’]``. " "Alternativamente, *nombres de campo* puede ser una sola cadena con cada " "nombre de campo separado por espacios en blanco y/o comas, por ejemplo ``’x " "y’`` or ``’x, y’``." #: ../Doc/library/collections.rst:857 msgid "" "Any valid Python identifier may be used for a fieldname except for names " "starting with an underscore. Valid identifiers consist of letters, digits, " "and underscores but do not start with a digit or underscore and cannot be a :" "mod:`keyword` such as *class*, *for*, *return*, *global*, *pass*, or *raise*." msgstr "" "Se puede usar cualquier identificador de Python válido para un *fieldname*, " "excepto para los nombres que comienzan con un guión bajo. Los " "identificadores válidos constan de letras, dígitos y guiones bajos, pero no " "comienzan con un dígito o guion bajo y no pueden ser :mod:`keyword` como " "*class*, *for*, *return*, *global*, *pass*, o *raise*." #: ../Doc/library/collections.rst:863 msgid "" "If *rename* is true, invalid fieldnames are automatically replaced with " "positional names. For example, ``['abc', 'def', 'ghi', 'abc']`` is " "converted to ``['abc', '_1', 'ghi', '_3']``, eliminating the keyword ``def`` " "and the duplicate fieldname ``abc``." msgstr "" "Si *rename* es verdadero, los nombres de campo no válidos se reemplazan " "automáticamente con nombres posicionales. Por ejemplo, ``[‘abc’, ‘def’, " "‘ghi’, ‘abc’]`` se convierte en ``[‘abc’, ‘_1’, ‘ghi’, ‘_3’]``, eliminando " "la palabra clave ``def`` y el nombre de campo duplicado ``abc``." #: ../Doc/library/collections.rst:868 msgid "" "*defaults* can be ``None`` or an :term:`iterable` of default values. Since " "fields with a default value must come after any fields without a default, " "the *defaults* are applied to the rightmost parameters. For example, if the " "fieldnames are ``['x', 'y', 'z']`` and the defaults are ``(1, 2)``, then " "``x`` will be a required argument, ``y`` will default to ``1``, and ``z`` " "will default to ``2``." msgstr "" "*defaults* pueden ser ``None`` o un :term:`iterable` de los valores " "predeterminados. Dado que los campos con un valor predeterminado deben venir " "después de cualquier campo sin un valor predeterminado, los *defaults* se " "aplican a los parámetros situados más a la derecha. Por ejemplo, si los " "nombres de campo son ``[‘x’, ‘y’, ‘z’]``y los valores predeterminados son " "``(1, 2)``, entonces ``x`` será un argumento obligatorio, ``y`` tendrá el " "valor predeterminado de ``1``, y ``z`` el valor predeterminado de ``2``." #: ../Doc/library/collections.rst:875 msgid "" "If *module* is defined, the ``__module__`` attribute of the named tuple is " "set to that value." msgstr "" "Si se define *module*, el atributo ``__module__`` de la tupla nombrada se " "establece en ese valor." #: ../Doc/library/collections.rst:878 msgid "" "Named tuple instances do not have per-instance dictionaries, so they are " "lightweight and require no more memory than regular tuples." msgstr "" "Las instancias de tuplas con nombre no tienen diccionarios por instancia, " "por lo que son livianas y no requieren más memoria que las tuplas normales." #: ../Doc/library/collections.rst:881 msgid "" "To support pickling, the named tuple class should be assigned to a variable " "that matches *typename*." msgstr "" "Para admitir el serializado (*pickling*), la clase tupla con nombre debe " "asignarse a una variable que coincida con *typename*." #: ../Doc/library/collections.rst:884 msgid "Added support for *rename*." msgstr "Se agregó soporte para *rename*." #: ../Doc/library/collections.rst:887 msgid "" "The *verbose* and *rename* parameters became :ref:`keyword-only arguments " "`." msgstr "" "Los parámetros *verbose* y *rename* se convirtieron en :ref:`argumentos de " "solo palabra clave `." #: ../Doc/library/collections.rst:891 msgid "Added the *module* parameter." msgstr "Se agregó el parámetro *module*." #: ../Doc/library/collections.rst:894 msgid "Removed the *verbose* parameter and the :attr:`_source` attribute." msgstr "Se eliminaron el parámetro *verbose* y el atributo :attr:`_source`." #: ../Doc/library/collections.rst:897 msgid "" "Added the *defaults* parameter and the :attr:`_field_defaults` attribute." msgstr "" "Se agregaron el parámetro *defaults* y él atributo :attr:`_field_defaults`." #: ../Doc/library/collections.rst:917 msgid "" "Named tuples are especially useful for assigning field names to result " "tuples returned by the :mod:`csv` or :mod:`sqlite3` modules::" msgstr "" "Las tuplas con nombre son especialmente útiles para asignar nombres de campo " "a las tuplas de resultado retornadas por los módulos :mod:`csv` o :mod:" "`sqlite3`::" #: ../Doc/library/collections.rst:933 msgid "" "In addition to the methods inherited from tuples, named tuples support three " "additional methods and two attributes. To prevent conflicts with field " "names, the method and attribute names start with an underscore." msgstr "" "Además de los métodos heredados de las tuplas, las tuplas con nombre admiten " "tres métodos adicionales y dos atributos. Para evitar conflictos con los " "nombres de campo, los nombres de método y atributo comienzan con un guión " "bajo." #: ../Doc/library/collections.rst:939 msgid "" "Class method that makes a new instance from an existing sequence or iterable." msgstr "" "Método de clase que crea una nueva instancia a partir de una secuencia " "existente o iterable." #: ../Doc/library/collections.rst:949 msgid "" "Return a new :class:`dict` which maps field names to their corresponding " "values:" msgstr "" "Retorna un nuevo :class:`dict` que asigna los nombres de los campos a sus " "valores correspondientes:" #: ../Doc/library/collections.rst:958 msgid "Returns an :class:`OrderedDict` instead of a regular :class:`dict`." msgstr "Retorna un :class:`OrderedDict` en lugar de un :class:`dict` regular." #: ../Doc/library/collections.rst:961 msgid "" "Returns a regular :class:`dict` instead of an :class:`OrderedDict`. As of " "Python 3.7, regular dicts are guaranteed to be ordered. If the extra " "features of :class:`OrderedDict` are required, the suggested remediation is " "to cast the result to the desired type: ``OrderedDict(nt._asdict())``." msgstr "" "Retorna un :class:`dict` normal en lugar de un :class:`OrderedDict`. A " "partir de Python 3.7, se garantiza el orden de los diccionarios normales. Si " "se requieren las características adicionales de :class:`OrderedDict` , la " "corrección sugerida es emitir el resultado al tipo deseado: ``OrderedDict(nt." "_asdict())``." #: ../Doc/library/collections.rst:970 msgid "" "Return a new instance of the named tuple replacing specified fields with new " "values::" msgstr "" "Retorna una nueva instancia de la tupla nombrada reemplazando los campos " "especificados con nuevos valores::" #: ../Doc/library/collections.rst:982 msgid "" "Tuple of strings listing the field names. Useful for introspection and for " "creating new named tuple types from existing named tuples." msgstr "" "Tupla de cadenas que lista los nombres de los campos. Útil para la " "introspección y para crear nuevos tipos de tuplas con nombre a partir de " "tuplas con nombre existentes." #: ../Doc/library/collections.rst:997 msgid "Dictionary mapping field names to default values." msgstr "Diccionario de nombres de campos mapeados a valores predeterminados." #: ../Doc/library/collections.rst:1007 msgid "" "To retrieve a field whose name is stored in a string, use the :func:" "`getattr` function:" msgstr "" "Para recuperar un campo cuyo nombre está almacenado en una cadena, use la " "función :func:`getattr`:" #: ../Doc/library/collections.rst:1013 msgid "" "To convert a dictionary to a named tuple, use the double-star-operator (as " "described in :ref:`tut-unpacking-arguments`):" msgstr "" "Para convertir un diccionario en una tupla con nombre, use el operador de " "doble estrella (como se describe en :ref:`tut-unpacking-arguments`):" #: ../Doc/library/collections.rst:1020 msgid "" "Since a named tuple is a regular Python class, it is easy to add or change " "functionality with a subclass. Here is how to add a calculated field and a " "fixed-width print format:" msgstr "" "Dado que una tupla con nombre es una clase Python normal, es fácil agregar o " "cambiar la funcionalidad con una subclase. A continuación, se explica cómo " "agregar un campo calculado y un formato de impresión de ancho fijo:" #: ../Doc/library/collections.rst:1039 msgid "" "The subclass shown above sets ``__slots__`` to an empty tuple. This helps " "keep memory requirements low by preventing the creation of instance " "dictionaries." msgstr "" "La subclase que se muestra arriba establece ``__slots__`` a una tupla vacía. " "Esto ayuda a mantener bajos los requisitos de memoria al evitar la creación " "de diccionarios de instancia." #: ../Doc/library/collections.rst:1042 msgid "" "Subclassing is not useful for adding new, stored fields. Instead, simply " "create a new named tuple type from the :attr:`~somenamedtuple._fields` " "attribute:" msgstr "" "La subclasificación no es útil para agregar campos nuevos almacenados. En su " "lugar, simplemente cree un nuevo tipo de tupla con nombre a partir del " "atributo :attr:`~somenamedtuple._fields`:" #: ../Doc/library/collections.rst:1047 msgid "" "Docstrings can be customized by making direct assignments to the ``__doc__`` " "fields:" msgstr "" "Los docstrings se pueden personalizar realizando asignaciones directas a los " "campos ``__doc__`` :" #: ../Doc/library/collections.rst:1056 msgid "Property docstrings became writeable." msgstr "Los docstrings de propiedad se pueden escribir." #: ../Doc/library/collections.rst:1061 msgid "" "See :class:`typing.NamedTuple` for a way to add type hints for named " "tuples. It also provides an elegant notation using the :keyword:`class` " "keyword::" msgstr "" "Consulte :class:`typing.NamedTuple` para ver una forma de agregar " "sugerencias de tipo para tuplas con nombre. También proporciona una notación " "elegante usando la palabra clave :keyword:`class`::" #: ../Doc/library/collections.rst:1070 msgid "" "See :meth:`types.SimpleNamespace` for a mutable namespace based on an " "underlying dictionary instead of a tuple." msgstr "" "Vea :meth:`types.SimpleNamespace` para un espacio de nombres mutable basado " "en un diccionario subyacente en lugar de una tupla." #: ../Doc/library/collections.rst:1073 msgid "" "The :mod:`dataclasses` module provides a decorator and functions for " "automatically adding generated special methods to user-defined classes." msgstr "" "El módulo :mod:`dataclasses` proporciona un decorador y funciones para " "agregar automáticamente métodos especiales generados a clases definidas por " "el usuario." #: ../Doc/library/collections.rst:1078 msgid ":class:`OrderedDict` objects" msgstr "Objetos :class:`OrderedDict`" #: ../Doc/library/collections.rst:1080 msgid "" "Ordered dictionaries are just like regular dictionaries but have some extra " "capabilities relating to ordering operations. They have become less " "important now that the built-in :class:`dict` class gained the ability to " "remember insertion order (this new behavior became guaranteed in Python 3.7)." msgstr "" "Los diccionarios ordenados son como los diccionarios normales, pero tienen " "algunas capacidades adicionales relacionadas con las operaciones de " "ordenado. Se han vuelto menos importantes ahora que la clase incorporada :" "class:`dict` ganó la capacidad de recordar el orden de inserción (este nuevo " "comportamiento quedó garantizado en Python 3.7)." #: ../Doc/library/collections.rst:1086 msgid "Some differences from :class:`dict` still remain:" msgstr "Aún quedan algunas diferencias con :class:`dict` :" #: ../Doc/library/collections.rst:1088 msgid "" "The regular :class:`dict` was designed to be very good at mapping " "operations. Tracking insertion order was secondary." msgstr "" "El :class:`dict` normal fue diseñado para ser muy bueno en operaciones de " "mapeo. El seguimiento del pedido de inserción era secundario." #: ../Doc/library/collections.rst:1091 msgid "" "The :class:`OrderedDict` was designed to be good at reordering operations. " "Space efficiency, iteration speed, and the performance of update operations " "were secondary." msgstr "" "La :class:`OrderedDict` fue diseñada para ser buena para reordenar " "operaciones. La eficiencia del espacio, la velocidad de iteración y el " "rendimiento de las operaciones de actualización fueron secundarios." #: ../Doc/library/collections.rst:1095 msgid "" "The :class:`OrderedDict` algorithm can handle frequent reordering operations " "better than :class:`dict`. As shown in the recipes below, this makes it " "suitable for implementing various kinds of LRU caches." msgstr "" #: ../Doc/library/collections.rst:1099 msgid "" "The equality operation for :class:`OrderedDict` checks for matching order." msgstr "" "La operación de igualdad para :class:`OrderedDict` comprueba el orden " "coincidente." #: ../Doc/library/collections.rst:1101 msgid "" "A regular :class:`dict` can emulate the order sensitive equality test with " "``p == q and all(k1 == k2 for k1, k2 in zip(p, q))``." msgstr "" #: ../Doc/library/collections.rst:1104 msgid "" "The :meth:`popitem` method of :class:`OrderedDict` has a different " "signature. It accepts an optional argument to specify which item is popped." msgstr "" "El método :meth:`popitem` de :class:`OrderedDict` tiene una firma diferente. " "Acepta un argumento opcional para especificar qué elemento es *popped*." #: ../Doc/library/collections.rst:1107 msgid "" "A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=True)`` " "with ``d.popitem()`` which is guaranteed to pop the rightmost (last) item." msgstr "" #: ../Doc/library/collections.rst:1110 msgid "" "A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=False)`` " "with ``(k := next(iter(d)), d.pop(k))`` which will return and remove the " "leftmost (first) item if it exists." msgstr "" #: ../Doc/library/collections.rst:1114 msgid "" ":class:`OrderedDict` has a :meth:`move_to_end` method to efficiently " "reposition an element to an endpoint." msgstr "" ":class:`OrderedDict` tiene un método :meth:`move_to_end` para reposiciones " "eficientemente un elemento a un punto final." #: ../Doc/library/collections.rst:1117 msgid "" "A regular :class:`dict` can emulate OrderedDict's ``od.move_to_end(k, " "last=True)`` with ``d[k] = d.pop(k)`` which will move the key and its " "associated value to the rightmost (last) position." msgstr "" #: ../Doc/library/collections.rst:1121 msgid "" "A regular :class:`dict` does not have an efficient equivalent for " "OrderedDict's ``od.move_to_end(k, last=False)`` which moves the key and its " "associated value to the leftmost (first) position." msgstr "" #: ../Doc/library/collections.rst:1125 msgid "Until Python 3.8, :class:`dict` lacked a :meth:`__reversed__` method." msgstr "" "Hasta Python 3.8, :class:`dict` carecía de un método :meth:`__reversed__`." #: ../Doc/library/collections.rst:1130 msgid "" "Return an instance of a :class:`dict` subclass that has methods specialized " "for rearranging dictionary order." msgstr "" "Retorna una instancia de una subclase :class:`dict` que tiene métodos " "especializados para reorganizar el orden del diccionario." #: ../Doc/library/collections.rst:1137 msgid "" "The :meth:`popitem` method for ordered dictionaries returns and removes a " "(key, value) pair. The pairs are returned in :abbr:`LIFO (last-in, first-" "out)` order if *last* is true or :abbr:`FIFO (first-in, first-out)` order if " "false." msgstr "" "El método :meth:`popitem` para diccionarios ordenados retorna y elimina un " "par (llave, valor). Los pares se retornan en orden :abbr:`LIFO (last-in, " "first-out)` si el *último* es verdadero o en orden :abbr:`FIFO (first-in, " "first-out)` si es falso." #: ../Doc/library/collections.rst:1144 #, fuzzy msgid "" "Move an existing *key* to either end of an ordered dictionary. The item is " "moved to the right end if *last* is true (the default) or to the beginning " "if *last* is false. Raises :exc:`KeyError` if the *key* does not exist:" msgstr "" "Mueva una *llave* existente a cualquier extremo de un diccionario ordenado. " "El elemento se mueve al final de la derecha si el *último* es verdadero (el " "valor predeterminado) o al principio si el *último* es falso. Lanza :exc:" "`KeyError` si la *llave* no existe::" #: ../Doc/library/collections.rst:1161 msgid "" "In addition to the usual mapping methods, ordered dictionaries also support " "reverse iteration using :func:`reversed`." msgstr "" "Además de los métodos de mapeo habituales, los diccionarios ordenados " "también admiten la iteración inversa usando :func:`reversed`." #: ../Doc/library/collections.rst:1164 msgid "" "Equality tests between :class:`OrderedDict` objects are order-sensitive and " "are implemented as ``list(od1.items())==list(od2.items())``. Equality tests " "between :class:`OrderedDict` objects and other :class:`~collections.abc." "Mapping` objects are order-insensitive like regular dictionaries. This " "allows :class:`OrderedDict` objects to be substituted anywhere a regular " "dictionary is used." msgstr "" "Las pruebas de igualdad entre los objetos :class:`OrderedDict` son sensibles " "al orden y se implementan como ``list(od1.items())==list(od2.items())``. Las " "pruebas de igualdad entre los objetos :class:`OrderedDict` y otros objetos :" "class:`~collections.abc.Mapping` son insensibles al orden como los " "diccionarios normales. Esto permite que los objetos :class:`OrderedDict` " "sean sustituidos en cualquier lugar donde se utilice un diccionario normal." #: ../Doc/library/collections.rst:1171 msgid "" "The items, keys, and values :term:`views ` of :class:" "`OrderedDict` now support reverse iteration using :func:`reversed`." msgstr "" "Los elementos, llaves y valores :term:`vistas ` de :class:" "`OrderedDict` ahora admiten la iteración inversa usando :func:`reversed`." #: ../Doc/library/collections.rst:1175 msgid "" "With the acceptance of :pep:`468`, order is retained for keyword arguments " "passed to the :class:`OrderedDict` constructor and its :meth:`update` method." msgstr "" "Con la aceptación de :pep:`468`, el orden se mantiene para los argumentos de " "palabras clave pasados al constructor :class:`OrderedDict` y su método :meth:" "`update`." #: ../Doc/library/collections.rst:1185 msgid ":class:`OrderedDict` Examples and Recipes" msgstr "Ejemplos y Recetas :class:`OrderedDict`" #: ../Doc/library/collections.rst:1187 msgid "" "It is straightforward to create an ordered dictionary variant that remembers " "the order the keys were *last* inserted. If a new entry overwrites an " "existing entry, the original insertion position is changed and moved to the " "end::" msgstr "" "Es sencillo crear una variante de diccionario ordenado que recuerde el orden " "en que las llaves se insertaron por *última vez*. Si una nueva entrada " "sobrescribe una entrada existente, la posición de inserción original se " "cambia y se mueve al final::" #: ../Doc/library/collections.rst:1199 msgid "" "An :class:`OrderedDict` would also be useful for implementing variants of :" "func:`functools.lru_cache`:" msgstr "" "Un :class:`OrderedDict` también sería útil para implementar variantes de :" "func:`functools.lru_cache`::" #: ../Doc/library/collections.rst:1297 msgid ":class:`UserDict` objects" msgstr "Objetos :class:`UserDict`" #: ../Doc/library/collections.rst:1299 msgid "" "The class, :class:`UserDict` acts as a wrapper around dictionary objects. " "The need for this class has been partially supplanted by the ability to " "subclass directly from :class:`dict`; however, this class can be easier to " "work with because the underlying dictionary is accessible as an attribute." msgstr "" "La clase, :class:`UserDict` actúa como un contenedor alrededor de los " "objetos del diccionario. La necesidad de esta clase ha sido parcialmente " "suplantada por la capacidad de crear subclases directamente desde :class:" "`dict`; sin embargo, es más fácil trabajar con esta clase porque se puede " "acceder al diccionario subyacente como un atributo." #: ../Doc/library/collections.rst:1307 msgid "" "Class that simulates a dictionary. The instance's contents are kept in a " "regular dictionary, which is accessible via the :attr:`data` attribute of :" "class:`UserDict` instances. If *initialdata* is provided, :attr:`data` is " "initialized with its contents; note that a reference to *initialdata* will " "not be kept, allowing it to be used for other purposes." msgstr "" "Clase que simula un diccionario. El contenido de la instancia se guarda en " "un diccionario normal, al que se puede acceder mediante el atributo :attr:" "`data` de las instancias de :class:`UserDict`. Si se proporciona " "*initialdata*, :attr:`data` se inicializa con su contenido; tenga en cuenta " "que no se mantendrá una referencia a *initialdata*, lo que permite que se " "utilice para otros fines." #: ../Doc/library/collections.rst:1313 msgid "" "In addition to supporting the methods and operations of mappings, :class:" "`UserDict` instances provide the following attribute:" msgstr "" "Además de admitir los métodos y operaciones de los mappings, las instancias :" "class:`UserDict` proporcionan el siguiente atributo:" #: ../Doc/library/collections.rst:1318 msgid "" "A real dictionary used to store the contents of the :class:`UserDict` class." msgstr "" "Un diccionario real utilizado para almacenar el contenido de la clase :class:" "`UserDict` ." #: ../Doc/library/collections.rst:1324 msgid ":class:`UserList` objects" msgstr "Objetos :class:`UserList`" #: ../Doc/library/collections.rst:1326 msgid "" "This class acts as a wrapper around list objects. It is a useful base class " "for your own list-like classes which can inherit from them and override " "existing methods or add new ones. In this way, one can add new behaviors to " "lists." msgstr "" "Esta clase actúa como un contenedor alrededor de los objetos de lista. Es " "una clase base útil para tus propias clases tipo lista que pueden heredar de " "ellas y anular métodos existentes o agregar nuevos. De esta forma, se pueden " "agregar nuevos comportamientos a las listas." #: ../Doc/library/collections.rst:1331 msgid "" "The need for this class has been partially supplanted by the ability to " "subclass directly from :class:`list`; however, this class can be easier to " "work with because the underlying list is accessible as an attribute." msgstr "" "La necesidad de esta clase ha sido parcialmente suplantada por la capacidad " "de crear subclases directamente desde :class:`list`; sin embargo, es más " "fácil trabajar con esta clase porque se puede acceder a la lista subyacente " "como atributo." #: ../Doc/library/collections.rst:1337 msgid "" "Class that simulates a list. The instance's contents are kept in a regular " "list, which is accessible via the :attr:`data` attribute of :class:" "`UserList` instances. The instance's contents are initially set to a copy " "of *list*, defaulting to the empty list ``[]``. *list* can be any iterable, " "for example a real Python list or a :class:`UserList` object." msgstr "" "Clase que simula una lista. El contenido de la instancia se mantiene en una " "lista normal, a la que se puede acceder mediante el atributo :attr:`data` de " "las instancias :class:`UserList`. El contenido de la instancia se establece " "inicialmente en una copia de *list*, por defecto a la lista vacía ``[]``. " "*list* puede ser cualquier iterable, por ejemplo, una lista de Python real o " "un objeto :class:`UserList`." #: ../Doc/library/collections.rst:1343 msgid "" "In addition to supporting the methods and operations of mutable sequences, :" "class:`UserList` instances provide the following attribute:" msgstr "" "Además de admitir los métodos y operaciones de secuencias mutables, las " "instancias :class:`UserList` proporcionan el siguiente atributo:" #: ../Doc/library/collections.rst:1348 msgid "" "A real :class:`list` object used to store the contents of the :class:" "`UserList` class." msgstr "" "Un objeto real :class:`list` usado para almacenar el contenido de la clase :" "class:`UserList` ." #: ../Doc/library/collections.rst:1351 msgid "" "**Subclassing requirements:** Subclasses of :class:`UserList` are expected " "to offer a constructor which can be called with either no arguments or one " "argument. List operations which return a new sequence attempt to create an " "instance of the actual implementation class. To do so, it assumes that the " "constructor can be called with a single parameter, which is a sequence " "object used as a data source." msgstr "" "**Requisitos de subclases:** Se espera que las subclases de :class:" "`UserList` ofrezcan un constructor al que se pueda llamar sin argumentos o " "con un solo argumento. Las operaciones de lista que retornan una nueva " "secuencia intentan crear una instancia de la clase de implementación real. " "Para hacerlo, asume que se puede llamar al constructor con un solo " "parámetro, que es un objeto de secuencia utilizado como fuente de datos." #: ../Doc/library/collections.rst:1358 msgid "" "If a derived class does not wish to comply with this requirement, all of the " "special methods supported by this class will need to be overridden; please " "consult the sources for information about the methods which need to be " "provided in that case." msgstr "" "Si una clase derivada no desea cumplir con este requisito, todos los métodos " "especiales admitidos por esta clase deberán de anularse; consulte las " "fuentes para obtener información sobre los métodos que deben proporcionarse " "en ese caso." #: ../Doc/library/collections.rst:1364 msgid ":class:`UserString` objects" msgstr "Objetos :class:`UserString`" #: ../Doc/library/collections.rst:1366 msgid "" "The class, :class:`UserString` acts as a wrapper around string objects. The " "need for this class has been partially supplanted by the ability to subclass " "directly from :class:`str`; however, this class can be easier to work with " "because the underlying string is accessible as an attribute." msgstr "" "La clase, :class:`UserString` actúa como un envoltorio alrededor de los " "objetos de cadena. La necesidad de esta clase ha sido parcialmente " "suplantada por la capacidad de crear subclases directamente de :class:`str`; " "sin embargo, es más fácil trabajar con esta clase porque se puede acceder a " "la cadena subyacente como atributo." #: ../Doc/library/collections.rst:1374 msgid "" "Class that simulates a string object. The instance's content is kept in a " "regular string object, which is accessible via the :attr:`data` attribute " "of :class:`UserString` instances. The instance's contents are initially set " "to a copy of *seq*. The *seq* argument can be any object which can be " "converted into a string using the built-in :func:`str` function." msgstr "" "Clase que simula un objeto de cadena. El contenido de la instancia se " "mantiene en un objeto de cadena normal, al que se puede acceder a través del " "atributo :attr:`data` de las instancias :class:`UserString`. El contenido de " "la instancia se establece inicialmente en una copia de *seq*. El argumento " "*seq* puede ser cualquier objeto que se pueda convertir en una cadena usando " "la función incorporada :func:`str`." #: ../Doc/library/collections.rst:1381 msgid "" "In addition to supporting the methods and operations of strings, :class:" "`UserString` instances provide the following attribute:" msgstr "" "Además de admitir los métodos y operaciones de cadenas, las instancias :" "class:`UserString` proporcionan el siguiente atributo:" #: ../Doc/library/collections.rst:1386 msgid "" "A real :class:`str` object used to store the contents of the :class:" "`UserString` class." msgstr "" "Un objeto real :class:`str` usado para almacenar el contenido de la clase :" "class:`UserString`." #: ../Doc/library/collections.rst:1389 msgid "" "New methods ``__getnewargs__``, ``__rmod__``, ``casefold``, ``format_map``, " "``isprintable``, and ``maketrans``." msgstr "" "Nuevos métodos ``__getnewargs__``, ``__rmod__``, ``casefold``, " "``format_map``, ``isprintable``, y ``maketrans``." #~ msgid "" #~ "Algorithmically, :class:`OrderedDict` can handle frequent reordering " #~ "operations better than :class:`dict`. This makes it suitable for " #~ "tracking recent accesses (for example in an `LRU cache `_)." #~ msgstr "" #~ "Algorítmicamente, :class:`OrderedDict` puede manejar operaciones " #~ "frecuentes de reordenamiento mejor que :class:`dict`. Esto lo hace " #~ "adecuado para rastrear accesos recientes (por ejemplo, en un `cache LRU " #~ "`_)."