diff --git a/dictionaries/library_struct.txt b/dictionaries/library_struct.txt new file mode 100644 index 0000000000..73559ab2f0 --- /dev/null +++ b/dictionaries/library_struct.txt @@ -0,0 +1,4 @@ +middle +binary +precision +Struct diff --git a/library/struct.po b/library/struct.po index cc64c54645..05b61bc1a6 100644 --- a/library/struct.po +++ b/library/struct.po @@ -6,27 +6,29 @@ # Check https://github.com/python/python-docs-es/blob/3.8/TRANSLATORS to # get the list of volunteers # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-05 12:54+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2020-11-01 22:56+0100\n" "Language-Team: python-doc-es\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.8.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Generator: Poedit 2.3\n" #: ../Doc/library/struct.rst:2 msgid ":mod:`struct` --- Interpret bytes as packed binary data" -msgstr "" +msgstr ":mod:`struct` --- Interpreta bytes como paquetes de datos binarios" #: ../Doc/library/struct.rst:7 msgid "**Source code:** :source:`Lib/struct.py`" -msgstr "" +msgstr "**Código fuente:** :source:`Lib/struct.py`" #: ../Doc/library/struct.rst:15 msgid "" @@ -37,6 +39,12 @@ msgid "" "the layout of the C structs and the intended conversion to/from Python " "values." msgstr "" +"Este módulo realiza conversiones entre valores de Python y estructuras C " +"representadas como objetos :class:`bytes` de Python. Se puede utilizar para " +"el tratamiento de datos binarios almacenados en archivos o desde conexiones " +"de red, entre otras fuentes. Utiliza :ref:`struct-format-strings` como " +"descripciones compactas del diseño de las estructuras C y la conversión " +"prevista a/desde valores de Python." #: ../Doc/library/struct.rst:23 msgid "" @@ -48,6 +56,15 @@ msgid "" "or omit implicit pad bytes, use ``standard`` size and alignment instead of " "``native`` size and alignment: see :ref:`struct-alignment` for details." msgstr "" +"Por defecto, el resultado de empaquetar una estructura C determinada incluye " +"bytes de relleno para mantener la alineación adecuada para los tipos " +"correspondientes en C; del mismo modo, la alineación se tiene en cuenta al " +"desempaquetar. Este comportamiento se elige para que los bytes de una " +"estructura empaquetada se correspondan exactamente con el diseño en memoria " +"de la estructura C correspondiente. Para tratar formatos de datos que sean " +"independientes de la plataforma u omitir bytes de relleno implícitos, " +"utiliza el tamaño y la alineación ``estándar`` en lugar del ``nativo``: ver :" +"ref:`struct-alignment` para obtener más información." #: ../Doc/library/struct.rst:31 msgid "" @@ -59,20 +76,29 @@ msgid "" "implement the buffer protocol, so that they can be read/filled without " "additional copying from a :class:`bytes` object." msgstr "" +"Varias funciones :mod:`struct` (y métodos de :class:`Struct`) toman un " +"argumento *buffer*. Esto hace referencia a los objetos que implementan :ref:" +"`bufferobjects` y proporcionan un búfer de lectura o de lectura/escritura. " +"Los tipos más comunes utilizados para ese propósito son :class:`bytes` y :" +"class:`bytearray`, pero muchos otros tipos que se pueden ver como una lista " +"de bytes implementan el protocolo de búfer, para que se puedan leer/rellenar " +"sin necesidad de copiar a partir de un objeto :class:`bytes`." #: ../Doc/library/struct.rst:40 msgid "Functions and Exceptions" -msgstr "" +msgstr "Funciones y Excepciones" #: ../Doc/library/struct.rst:42 msgid "The module defines the following exception and functions:" -msgstr "" +msgstr "El módulo define la siguiente excepción y funciones:" #: ../Doc/library/struct.rst:47 msgid "" "Exception raised on various occasions; argument is a string describing what " "is wrong." msgstr "" +"Excepción lanzada en varias ocasiones; el argumento es una *string* que " +"describe lo que está mal." #: ../Doc/library/struct.rst:53 msgid "" @@ -80,6 +106,9 @@ msgid "" "to the format string *format*. The arguments must match the values required " "by the format exactly." msgstr "" +"Retorna un objeto bytes que contiene los valores *v1*, *v2*, ... empaquetado " +"de acuerdo con la cadena de formato *format*. Los argumentos deben " +"coincidir exactamente con los valores requeridos por el formato." #: ../Doc/library/struct.rst:60 msgid "" @@ -87,6 +116,10 @@ msgid "" "write the packed bytes into the writable buffer *buffer* starting at " "position *offset*. Note that *offset* is a required argument." msgstr "" +"Empaqueta los valores *v1*, *v2*, ... de acuerdo con la cadena de formato " +"*format* y escribe los bytes empaquetados en el búfer de escritura *buffer* " +"comenzando en la posición *offset*. Nota: *offset* es un argumento " +"obligatorio." #: ../Doc/library/struct.rst:67 msgid "" @@ -95,6 +128,11 @@ msgid "" "contains exactly one item. The buffer's size in bytes must match the size " "required by the format, as reflected by :func:`calcsize`." msgstr "" +"Desempaqueta del búfer *buffer* (normalmente empaquetado por " +"``pack(format, ...)``) según la cadena de formato *format*. El resultado es " +"una tupla incluso si contiene un solo elemento. El tamaño del búfer en " +"bytes debe coincidir con el tamaño requerido por el formato, como se refleja " +"en :func:`calcsize`." #: ../Doc/library/struct.rst:75 msgid "" @@ -103,6 +141,11 @@ msgid "" "item. The buffer's size in bytes, starting at position *offset*, must be at " "least the size required by the format, as reflected by :func:`calcsize`." msgstr "" +"Desempaqueta del *buffer* comenzando en la posición *offset*, según la " +"cadena de formato *format*. El resultado es una tupla incluso si contiene " +"un solo elemento. El tamaño del búfer en bytes, comenzando en la posición " +"*offset*, debe tener al menos el tamaño requerido por el formato, como se " +"refleja en :func:`calcsize`." #: ../Doc/library/struct.rst:83 msgid "" @@ -112,20 +155,30 @@ msgid "" "buffer's size in bytes must be a multiple of the size required by the " "format, as reflected by :func:`calcsize`." msgstr "" +"Desempaqueta de manera iterativa desde el búfer *buffer* según la cadena de " +"formato *format*. Esta función retorna un iterador que leerá fragmentos de " +"igual tamaño desde el búfer hasta que se haya consumido todo su contenido. " +"El tamaño del búfer en bytes debe ser un múltiplo del tamaño requerido por " +"el formato, como se refleja en :func:`calcsize`." #: ../Doc/library/struct.rst:89 msgid "Each iteration yields a tuple as specified by the format string." msgstr "" +"Cada iteración produce una tupla según lo especificado por la cadena de " +"formato." #: ../Doc/library/struct.rst:96 msgid "" "Return the size of the struct (and hence of the bytes object produced by " "``pack(format, ...)``) corresponding to the format string *format*." msgstr "" +"Retorna el tamaño de la estructura (y, por lo tanto, del objeto bytes " +"generado por ``pack(format, ...)``) correspondiente a la cadena de formato " +"*format*." #: ../Doc/library/struct.rst:103 msgid "Format Strings" -msgstr "" +msgstr "Cadenas de Formato" #: ../Doc/library/struct.rst:105 msgid "" @@ -135,10 +188,15 @@ msgid "" "addition, there are special characters for controlling the :ref:`struct-" "alignment`." msgstr "" +"Las cadenas de formato son el mecanismo utilizado para especificar el diseño " +"esperado al empaquetar y desempaquetar datos. Se crean a partir de :ref:" +"`format-characters`, que especifican el tipo de datos que se empaquetan/" +"desempaquetan. Además, hay caracteres especiales para controlar :ref:" +"`struct-alignment`." #: ../Doc/library/struct.rst:114 msgid "Byte Order, Size, and Alignment" -msgstr "" +msgstr "Orden de Bytes, Tamaño y Alineación" #: ../Doc/library/struct.rst:116 msgid "" @@ -146,6 +204,9 @@ msgid "" "order, and properly aligned by skipping pad bytes if necessary (according to " "the rules used by the C compiler)." msgstr "" +"Por defecto, los tipos C se representan en el formato nativo y el orden de " +"bytes de la máquina, y se alinean correctamente omitiendo bytes de relleno " +"si es necesario (según las reglas utilizadas por el compilador de C)." #: ../Doc/library/struct.rst:127 msgid "" @@ -153,72 +214,75 @@ msgid "" "indicate the byte order, size and alignment of the packed data, according to " "the following table:" msgstr "" +"Como alternativa, el primer carácter de la cadena de formato se puede " +"utilizar para indicar el orden de bytes, el tamaño y la alineación de los " +"datos empaquetados, según la tabla siguiente:" #: ../Doc/library/struct.rst:132 msgid "Character" -msgstr "" +msgstr "Caracter" #: ../Doc/library/struct.rst:132 msgid "Byte order" -msgstr "" +msgstr "Orden de Bytes" #: ../Doc/library/struct.rst:132 msgid "Size" -msgstr "" +msgstr "Tamaño" #: ../Doc/library/struct.rst:132 msgid "Alignment" -msgstr "" +msgstr "Alineamiento" #: ../Doc/library/struct.rst:134 msgid "``@``" -msgstr "" +msgstr "``@``" #: ../Doc/library/struct.rst:134 ../Doc/library/struct.rst:136 msgid "native" -msgstr "" +msgstr "nativo" #: ../Doc/library/struct.rst:136 msgid "``=``" -msgstr "" +msgstr "``=``" #: ../Doc/library/struct.rst:136 ../Doc/library/struct.rst:138 #: ../Doc/library/struct.rst:140 ../Doc/library/struct.rst:142 msgid "standard" -msgstr "" +msgstr "standard" #: ../Doc/library/struct.rst:136 ../Doc/library/struct.rst:138 #: ../Doc/library/struct.rst:140 ../Doc/library/struct.rst:142 msgid "none" -msgstr "" +msgstr "none" #: ../Doc/library/struct.rst:138 msgid "``<``" -msgstr "" +msgstr "``<``" #: ../Doc/library/struct.rst:138 msgid "little-endian" -msgstr "" +msgstr "little-endian" #: ../Doc/library/struct.rst:140 msgid "``>``" -msgstr "" +msgstr "``>``" #: ../Doc/library/struct.rst:140 msgid "big-endian" -msgstr "" +msgstr "big-endian" #: ../Doc/library/struct.rst:142 msgid "``!``" -msgstr "" +msgstr "``!``" #: ../Doc/library/struct.rst:142 msgid "network (= big-endian)" -msgstr "" +msgstr "red (= big-endian)" #: ../Doc/library/struct.rst:145 msgid "If the first character is not one of these, ``'@'`` is assumed." -msgstr "" +msgstr "Si el primer carácter no es uno de estos, se asume ``'@'``." #: ../Doc/library/struct.rst:147 msgid "" @@ -228,52 +292,74 @@ msgid "" "switchable endianness (bi-endian). Use ``sys.byteorder`` to check the " "endianness of your system." msgstr "" +"El orden de bytes nativo es big-endian o little-endian, dependiendo del " +"sistema host. Por ejemplo, Intel x86 y AMD64 (x86-64) son little-endian; " +"Motorola 68000 y PowerPC G5 son big-endian; ARM e Intel *Itanium* tienen la " +"propiedad de trabajar con ambos formatos (middle-endian). Utiliza ``sys." +"byteorder`` para comprobar la *endianness* (\"extremidad\") de su sistema." #: ../Doc/library/struct.rst:153 msgid "" "Native size and alignment are determined using the C compiler's ``sizeof`` " "expression. This is always combined with native byte order." msgstr "" +"El tamaño y la alineación nativos se determinan mediante la expresión " +"``sizeof`` del compilador de C. Esto siempre se combina con el orden de " +"bytes nativo." #: ../Doc/library/struct.rst:156 msgid "" "Standard size depends only on the format character; see the table in the :" "ref:`format-characters` section." msgstr "" +"El tamaño estándar depende únicamente del carácter de formato; ver la tabla " +"en la sección :ref:`format-characters`." #: ../Doc/library/struct.rst:159 msgid "" "Note the difference between ``'@'`` and ``'='``: both use native byte order, " "but the size and alignment of the latter is standardized." msgstr "" +"Nótese la diferencia entre ``'@'`` y ``'='`` : ambos utilizan el orden de " +"bytes nativo, pero el tamaño y la alineación de este último está " +"estandarizado." #: ../Doc/library/struct.rst:162 msgid "" "The form ``'!'`` is available for those poor souls who claim they can't " "remember whether network byte order is big-endian or little-endian." msgstr "" +"La forma ``'!'`` está disponible para aquellas pobres almas que afirman que " +"no pueden recordar si el orden de bytes de red es big-endian o little-endian." #: ../Doc/library/struct.rst:165 msgid "" "There is no way to indicate non-native byte order (force byte-swapping); use " "the appropriate choice of ``'<'`` or ``'>'``." msgstr "" +"No hay manera de indicar el orden de bytes no nativo (forzar el intercambio " +"de bytes); utiliza la elección adecuada de ``'<'`` o ``'>'``." #: ../Doc/library/struct.rst:168 ../Doc/library/struct.rst:247 msgid "Notes:" -msgstr "" +msgstr "Notas:" #: ../Doc/library/struct.rst:170 msgid "" "Padding is only automatically added between successive structure members. No " "padding is added at the beginning or the end of the encoded struct." msgstr "" +"El relleno solo se agrega automáticamente entre los miembros sucesivos de la " +"estructura. No se agrega ningún relleno al principio o al final de la " +"estructura codificada." #: ../Doc/library/struct.rst:173 msgid "" "No padding is added when using non-native size and alignment, e.g. with '<', " "'>', '=', and '!'." msgstr "" +"No se añade ningún relleno cuando se utiliza el tamaño y la alineación no " +"nativos, por ejemplo, con '<', '>', '=' y '!'." #: ../Doc/library/struct.rst:176 msgid "" @@ -281,10 +367,13 @@ msgid "" "type, end the format with the code for that type with a repeat count of " "zero. See :ref:`struct-examples`." msgstr "" +"Para alinear el final de una estructura con el requisito de alineación de un " +"tipo determinado, termina el formato con el código de ese tipo con un dos " +"ceros. Véase :ref:`struct-examples`." #: ../Doc/library/struct.rst:184 msgid "Format Characters" -msgstr "" +msgstr "Formato de caracteres" #: ../Doc/library/struct.rst:186 msgid "" @@ -295,63 +384,69 @@ msgid "" "``'!'`` or ``'='``. When using native size, the size of the packed value is " "platform-dependent." msgstr "" +"Los caracteres de formato tienen el siguiente significado; la conversión " +"entre los valores C y Python debe ser obvia dados sus tipos. La columna " +"'Tamaño estándar' hace referencia al tamaño del valor empaquetado en bytes " +"cuando se utiliza el tamaño estándar; es decir, cuando la cadena de formato " +"comienza con uno de ``'<'``, ``'>'``, ``'!'`` o ``'='``. Cuando se utiliza " +"el tamaño nativo, el tamaño del valor empaquetado depende de la plataforma." #: ../Doc/library/struct.rst:194 msgid "Format" -msgstr "" +msgstr "Formato" #: ../Doc/library/struct.rst:194 msgid "C Type" -msgstr "" +msgstr "Tipo C" #: ../Doc/library/struct.rst:194 msgid "Python type" -msgstr "" +msgstr "Tipo Python" #: ../Doc/library/struct.rst:194 msgid "Standard size" -msgstr "" +msgstr "Tamaño estándar" #: ../Doc/library/struct.rst:194 msgid "Notes" -msgstr "" +msgstr "Notas" #: ../Doc/library/struct.rst:196 msgid "``x``" -msgstr "" +msgstr "``x``" #: ../Doc/library/struct.rst:196 msgid "pad byte" -msgstr "" +msgstr "byte de relleno" #: ../Doc/library/struct.rst:196 msgid "no value" -msgstr "" +msgstr "sin valor" #: ../Doc/library/struct.rst:198 msgid "``c``" -msgstr "" +msgstr "``c``" #: ../Doc/library/struct.rst:198 msgid ":c:type:`char`" -msgstr "" +msgstr ":c:type:`char`" #: ../Doc/library/struct.rst:198 msgid "bytes of length 1" -msgstr "" +msgstr "bytes de longitud 1" #: ../Doc/library/struct.rst:198 ../Doc/library/struct.rst:200 #: ../Doc/library/struct.rst:202 ../Doc/library/struct.rst:204 msgid "1" -msgstr "" +msgstr "1" #: ../Doc/library/struct.rst:200 msgid "``b``" -msgstr "" +msgstr "``b``" #: ../Doc/library/struct.rst:200 msgid ":c:type:`signed char`" -msgstr "" +msgstr ":c:type:`signed char`" #: ../Doc/library/struct.rst:200 ../Doc/library/struct.rst:202 #: ../Doc/library/struct.rst:206 ../Doc/library/struct.rst:208 @@ -361,19 +456,19 @@ msgstr "" #: ../Doc/library/struct.rst:223 ../Doc/library/struct.rst:225 #: ../Doc/library/struct.rst:237 msgid "integer" -msgstr "" +msgstr "integer" #: ../Doc/library/struct.rst:200 msgid "\\(1), \\(2)" -msgstr "" +msgstr "\\(1), \\(2)" #: ../Doc/library/struct.rst:202 msgid "``B``" -msgstr "" +msgstr "``B``" #: ../Doc/library/struct.rst:202 msgid ":c:type:`unsigned char`" -msgstr "" +msgstr ":c:type:`unsigned char`" #: ../Doc/library/struct.rst:202 ../Doc/library/struct.rst:206 #: ../Doc/library/struct.rst:208 ../Doc/library/struct.rst:210 @@ -381,193 +476,193 @@ msgstr "" #: ../Doc/library/struct.rst:216 ../Doc/library/struct.rst:218 #: ../Doc/library/struct.rst:220 msgid "\\(2)" -msgstr "" +msgstr "\\(2)" #: ../Doc/library/struct.rst:204 msgid "``?``" -msgstr "" +msgstr "\\(2)" #: ../Doc/library/struct.rst:204 msgid ":c:type:`_Bool`" -msgstr "" +msgstr ":c:type:`_Bool`" #: ../Doc/library/struct.rst:204 msgid "bool" -msgstr "" +msgstr "bool" #: ../Doc/library/struct.rst:204 msgid "\\(1)" -msgstr "" +msgstr "\\(1)" #: ../Doc/library/struct.rst:206 msgid "``h``" -msgstr "" +msgstr "``h``" #: ../Doc/library/struct.rst:206 msgid ":c:type:`short`" -msgstr "" +msgstr ":c:type:`short`" #: ../Doc/library/struct.rst:206 ../Doc/library/struct.rst:208 #: ../Doc/library/struct.rst:227 msgid "2" -msgstr "" +msgstr "2" #: ../Doc/library/struct.rst:208 msgid "``H``" -msgstr "" +msgstr "``H``" #: ../Doc/library/struct.rst:208 msgid ":c:type:`unsigned short`" -msgstr "" +msgstr ":c:type:`unsigned short`" #: ../Doc/library/struct.rst:210 msgid "``i``" -msgstr "" +msgstr "``i``" #: ../Doc/library/struct.rst:210 msgid ":c:type:`int`" -msgstr "" +msgstr ":c:type:`int`" #: ../Doc/library/struct.rst:210 ../Doc/library/struct.rst:212 #: ../Doc/library/struct.rst:214 ../Doc/library/struct.rst:216 #: ../Doc/library/struct.rst:229 msgid "4" -msgstr "" +msgstr "4" #: ../Doc/library/struct.rst:212 msgid "``I``" -msgstr "" +msgstr "``I``" #: ../Doc/library/struct.rst:212 msgid ":c:type:`unsigned int`" -msgstr "" +msgstr ":c:type:`unsigned int`" #: ../Doc/library/struct.rst:214 msgid "``l``" -msgstr "" +msgstr "``l``" #: ../Doc/library/struct.rst:214 msgid ":c:type:`long`" -msgstr "" +msgstr ":c:type:`long`" #: ../Doc/library/struct.rst:216 msgid "``L``" -msgstr "" +msgstr "``L``" #: ../Doc/library/struct.rst:216 msgid ":c:type:`unsigned long`" -msgstr "" +msgstr ":c:type:`unsigned long`" #: ../Doc/library/struct.rst:218 msgid "``q``" -msgstr "" +msgstr "``q``" #: ../Doc/library/struct.rst:218 msgid ":c:type:`long long`" -msgstr "" +msgstr ":c:type:`long long`" #: ../Doc/library/struct.rst:218 ../Doc/library/struct.rst:220 #: ../Doc/library/struct.rst:231 msgid "8" -msgstr "" +msgstr "8" #: ../Doc/library/struct.rst:220 msgid "``Q``" -msgstr "" +msgstr "``Q``" #: ../Doc/library/struct.rst:220 msgid ":c:type:`unsigned long long`" -msgstr "" +msgstr ":c:type:`unsigned long long`" #: ../Doc/library/struct.rst:223 msgid "``n``" -msgstr "" +msgstr "``n``" #: ../Doc/library/struct.rst:223 msgid ":c:type:`ssize_t`" -msgstr "" +msgstr ":c:type:`ssize_t`" #: ../Doc/library/struct.rst:223 ../Doc/library/struct.rst:225 msgid "\\(3)" -msgstr "" +msgstr "\\(3)" #: ../Doc/library/struct.rst:225 msgid "``N``" -msgstr "" +msgstr "``N``" #: ../Doc/library/struct.rst:225 msgid ":c:type:`size_t`" -msgstr "" +msgstr ":c:type:`size_t`" #: ../Doc/library/struct.rst:227 msgid "``e``" -msgstr "" +msgstr "``e``" #: ../Doc/library/struct.rst:227 msgid "\\(6)" -msgstr "" +msgstr "\\(6)" #: ../Doc/library/struct.rst:227 ../Doc/library/struct.rst:229 #: ../Doc/library/struct.rst:231 msgid "float" -msgstr "" +msgstr "float" #: ../Doc/library/struct.rst:227 ../Doc/library/struct.rst:229 #: ../Doc/library/struct.rst:231 msgid "\\(4)" -msgstr "" +msgstr "\\(4)" #: ../Doc/library/struct.rst:229 msgid "``f``" -msgstr "" +msgstr "``f``" #: ../Doc/library/struct.rst:229 msgid ":c:type:`float`" -msgstr "" +msgstr ":c:type:`float`" #: ../Doc/library/struct.rst:231 msgid "``d``" -msgstr "" +msgstr "``d``" #: ../Doc/library/struct.rst:231 msgid ":c:type:`double`" -msgstr "" +msgstr ":c:type:`double`" #: ../Doc/library/struct.rst:233 msgid "``s``" -msgstr "" +msgstr "``s``" #: ../Doc/library/struct.rst:233 ../Doc/library/struct.rst:235 msgid ":c:type:`char[]`" -msgstr "" +msgstr ":c:type:`char[]`" #: ../Doc/library/struct.rst:233 ../Doc/library/struct.rst:235 msgid "bytes" -msgstr "" +msgstr "bytes" #: ../Doc/library/struct.rst:235 msgid "``p``" -msgstr "" +msgstr "``p``" #: ../Doc/library/struct.rst:237 msgid "``P``" -msgstr "" +msgstr "``P``" #: ../Doc/library/struct.rst:237 msgid ":c:type:`void \\*`" -msgstr "" +msgstr ":c:type:`void \\*`" #: ../Doc/library/struct.rst:237 msgid "\\(5)" -msgstr "" +msgstr "\\(5)" #: ../Doc/library/struct.rst:240 msgid "Added support for the ``'n'`` and ``'N'`` formats." -msgstr "" +msgstr "Soporte añadido para los formatos ``'n'`` y ``'N'``." #: ../Doc/library/struct.rst:243 msgid "Added support for the ``'e'`` format." -msgstr "" +msgstr "Soporte añadido para el formato ``'e'``." #: ../Doc/library/struct.rst:252 msgid "" @@ -575,6 +670,9 @@ msgid "" "by C99. If this type is not available, it is simulated using a :c:type:" "`char`. In standard mode, it is always represented by one byte." msgstr "" +"El código de conversión ``'?'`` corresponde al tipo :c:type:`_Bool` definido " +"por C99. Si este tipo no está disponible, se simula mediante un :c:type:" +"`char`. En el modo estándar, siempre se representa mediante un byte." #: ../Doc/library/struct.rst:257 msgid "" @@ -582,10 +680,15 @@ msgid "" "codes, if the non-integer has a :meth:`__index__` method then that method is " "called to convert the argument to an integer before packing." msgstr "" +"Al intentar empaquetar un no entero mediante cualquiera de los códigos de " +"conversión de enteros, si el no entero tiene un método :meth:`__index__`, se " +"llama a ese método para convertir el argumento en un entero antes de " +"empaquetar." #: ../Doc/library/struct.rst:261 msgid "Use of the :meth:`__index__` method for non-integers is new in 3.2." msgstr "" +"El uso del método :meth:`__index__` para los no enteros es nuevo en 3.2." #: ../Doc/library/struct.rst:265 msgid "" @@ -594,6 +697,10 @@ msgid "" "the standard size, you can use whichever of the other integer formats fits " "your application." msgstr "" +"Los códigos de conversión ``'n'`` y ``'N'`` solo están disponibles para el " +"tamaño nativo (seleccionado como predeterminado o con el carácter de orden " +"de bytes ``'@'``). Para el tamaño estándar, puedes usar cualquiera de los " +"otros formatos enteros que se ajusten a tu aplicación." #: ../Doc/library/struct.rst:271 msgid "" @@ -602,6 +709,10 @@ msgid "" "``'f'``, ``'d'`` or ``'e'`` respectively), regardless of the floating-point " "format used by the platform." msgstr "" +"Para los códigos de conversión ``'f'``, ``'d'`` y ``'e'``, la representación " +"empaquetada utiliza el formato IEEE 754 binary32, binary64 o binary16 (para " +"``'f'``, ``'d'`` o ``'e'`` respectivamente), independientemente del formato " +"de punto flotante utilizado por la plataforma." #: ../Doc/library/struct.rst:277 msgid "" @@ -611,6 +722,12 @@ msgid "" "on the host system. The struct module does not interpret this as native " "ordering, so the ``'P'`` format is not available." msgstr "" +"El carácter de formato ``'P'`` solo está disponible para el orden de bytes " +"nativo (seleccionado como predeterminado o con el carácter de orden de bytes " +"``'@'``). El carácter de orden de bytes ``'='`` elige utilizar el orden " +"little- o big-endian basado en el sistema host. El módulo *struct* no " +"interpreta esto como un orden nativo, por lo que el formato ``'P'`` no está " +"disponible." #: ../Doc/library/struct.rst:284 msgid "" @@ -623,18 +740,33 @@ msgid "" "operations. See the Wikipedia page on the `half-precision floating-point " "format `_ for more information." msgstr "" +"El tipo IEEE 754 binary16 \"half precision\" se introdujo en la revisión de " +"2008 del `IEEE 754 estándar `_. Tiene un bit de signo, " +"un exponente de 5 bits y una precisión de 11 bits (con 10 bits almacenados " +"explícitamente) y puede representar números entre aproximadamente " +"``6.1e-05`` y ``6.5e+04`` con total precisión. Este tipo no es ampliamente " +"compatible con los compiladores de C: en un equipo típico, un *unsigned* " +"short se puede usar para el almacenamiento, pero no para las operaciones " +"matemáticas. Consulte la página de Wikipedia en el `formato de punto " +"flotante de media precisión `_ para obtener más " +"información." #: ../Doc/library/struct.rst:294 msgid "" "A format character may be preceded by an integral repeat count. For " "example, the format string ``'4h'`` means exactly the same as ``'hhhh'``." msgstr "" +"Un carácter de formato puede ir precedido de un número de recuento que " +"repite tantas veces el carácter. Por ejemplo, la cadena de formato ``'4h'`` " +"significa exactamente lo mismo que ``'hhhh'`` ." #: ../Doc/library/struct.rst:297 msgid "" "Whitespace characters between formats are ignored; a count and its format " "must not contain whitespace though." msgstr "" +"Se omiten los caracteres de espacio entre formatos; sin embargo, un recuento " +"y su formato no deben contener espacios en blanco." #: ../Doc/library/struct.rst:300 msgid "" @@ -647,6 +779,15 @@ msgid "" "number of bytes. As a special case, ``'0s'`` means a single, empty string " "(while ``'0c'`` means 0 characters)." msgstr "" +"Para el carácter de formato ``'s'``, el recuento se interpreta como la " +"longitud de los bytes, no un recuento de repetición como para los otros " +"caracteres de formato; por ejemplo, ``'10s'`` significa una sola cadena de " +"10 bytes, mientras que ``'10c'`` significa 10 caracteres. Si no se da un " +"recuento, el valor predeterminado es 1. Para el empaquetado, la cadena es " +"truncada o rellenada con bytes nulos según corresponda para que se ajuste. " +"Para desempaquetar, el objeto bytes resultante siempre tiene exactamente el " +"número especificado de bytes. Como caso especial, ``'0s'`` significa una " +"sola cadena vacía (mientras que ``'0c'`` significa 0 caracteres)." #: ../Doc/library/struct.rst:309 msgid "" @@ -655,12 +796,18 @@ msgid "" "``'Q'``), if ``x`` is outside the valid range for that format then :exc:" "`struct.error` is raised." msgstr "" +"Al empaquetar un valor ``x`` utilizando uno de los formatos enteros " +"(``'b'``, ``'B'``, ``'h'``, ``'H'``, ``'i'``, ``'I'``, ``'l'``, ``'L'``, " +"``'q'``, ``'Q'``), si ``x`` está fuera de un rango válido para ese formato, " +"entonces se lanza la excepción :exc:`struct.error`." #: ../Doc/library/struct.rst:314 msgid "" "In 3.0, some of the integer formats wrapped out-of-range values and raised :" "exc:`DeprecationWarning` instead of :exc:`struct.error`." msgstr "" +"En 3.0, algunos de los formatos enteros ajustaban los valores fuera de rango " +"y lanza :exc:`DeprecationWarning` en lugar de :exc:`struct.error`." #: ../Doc/library/struct.rst:318 msgid "" @@ -675,6 +822,17 @@ msgid "" "consumes ``count`` bytes, but that the string returned can never contain " "more than 255 bytes." msgstr "" +"El carácter de formato ``'p'`` codifica una \"cadena de Pascal\", lo que " +"significa una cadena de longitud variable corta almacenada en un número " +"*fijo de bytes*, dado por el recuento. El primer byte almacenado es el valor " +"mínimo entre la longitud de la cadena o 255. A continuación se encuentran " +"los bytes de la cadena. Si la cadena pasada a :func:`pack` es demasiado " +"larga (más larga que la cuenta menos 1), solo se almacenan los bytes " +"iniciales ``count-1`` de la cadena. Si la cadena es más corta que " +"``count-1``, se rellena con bytes nulos para que se utilicen exactamente los " +"bytes de recuento en total. Tenga en cuenta que para :func:`unpack`, el " +"carácter de formato ``'p'`` consume bytes ``count``, pero que la cadena " +"retornada nunca puede contener más de 255 bytes." #: ../Doc/library/struct.rst:331 msgid "" @@ -683,68 +841,83 @@ msgid "" "used. Either 0 or 1 in the native or standard bool representation will be " "packed, and any non-zero value will be ``True`` when unpacking." msgstr "" +"Para el carácter de formato ``'?'``, el valor retornado es :const:`True` o :" +"const:`False`. Al empaquetar, se utiliza el valor verdadero del objeto del " +"argumento. Se empaquetará 0 o 1 en la representación *bool* nativa o " +"estándar, y cualquier valor distinto de cero será ``True`` al desempaquetar." #: ../Doc/library/struct.rst:341 msgid "Examples" -msgstr "" +msgstr "Ejemplos" #: ../Doc/library/struct.rst:344 msgid "" "All examples assume a native byte order, size, and alignment with a big-" "endian machine." msgstr "" +"Todos los ejemplos asumen un orden de bytes tamaño y alineación nativos, con " +"una máquina big-endian." #: ../Doc/library/struct.rst:347 msgid "A basic example of packing/unpacking three integers::" -msgstr "" +msgstr "Un ejemplo básico de empaquetado/desempaquetado de tres enteros::" #: ../Doc/library/struct.rst:357 msgid "" "Unpacked fields can be named by assigning them to variables or by wrapping " "the result in a named tuple::" msgstr "" +"Los campos desempaquetados se pueden nombrar asignándolos a variables o " +"ajustando el resultado en una tupla con nombre::" #: ../Doc/library/struct.rst:368 msgid "" "The ordering of format characters may have an impact on size since the " "padding needed to satisfy alignment requirements is different::" msgstr "" +"El orden de los caracteres de formato puede tener un impacto en el tamaño ya " +"que el relleno necesario para satisfacer los requisitos de alineación es " +"diferente::" #: ../Doc/library/struct.rst:380 msgid "" "The following format ``'llh0l'`` specifies two pad bytes at the end, " "assuming longs are aligned on 4-byte boundaries::" msgstr "" +"El siguiente formato ``'llh0l'`` especifica dos bytes de relleno al final, " +"suponiendo que los tipos *longs* están alineados en los límites de 4 bytes::" #: ../Doc/library/struct.rst:386 msgid "" "This only works when native size and alignment are in effect; standard size " "and alignment does not enforce any alignment." msgstr "" +"Esto solo funciona cuando el tamaño y la alineación nativos tienen efecto; " +"el tamaño estándar y la alineación no imponen ninguna alineación." #: ../Doc/library/struct.rst:393 msgid "Module :mod:`array`" -msgstr "" +msgstr "Módulo :mod:`array`" #: ../Doc/library/struct.rst:393 msgid "Packed binary storage of homogeneous data." -msgstr "" +msgstr "Almacenamiento binario empaquetado de datos homogéneos." #: ../Doc/library/struct.rst:395 msgid "Module :mod:`xdrlib`" -msgstr "" +msgstr "Módulo :mod:`xdrlib`" #: ../Doc/library/struct.rst:396 msgid "Packing and unpacking of XDR data." -msgstr "" +msgstr "Empaquetar y desempaquetar datos XDR." #: ../Doc/library/struct.rst:402 msgid "Classes" -msgstr "" +msgstr "Clases" #: ../Doc/library/struct.rst:404 msgid "The :mod:`struct` module also defines the following type:" -msgstr "" +msgstr "El módulo :mod:`struct` también define el siguiente tipo:" #: ../Doc/library/struct.rst:409 msgid "" @@ -753,6 +926,10 @@ msgid "" "methods is more efficient than calling the :mod:`struct` functions with the " "same format since the format string only needs to be compiled once." msgstr "" +"Retorna un nuevo objeto Struct que escribe y lee datos binarios según la " +"cadena de formato *format*. Crear un objeto Struct una vez y llamar a sus " +"métodos es más eficaz que llamar a las funciones :mod:`struct` con el mismo " +"formato, ya que la cadena de formato solo se compila una vez en ese caso." #: ../Doc/library/struct.rst:416 msgid "" @@ -761,26 +938,36 @@ msgid "" "only a few format strings needn't worry about reusing a single :class:" "`Struct` instance." msgstr "" +"Las versiones compiladas de las cadenas de formato más recientes pasadas a :" +"class:`Struct` y las funciones de nivel de módulo se almacenan en caché, por " +"lo que los programas que utilizan solo unas pocas cadenas de formato no " +"necesitan preocuparse por volver a usar una sola instancia :class:`Struct`." #: ../Doc/library/struct.rst:421 msgid "Compiled Struct objects support the following methods and attributes:" msgstr "" +"Los objetos Struct compilados admiten los siguientes métodos y atributos:" #: ../Doc/library/struct.rst:425 msgid "" "Identical to the :func:`pack` function, using the compiled format. " "(``len(result)`` will equal :attr:`size`.)" msgstr "" +"Idéntico a la función :func:`pack`, utilizando el formato compilado. " +"(``len(result)`` será igual a :attr:`size`.)" #: ../Doc/library/struct.rst:431 msgid "Identical to the :func:`pack_into` function, using the compiled format." msgstr "" +"Idéntico a la función :func:`pack_into`, utilizando el formato compilado." #: ../Doc/library/struct.rst:436 msgid "" "Identical to the :func:`unpack` function, using the compiled format. The " "buffer's size in bytes must equal :attr:`size`." msgstr "" +"Idéntico a la función :func:`unpack`, utilizando el formato compilado. El " +"tamaño del búfer en bytes debe ser igual a :attr:`size`." #: ../Doc/library/struct.rst:442 msgid "" @@ -788,23 +975,32 @@ msgid "" "The buffer's size in bytes, starting at position *offset*, must be at least :" "attr:`size`." msgstr "" +"Idéntico a la función :func:`unpack_from`, utilizando el formato compilado. " +"El tamaño del búfer en bytes, comenzando en la posición *offset*, debe ser " +"al menos :attr:`size`." #: ../Doc/library/struct.rst:449 msgid "" "Identical to the :func:`iter_unpack` function, using the compiled format. " "The buffer's size in bytes must be a multiple of :attr:`size`." msgstr "" +"Idéntico a la función :func:`iter_unpack`, utilizando el formato compilado. " +"El tamaño del búfer en bytes debe ser un múltiplo de :attr:`size`." #: ../Doc/library/struct.rst:456 msgid "The format string used to construct this Struct object." -msgstr "" +msgstr "Cadena de formato utilizada para construir este objeto Struct." #: ../Doc/library/struct.rst:458 msgid "The format string type is now :class:`str` instead of :class:`bytes`." msgstr "" +"El tipo de cadena de formato es ahora :class:`str` en lugar de :class:" +"`bytes`." #: ../Doc/library/struct.rst:463 msgid "" "The calculated size of the struct (and hence of the bytes object produced by " "the :meth:`pack` method) corresponding to :attr:`format`." msgstr "" +"El tamaño calculado de la estructura (y, por lo tanto, del objeto bytes " +"generado por el método :meth:`pack`) correspondiente a :attr:`format`."