python-docs-fr/library/struct.po

807 lines
23 KiB
Plaintext
Raw Normal View History

2018-07-04 09:06:45 +00:00
# Copyright (C) 2001-2018, Python Software Foundation
2018-07-04 09:08:42 +00:00
# For licence information, see README file.
2016-10-30 09:46:26 +00:00
#
msgid ""
msgstr ""
"Project-Id-Version: Python 3.6\n"
"Report-Msgid-Bugs-To: \n"
2018-06-28 13:32:56 +00:00
"POT-Creation-Date: 2018-06-28 15:29+0200\n"
2017-08-09 22:23:54 +00:00
"PO-Revision-Date: 2017-08-10 00:55+0200\n"
2017-08-11 17:15:07 +00:00
"Last-Translator: Julien Palard <julien@palard.fr>\n"
"Language-Team: \n"
2017-05-23 22:40:56 +00:00
"Language: fr\n"
2016-10-30 09:46:26 +00:00
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
2017-08-09 22:23:54 +00:00
"X-Generator: Poedit 1.8.11\n"
2016-10-30 09:46:26 +00:00
#: ../Doc/library/struct.rst:2
msgid ":mod:`struct` --- Interpret bytes as packed binary data"
msgstr ""
#: ../Doc/library/struct.rst:7
msgid "**Source code:** :source:`Lib/struct.py`"
msgstr ""
#: ../Doc/library/struct.rst:15
msgid ""
"This module performs conversions between Python values and C structs "
"represented as Python :class:`bytes` objects. This can be used in handling "
"binary data stored in files or from network connections, among other "
"sources. It uses :ref:`struct-format-strings` as compact descriptions of "
"the layout of the C structs and the intended conversion to/from Python "
"values."
msgstr ""
#: ../Doc/library/struct.rst:23
msgid ""
"By default, the result of packing a given C struct includes pad bytes in "
"order to maintain proper alignment for the C types involved; similarly, "
"alignment is taken into account when unpacking. This behavior is chosen so "
"that the bytes of a packed struct correspond exactly to the layout in memory "
"of the corresponding C struct. To handle platform-independent data formats "
"or omit implicit pad bytes, use ``standard`` size and alignment instead of "
"``native`` size and alignment: see :ref:`struct-alignment` for details."
msgstr ""
#: ../Doc/library/struct.rst:31
msgid ""
"Several :mod:`struct` functions (and methods of :class:`Struct`) take a "
"*buffer* argument. This refers to objects that implement the :ref:"
"`bufferobjects` and provide either a readable or read-writable buffer. The "
"most common types used for that purpose are :class:`bytes` and :class:"
"`bytearray`, but many other types that can be viewed as an array of bytes "
"implement the buffer protocol, so that they can be read/filled without "
"additional copying from a :class:`bytes` object."
msgstr ""
#: ../Doc/library/struct.rst:40
msgid "Functions and Exceptions"
msgstr ""
#: ../Doc/library/struct.rst:42
msgid "The module defines the following exception and functions:"
msgstr ""
#: ../Doc/library/struct.rst:47
msgid ""
"Exception raised on various occasions; argument is a string describing what "
"is wrong."
msgstr ""
#: ../Doc/library/struct.rst:53
msgid ""
"Return a bytes object containing the values *v1*, *v2*, ... packed according "
2018-06-28 13:32:56 +00:00
"to the format string *format*. The arguments must match the values required "
"by the format exactly."
2016-10-30 09:46:26 +00:00
msgstr ""
#: ../Doc/library/struct.rst:60
msgid ""
2018-06-28 13:32:56 +00:00
"Pack the values *v1*, *v2*, ... according to the format string *format* and "
2016-10-30 09:46:26 +00:00
"write the packed bytes into the writable buffer *buffer* starting at "
"position *offset*. Note that *offset* is a required argument."
msgstr ""
#: ../Doc/library/struct.rst:67
msgid ""
2018-06-28 13:32:56 +00:00
"Unpack from the buffer *buffer* (presumably packed by ``pack(format, ...)``) "
"according to the format string *format*. The result is a tuple even if it "
2016-10-30 09:46:26 +00:00
"contains exactly one item. The buffer's size in bytes must match the size "
"required by the format, as reflected by :func:`calcsize`."
msgstr ""
#: ../Doc/library/struct.rst:75
msgid ""
"Unpack from *buffer* starting at position *offset*, according to the format "
2018-06-28 13:32:56 +00:00
"string *format*. The result is a tuple even if it contains exactly one "
"item. The buffer's size in bytes, minus *offset*, must be at least the size "
2016-10-30 09:46:26 +00:00
"required by the format, as reflected by :func:`calcsize`."
msgstr ""
#: ../Doc/library/struct.rst:83
msgid ""
"Iteratively unpack from the buffer *buffer* according to the format string "
2018-06-28 13:32:56 +00:00
"*format*. This function returns an iterator which will read equally-sized "
2016-10-30 09:46:26 +00:00
"chunks from the buffer until all its contents have been consumed. The "
"buffer's size in bytes must be a multiple of the size required by the "
"format, as reflected by :func:`calcsize`."
msgstr ""
#: ../Doc/library/struct.rst:89
msgid "Each iteration yields a tuple as specified by the format string."
msgstr ""
#: ../Doc/library/struct.rst:96
msgid ""
"Return the size of the struct (and hence of the bytes object produced by "
2018-06-28 13:32:56 +00:00
"``pack(format, ...)``) corresponding to the format string *format*."
2016-10-30 09:46:26 +00:00
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:103
2016-10-30 09:46:26 +00:00
msgid "Format Strings"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:105
2016-10-30 09:46:26 +00:00
msgid ""
"Format strings are the mechanism used to specify the expected layout when "
"packing and unpacking data. They are built up from :ref:`format-"
"characters`, which specify the type of data being packed/unpacked. In "
"addition, there are special characters for controlling the :ref:`struct-"
"alignment`."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:114
2016-10-30 09:46:26 +00:00
msgid "Byte Order, Size, and Alignment"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:116
2016-10-30 09:46:26 +00:00
msgid ""
"By default, C types are represented in the machine's native format and byte "
"order, and properly aligned by skipping pad bytes if necessary (according to "
"the rules used by the C compiler)."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:120
2016-10-30 09:46:26 +00:00
msgid ""
"Alternatively, the first character of the format string can be used to "
"indicate the byte order, size and alignment of the packed data, according to "
"the following table:"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:125
2016-10-30 09:46:26 +00:00
msgid "Character"
msgstr "Caractère"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:125
2016-10-30 09:46:26 +00:00
msgid "Byte order"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:125
2016-10-30 09:46:26 +00:00
msgid "Size"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:125
2016-10-30 09:46:26 +00:00
msgid "Alignment"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:127
2016-10-30 09:46:26 +00:00
msgid "``@``"
msgstr "``@``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:127 ../Doc/library/struct.rst:129
2016-10-30 09:46:26 +00:00
msgid "native"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:129
2016-10-30 09:46:26 +00:00
msgid "``=``"
msgstr "``=``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:129 ../Doc/library/struct.rst:131
#: ../Doc/library/struct.rst:133 ../Doc/library/struct.rst:135
2016-10-30 09:46:26 +00:00
msgid "standard"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:129 ../Doc/library/struct.rst:131
#: ../Doc/library/struct.rst:133 ../Doc/library/struct.rst:135
2016-10-30 09:46:26 +00:00
msgid "none"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:131
2016-10-30 09:46:26 +00:00
msgid "``<``"
msgstr "``<``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:131
2016-10-30 09:46:26 +00:00
msgid "little-endian"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:133
2016-10-30 09:46:26 +00:00
msgid "``>``"
msgstr "``>``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:133
2016-10-30 09:46:26 +00:00
msgid "big-endian"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:135
2016-10-30 09:46:26 +00:00
msgid "``!``"
msgstr "``!``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:135
2016-10-30 09:46:26 +00:00
msgid "network (= big-endian)"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:138
2016-10-30 09:46:26 +00:00
msgid "If the first character is not one of these, ``'@'`` is assumed."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:140
2016-10-30 09:46:26 +00:00
msgid ""
"Native byte order is big-endian or little-endian, depending on the host "
"system. For example, Intel x86 and AMD64 (x86-64) are little-endian; "
"Motorola 68000 and PowerPC G5 are big-endian; ARM and Intel Itanium feature "
"switchable endianness (bi-endian). Use ``sys.byteorder`` to check the "
"endianness of your system."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:146
2016-10-30 09:46:26 +00:00
msgid ""
"Native size and alignment are determined using the C compiler's ``sizeof`` "
"expression. This is always combined with native byte order."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:149
2016-10-30 09:46:26 +00:00
msgid ""
"Standard size depends only on the format character; see the table in the :"
"ref:`format-characters` section."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:152
2016-10-30 09:46:26 +00:00
msgid ""
"Note the difference between ``'@'`` and ``'='``: both use native byte order, "
"but the size and alignment of the latter is standardized."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:155
2016-10-30 09:46:26 +00:00
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 ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:158
2016-10-30 09:46:26 +00:00
msgid ""
"There is no way to indicate non-native byte order (force byte-swapping); use "
"the appropriate choice of ``'<'`` or ``'>'``."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:161 ../Doc/library/struct.rst:240
2016-10-30 09:46:26 +00:00
msgid "Notes:"
msgstr "Notes :"
2016-10-30 09:46:26 +00:00
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:163
2016-10-30 09:46:26 +00:00
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 ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:166
2016-10-30 09:46:26 +00:00
msgid ""
"No padding is added when using non-native size and alignment, e.g. with '<', "
"'>', '=', and '!'."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:169
2016-10-30 09:46:26 +00:00
msgid ""
"To align the end of a structure to the alignment requirement of a particular "
"type, end the format with the code for that type with a repeat count of "
"zero. See :ref:`struct-examples`."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:177
2016-10-30 09:46:26 +00:00
msgid "Format Characters"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:179
2016-10-30 09:46:26 +00:00
msgid ""
"Format characters have the following meaning; the conversion between C and "
"Python values should be obvious given their types. The 'Standard size' "
"column refers to the size of the packed value in bytes when using standard "
"size; that is, when the format string starts with one of ``'<'``, ``'>'``, "
"``'!'`` or ``'='``. When using native size, the size of the packed value is "
"platform-dependent."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:187
2016-10-30 09:46:26 +00:00
msgid "Format"
msgstr "Format"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:187
2016-10-30 09:46:26 +00:00
msgid "C Type"
msgstr "Type C"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:187
2016-10-30 09:46:26 +00:00
msgid "Python type"
msgstr "Type Python"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:187
2016-10-30 09:46:26 +00:00
msgid "Standard size"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:187
2016-10-30 09:46:26 +00:00
msgid "Notes"
msgstr "Notes"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:189
2016-10-30 09:46:26 +00:00
msgid "``x``"
msgstr "``x``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:189
2016-10-30 09:46:26 +00:00
msgid "pad byte"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:189
2016-10-30 09:46:26 +00:00
msgid "no value"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:191
2016-10-30 09:46:26 +00:00
msgid "``c``"
msgstr "``c``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:191
2016-10-30 09:46:26 +00:00
msgid ":c:type:`char`"
msgstr ":c:type:`char`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:191
2016-10-30 09:46:26 +00:00
msgid "bytes of length 1"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:191 ../Doc/library/struct.rst:193
#: ../Doc/library/struct.rst:195 ../Doc/library/struct.rst:197
2016-10-30 09:46:26 +00:00
msgid "1"
msgstr "1"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:193
2016-10-30 09:46:26 +00:00
msgid "``b``"
msgstr "``b``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:193
2016-10-30 09:46:26 +00:00
msgid ":c:type:`signed char`"
msgstr ":c:type:`signed char`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:193 ../Doc/library/struct.rst:195
#: ../Doc/library/struct.rst:199 ../Doc/library/struct.rst:201
#: ../Doc/library/struct.rst:203 ../Doc/library/struct.rst:205
#: ../Doc/library/struct.rst:207 ../Doc/library/struct.rst:209
#: ../Doc/library/struct.rst:211 ../Doc/library/struct.rst:213
#: ../Doc/library/struct.rst:216 ../Doc/library/struct.rst:218
#: ../Doc/library/struct.rst:230
2016-10-30 09:46:26 +00:00
msgid "integer"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:193
2016-10-30 09:46:26 +00:00
msgid "\\(1),\\(3)"
msgstr "\\(1),\\(3)"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:195
2016-10-30 09:46:26 +00:00
msgid "``B``"
msgstr "``B``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:195
2016-10-30 09:46:26 +00:00
msgid ":c:type:`unsigned char`"
msgstr ":c:type:`unsigned char`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:195 ../Doc/library/struct.rst:199
#: ../Doc/library/struct.rst:201 ../Doc/library/struct.rst:203
#: ../Doc/library/struct.rst:205 ../Doc/library/struct.rst:207
#: ../Doc/library/struct.rst:209
2016-10-30 09:46:26 +00:00
msgid "\\(3)"
msgstr "\\(3)"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:197
2016-10-30 09:46:26 +00:00
msgid "``?``"
msgstr "``?``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:197
2016-10-30 09:46:26 +00:00
msgid ":c:type:`_Bool`"
msgstr ":c:type:`_Bool`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:197
2016-10-30 09:46:26 +00:00
msgid "bool"
msgstr "bool"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:197
2016-10-30 09:46:26 +00:00
msgid "\\(1)"
msgstr "\\(1)"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:199
2016-10-30 09:46:26 +00:00
msgid "``h``"
msgstr "``h``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:199
2016-10-30 09:46:26 +00:00
msgid ":c:type:`short`"
msgstr ":c:type:`short`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:199 ../Doc/library/struct.rst:201
#: ../Doc/library/struct.rst:220
2016-10-30 09:46:26 +00:00
msgid "2"
msgstr "2"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:201
2016-10-30 09:46:26 +00:00
msgid "``H``"
msgstr "``H``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:201
2016-10-30 09:46:26 +00:00
msgid ":c:type:`unsigned short`"
msgstr ":c:type:`unsigned short`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:203
2016-10-30 09:46:26 +00:00
msgid "``i``"
msgstr "``i``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:203
2016-10-30 09:46:26 +00:00
msgid ":c:type:`int`"
msgstr ":c:type:`int`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:203 ../Doc/library/struct.rst:205
#: ../Doc/library/struct.rst:207 ../Doc/library/struct.rst:209
#: ../Doc/library/struct.rst:222
2016-10-30 09:46:26 +00:00
msgid "4"
msgstr "4"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:205
2016-10-30 09:46:26 +00:00
msgid "``I``"
msgstr "``I``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:205
2016-10-30 09:46:26 +00:00
msgid ":c:type:`unsigned int`"
msgstr ":c:type:`unsigned int`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:207
2016-10-30 09:46:26 +00:00
msgid "``l``"
msgstr "``l``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:207
2016-10-30 09:46:26 +00:00
msgid ":c:type:`long`"
msgstr ":c:type:`long`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:209
2016-10-30 09:46:26 +00:00
msgid "``L``"
msgstr "``L``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:209
2016-10-30 09:46:26 +00:00
msgid ":c:type:`unsigned long`"
msgstr ":c:type:`unsigned long`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:211
2016-10-30 09:46:26 +00:00
msgid "``q``"
msgstr "``q``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:211
2016-10-30 09:46:26 +00:00
msgid ":c:type:`long long`"
msgstr ":c:type:`long long`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:211 ../Doc/library/struct.rst:213
#: ../Doc/library/struct.rst:224
2016-10-30 09:46:26 +00:00
msgid "8"
msgstr "8"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:211 ../Doc/library/struct.rst:213
2016-10-30 09:46:26 +00:00
msgid "\\(2), \\(3)"
msgstr "\\(2), \\(3)"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:213
2016-10-30 09:46:26 +00:00
msgid "``Q``"
msgstr "``Q``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:213
2016-10-30 09:46:26 +00:00
msgid ":c:type:`unsigned long long`"
msgstr ":c:type:`unsigned long long`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:216
2016-10-30 09:46:26 +00:00
msgid "``n``"
msgstr "``n``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:216
2016-10-30 09:46:26 +00:00
msgid ":c:type:`ssize_t`"
msgstr ":c:type:`ssize_t`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:216 ../Doc/library/struct.rst:218
2016-10-30 09:46:26 +00:00
msgid "\\(4)"
msgstr "\\(4)"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:218
2016-10-30 09:46:26 +00:00
msgid "``N``"
msgstr "``N``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:218
2016-10-30 09:46:26 +00:00
msgid ":c:type:`size_t`"
msgstr ":c:type:`size_t`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:220
2016-10-30 09:46:26 +00:00
msgid "``e``"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:220
2016-10-30 09:46:26 +00:00
msgid "\\(7)"
msgstr "\\(7)"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:220 ../Doc/library/struct.rst:222
#: ../Doc/library/struct.rst:224
2016-10-30 09:46:26 +00:00
msgid "float"
msgstr "*float*"
2016-10-30 09:46:26 +00:00
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:220 ../Doc/library/struct.rst:222
#: ../Doc/library/struct.rst:224
2016-10-30 09:46:26 +00:00
msgid "\\(5)"
msgstr "\\(5)"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:222
2016-10-30 09:46:26 +00:00
msgid "``f``"
msgstr "``f``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:222
2016-10-30 09:46:26 +00:00
msgid ":c:type:`float`"
msgstr ":c:type:`float`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:224
2016-10-30 09:46:26 +00:00
msgid "``d``"
msgstr "``d``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:224
2016-10-30 09:46:26 +00:00
msgid ":c:type:`double`"
msgstr ":c:type:`double`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:226
2016-10-30 09:46:26 +00:00
msgid "``s``"
msgstr "``s``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:226 ../Doc/library/struct.rst:228
2016-10-30 09:46:26 +00:00
msgid ":c:type:`char[]`"
msgstr ":c:type:`char[]`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:226 ../Doc/library/struct.rst:228
2016-10-30 09:46:26 +00:00
msgid "bytes"
msgstr "bytes"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:228
2016-10-30 09:46:26 +00:00
msgid "``p``"
msgstr "``p``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:230
2016-10-30 09:46:26 +00:00
msgid "``P``"
msgstr "``P``"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:230
2016-10-30 09:46:26 +00:00
msgid ":c:type:`void \\*`"
msgstr ":c:type:`void \\*`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:230
2016-10-30 09:46:26 +00:00
msgid "\\(6)"
msgstr "\\(6)"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:233
2016-10-30 09:46:26 +00:00
msgid "Added support for the ``'n'`` and ``'N'`` formats."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:236
2017-04-02 20:14:06 +00:00
msgid "Added support for the ``'e'`` format."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:243
2016-10-30 09:46:26 +00:00
msgid ""
"The ``'?'`` conversion code corresponds to the :c:type:`_Bool` type defined "
"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 ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:248
2016-10-30 09:46:26 +00:00
msgid ""
"The ``'q'`` and ``'Q'`` conversion codes are available in native mode only "
"if the platform C compiler supports C :c:type:`long long`, or, on Windows, :"
"c:type:`__int64`. They are always available in standard modes."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:253
2016-10-30 09:46:26 +00:00
msgid ""
"When attempting to pack a non-integer using any of the integer conversion "
"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 ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:257
2016-10-30 09:46:26 +00:00
msgid "Use of the :meth:`__index__` method for non-integers is new in 3.2."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:261
2016-10-30 09:46:26 +00:00
msgid ""
"The ``'n'`` and ``'N'`` conversion codes are only available for the native "
"size (selected as the default or with the ``'@'`` byte order character). For "
"the standard size, you can use whichever of the other integer formats fits "
"your application."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:267
2016-10-30 09:46:26 +00:00
msgid ""
"For the ``'f'``, ``'d'`` and ``'e'`` conversion codes, the packed "
"representation uses the IEEE 754 binary32, binary64 or binary16 format (for "
"``'f'``, ``'d'`` or ``'e'`` respectively), regardless of the floating-point "
"format used by the platform."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:273
2016-10-30 09:46:26 +00:00
msgid ""
"The ``'P'`` format character is only available for the native byte ordering "
"(selected as the default or with the ``'@'`` byte order character). The byte "
"order character ``'='`` chooses to use little- or big-endian ordering based "
"on the host system. The struct module does not interpret this as native "
"ordering, so the ``'P'`` format is not available."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:280
2016-10-30 09:46:26 +00:00
msgid ""
"The IEEE 754 binary16 \"half precision\" type was introduced in the 2008 "
"revision of the `IEEE 754 standard <ieee 754 standard_>`_. It has a sign "
"bit, a 5-bit exponent and 11-bit precision (with 10 bits explicitly stored), "
"and can represent numbers between approximately ``6.1e-05`` and ``6.5e+04`` "
"at full precision. This type is not widely supported by C compilers: on a "
"typical machine, an unsigned short can be used for storage, but not for math "
"operations. See the Wikipedia page on the `half-precision floating-point "
"format <half precision format_>`_ for more information."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:290
2016-10-30 09:46:26 +00:00
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 ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:293
2016-10-30 09:46:26 +00:00
msgid ""
"Whitespace characters between formats are ignored; a count and its format "
"must not contain whitespace though."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:296
2016-10-30 09:46:26 +00:00
msgid ""
"For the ``'s'`` format character, the count is interpreted as the length of "
"the bytes, not a repeat count like for the other format characters; for "
"example, ``'10s'`` means a single 10-byte string, while ``'10c'`` means 10 "
"characters. If a count is not given, it defaults to 1. For packing, the "
"string is truncated or padded with null bytes as appropriate to make it fit. "
"For unpacking, the resulting bytes object always has exactly the specified "
"number of bytes. As a special case, ``'0s'`` means a single, empty string "
"(while ``'0c'`` means 0 characters)."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:305
2016-10-30 09:46:26 +00:00
msgid ""
"When packing a value ``x`` using one of the integer formats (``'b'``, "
"``'B'``, ``'h'``, ``'H'``, ``'i'``, ``'I'``, ``'l'``, ``'L'``, ``'q'``, "
"``'Q'``), if ``x`` is outside the valid range for that format then :exc:"
"`struct.error` is raised."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:310
2016-10-30 09:46:26 +00:00
msgid ""
"In 3.0, some of the integer formats wrapped out-of-range values and raised :"
"exc:`DeprecationWarning` instead of :exc:`struct.error`."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:314
2016-10-30 09:46:26 +00:00
msgid ""
"The ``'p'`` format character encodes a \"Pascal string\", meaning a short "
"variable-length string stored in a *fixed number of bytes*, given by the "
"count. The first byte stored is the length of the string, or 255, whichever "
"is smaller. The bytes of the string follow. If the string passed in to :"
"func:`pack` is too long (longer than the count minus 1), only the leading "
"``count-1`` bytes of the string are stored. If the string is shorter than "
"``count-1``, it is padded with null bytes so that exactly count bytes in all "
"are used. Note that for :func:`unpack`, the ``'p'`` format character "
"consumes ``count`` bytes, but that the string returned can never contain "
"more than 255 bytes."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:325
2016-10-30 09:46:26 +00:00
msgid ""
"For the ``'?'`` format character, the return value is either :const:`True` "
"or :const:`False`. When packing, the truth value of the argument object is "
"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 ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:335
2016-10-30 09:46:26 +00:00
msgid "Examples"
msgstr "Exemples"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:338
2016-10-30 09:46:26 +00:00
msgid ""
"All examples assume a native byte order, size, and alignment with a big-"
"endian machine."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:341
2016-10-30 09:46:26 +00:00
msgid "A basic example of packing/unpacking three integers::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:351
2016-10-30 09:46:26 +00:00
msgid ""
"Unpacked fields can be named by assigning them to variables or by wrapping "
"the result in a named tuple::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:362
2016-10-30 09:46:26 +00:00
msgid ""
"The ordering of format characters may have an impact on size since the "
"padding needed to satisfy alignment requirements is different::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:374
2016-10-30 09:46:26 +00:00
msgid ""
"The following format ``'llh0l'`` specifies two pad bytes at the end, "
"assuming longs are aligned on 4-byte boundaries::"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:380
2016-10-30 09:46:26 +00:00
msgid ""
"This only works when native size and alignment are in effect; standard size "
"and alignment does not enforce any alignment."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:387
2016-10-30 09:46:26 +00:00
msgid "Module :mod:`array`"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:387
2016-10-30 09:46:26 +00:00
msgid "Packed binary storage of homogeneous data."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:389
2016-10-30 09:46:26 +00:00
msgid "Module :mod:`xdrlib`"
msgstr "Module :mod:`xdrlib`"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:390
2016-10-30 09:46:26 +00:00
msgid "Packing and unpacking of XDR data."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:396
2016-10-30 09:46:26 +00:00
msgid "Classes"
msgstr "Classes"
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:398
2016-10-30 09:46:26 +00:00
msgid "The :mod:`struct` module also defines the following type:"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:403
2016-10-30 09:46:26 +00:00
msgid ""
"Return a new Struct object which writes and reads binary data according to "
"the format string *format*. Creating a Struct object once and calling its "
"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 ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:409
2016-10-30 09:46:26 +00:00
msgid "Compiled Struct objects support the following methods and attributes:"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:413
2016-10-30 09:46:26 +00:00
msgid ""
"Identical to the :func:`pack` function, using the compiled format. "
"(``len(result)`` will equal :attr:`size`.)"
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:419
2016-10-30 09:46:26 +00:00
msgid "Identical to the :func:`pack_into` function, using the compiled format."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:424
2016-10-30 09:46:26 +00:00
msgid ""
"Identical to the :func:`unpack` function, using the compiled format. The "
"buffer's size in bytes must equal :attr:`size`."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:430
2016-10-30 09:46:26 +00:00
msgid ""
"Identical to the :func:`unpack_from` function, using the compiled format. "
"The buffer's size in bytes, minus *offset*, must be at least :attr:`size`."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:437
2016-10-30 09:46:26 +00:00
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 ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:444
2016-10-30 09:46:26 +00:00
msgid "The format string used to construct this Struct object."
msgstr ""
2018-06-28 13:32:56 +00:00
#: ../Doc/library/struct.rst:446
msgid "The format string type is now :class:`str` instead of :class:`bytes`."
msgstr ""
#: ../Doc/library/struct.rst:451
2016-10-30 09:46:26 +00:00
msgid ""
"The calculated size of the struct (and hence of the bytes object produced by "
"the :meth:`pack` method) corresponding to :attr:`format`."
msgstr ""