# SOME DESCRIPTIVE TITLE. # Copyright (C) 1990-2016, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 2.7\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-10-30 10:44+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../Doc/c-api/buffer.rst:6 msgid "Buffers and Memoryview Objects" msgstr "Objets de type MemoryView" #: ../Doc/c-api/buffer.rst:16 msgid "" "Python objects implemented in C can export a group of functions called the " "\"buffer interface.\" These functions can be used by an object to expose " "its data in a raw, byte-oriented format. Clients of the object can use the " "buffer interface to access the object data directly, without needing to copy " "it first." msgstr "" "Les objets Python implémentés en C peuvent exporter une \"interface sur des " "tampons\". Ces fonctions peuvent être utilisées par un objets pour rendre " "publiques ses données, dans un format brut orienté octets. Les clients de " "ces objets peuvent utiliser l'interface sur les tampons pour accéder " "directement aux données de l'objet, sans nécessiter une copie préalable." #: ../Doc/c-api/buffer.rst:22 msgid "" "Two examples of objects that support the buffer interface are strings and " "arrays. The string object exposes the character contents in the buffer " "interface's byte-oriented form. An array can only expose its contents via " "the old-style buffer interface. This limitation does not apply to Python 3, " "where :class:`memoryview` objects can be constructed from arrays, too. Array " "elements may be multi-byte values." msgstr "" "Deux exemples d'objets qui supportent l'interfaces sur les tampons sont les " "octets et les tableaux. Les objets octets exposent leur contenu en tant que " "caractètres, dans une interface sur tampon orientée octets. Un tableau peut " "également exposer son contenu, mais il doit être remarqué que les éléments " "du tableau peuvent être des valeurs multi-octets." #: ../Doc/c-api/buffer.rst:29 msgid "" "An example user of the buffer interface is the file object's :meth:`write` " "method. Any object that can export a series of bytes through the buffer " "interface can be written to a file. There are a number of format codes to :c:" "func:`PyArg_ParseTuple` that operate against an object's buffer interface, " "returning data from the target object." msgstr "" "Un exemple d'utilisation de l'interface sur les tampons est la méthode :meth:" "`write` de l'objet fichier. Tout objet qui peut exporter une série d'octets " "en utilisant l'interface tampons peut être écrit dans un fichier. Il y a un " "nombre de codes de format pour :c:func:`PyArg_ParseTuple` qui contredisent " "l'interface tampon de l'objet, en retournant les données de l'objet cible." #: ../Doc/c-api/buffer.rst:35 msgid "" "Starting from version 1.6, Python has been providing Python-level buffer " "objects and a C-level buffer API so that any built-in or used-defined type " "can expose its characteristics. Both, however, have been deprecated because " "of various shortcomings, and have been officially removed in Python 3 in " "favour of a new C-level buffer API and a new Python-level object named :" "class:`memoryview`." msgstr "" #: ../Doc/c-api/buffer.rst:42 msgid "" "The new buffer API has been backported to Python 2.6, and the :class:" "`memoryview` object has been backported to Python 2.7. It is strongly " "advised to use them rather than the old APIs, unless you are blocked from " "doing so for compatibility reasons." msgstr "" #: ../Doc/c-api/buffer.rst:49 msgid "The new-style Py_buffer struct" msgstr "" #: ../Doc/c-api/buffer.rst:56 msgid "A pointer to the start of the memory for the object." msgstr "" #: ../Doc/c-api/buffer.rst:61 msgid "The total length of the memory in bytes." msgstr "" #: ../Doc/c-api/buffer.rst:65 msgid "An indicator of whether the buffer is read only." msgstr "" #: ../Doc/c-api/buffer.rst:70 msgid "" "A *NULL* terminated string in :mod:`struct` module style syntax giving the " "contents of the elements available through the buffer. If this is *NULL*, ``" "\"B\"`` (unsigned bytes) is assumed." msgstr "" #: ../Doc/c-api/buffer.rst:76 msgid "" "The number of dimensions the memory represents as a multi-dimensional " "array. If it is 0, :c:data:`strides` and :c:data:`suboffsets` must be " "*NULL*." msgstr "" #: ../Doc/c-api/buffer.rst:82 msgid "" "An array of :c:type:`Py_ssize_t`\\s the length of :c:data:`ndim` giving the " "shape of the memory as a multi-dimensional array. Note that ``((*shape)[0] " "* ... * (*shape)[ndims-1])*itemsize`` should be equal to :c:data:`len`." msgstr "" #: ../Doc/c-api/buffer.rst:89 msgid "" "An array of :c:type:`Py_ssize_t`\\s the length of :c:data:`ndim` giving the " "number of bytes to skip to get to a new element in each dimension." msgstr "" #: ../Doc/c-api/buffer.rst:94 msgid "" "An array of :c:type:`Py_ssize_t`\\s the length of :c:data:`ndim`. If these " "suboffset numbers are greater than or equal to 0, then the value stored " "along the indicated dimension is a pointer and the suboffset value dictates " "how many bytes to add to the pointer after de-referencing. A suboffset value " "that it negative indicates that no de-referencing should occur (striding in " "a contiguous memory block)." msgstr "" #: ../Doc/c-api/buffer.rst:101 msgid "" "If all suboffsets are negative (i.e. no de-referencing is needed, then this " "field must be NULL (the default value)." msgstr "" #: ../Doc/c-api/buffer.rst:104 msgid "" "Here is a function that returns a pointer to the element in an N-D array " "pointed to by an N-dimensional index when there are both non-NULL strides " "and suboffsets::" msgstr "" #: ../Doc/c-api/buffer.rst:124 msgid "" "This is a storage for the itemsize (in bytes) of each element of the shared " "memory. It is technically un-necessary as it can be obtained using :c:func:" "`PyBuffer_SizeFromFormat`, however an exporter may know this information " "without parsing the format string and it is necessary to know the itemsize " "for proper interpretation of striding. Therefore, storing it is more " "convenient and faster." msgstr "" #: ../Doc/c-api/buffer.rst:133 msgid "" "This is for use internally by the exporting object. For example, this might " "be re-cast as an integer by the exporter and used to store flags about " "whether or not the shape, strides, and suboffsets arrays must be freed when " "the buffer is released. The consumer should never alter this value." msgstr "" #: ../Doc/c-api/buffer.rst:141 msgid "Buffer related functions" msgstr "Fonctions relatives aux tampons" #: ../Doc/c-api/buffer.rst:146 msgid "Return 1 if *obj* supports the buffer interface otherwise 0." msgstr "" #: ../Doc/c-api/buffer.rst:151 msgid "" "Export *obj* into a :c:type:`Py_buffer`, *view*. These arguments must never " "be *NULL*. The *flags* argument is a bit field indicating what kind of " "buffer the caller is prepared to deal with and therefore what kind of buffer " "the exporter is allowed to return. The buffer interface allows for " "complicated memory sharing possibilities, but some caller may not be able to " "handle all the complexity but may want to see if the exporter will let them " "take a simpler view to its memory." msgstr "" #: ../Doc/c-api/buffer.rst:159 msgid "" "Some exporters may not be able to share memory in every possible way and may " "need to raise errors to signal to some consumers that something is just not " "possible. These errors should be a :exc:`BufferError` unless there is " "another error that is actually causing the problem. The exporter can use " "flags information to simplify how much of the :c:data:`Py_buffer` structure " "is filled in with non-default values and/or raise an error if the object " "can't support a simpler view of its memory." msgstr "" #: ../Doc/c-api/buffer.rst:167 msgid "0 is returned on success and -1 on error." msgstr "" #: ../Doc/c-api/buffer.rst:169 msgid "The following table gives possible values to the *flags* arguments." msgstr "" #: ../Doc/c-api/buffer.rst:172 msgid "Flag" msgstr "Option" #: ../Doc/c-api/buffer.rst:172 msgid "Description" msgstr "Description" #: ../Doc/c-api/buffer.rst:174 msgid ":c:macro:`PyBUF_SIMPLE`" msgstr "" #: ../Doc/c-api/buffer.rst:174 msgid "" "This is the default flag state. The returned buffer may or may not have " "writable memory. The format of the data will be assumed to be unsigned " "bytes. This is a \"stand-alone\" flag constant. It never needs to be '|'d " "to the others. The exporter will raise an error if it cannot provide such a " "contiguous buffer of bytes." msgstr "" #: ../Doc/c-api/buffer.rst:183 msgid ":c:macro:`PyBUF_WRITABLE`" msgstr "" #: ../Doc/c-api/buffer.rst:183 msgid "" "The returned buffer must be writable. If it is not writable, then raise an " "error." msgstr "" #: ../Doc/c-api/buffer.rst:186 msgid ":c:macro:`PyBUF_STRIDES`" msgstr "" #: ../Doc/c-api/buffer.rst:186 msgid "" "This implies :c:macro:`PyBUF_ND`. The returned buffer must provide strides " "information (i.e. the strides cannot be NULL). This would be used when the " "consumer can handle strided, discontiguous arrays. Handling strides " "automatically assumes you can handle shape. The exporter can raise an error " "if a strided representation of the data is not possible (i.e. without the " "suboffsets)." msgstr "" #: ../Doc/c-api/buffer.rst:196 msgid ":c:macro:`PyBUF_ND`" msgstr "" #: ../Doc/c-api/buffer.rst:196 msgid "" "The returned buffer must provide shape information. The memory will be " "assumed C-style contiguous (last dimension varies the fastest). The exporter " "may raise an error if it cannot provide this kind of contiguous buffer. If " "this is not given then shape will be *NULL*." msgstr "" #: ../Doc/c-api/buffer.rst:206 msgid "" ":c:macro:`PyBUF_C_CONTIGUOUS` :c:macro:`PyBUF_F_CONTIGUOUS` :c:macro:" "`PyBUF_ANY_CONTIGUOUS`" msgstr "" #: ../Doc/c-api/buffer.rst:206 msgid "" "These flags indicate that the contiguity returned buffer must be " "respectively, C-contiguous (last dimension varies the fastest), Fortran " "contiguous (first dimension varies the fastest) or either one. All of these " "flags imply :c:macro:`PyBUF_STRIDES` and guarantee that the strides buffer " "info structure will be filled in correctly." msgstr "" #: ../Doc/c-api/buffer.rst:216 msgid ":c:macro:`PyBUF_INDIRECT`" msgstr "" #: ../Doc/c-api/buffer.rst:216 msgid "" "This flag indicates the returned buffer must have suboffsets information " "(which can be NULL if no suboffsets are needed). This can be used when the " "consumer can handle indirect array referencing implied by these suboffsets. " "This implies :c:macro:`PyBUF_STRIDES`." msgstr "" #: ../Doc/c-api/buffer.rst:226 msgid ":c:macro:`PyBUF_FORMAT`" msgstr "" #: ../Doc/c-api/buffer.rst:226 msgid "" "The returned buffer must have true format information if this flag is " "provided. This would be used when the consumer is going to be checking for " "what 'kind' of data is actually stored. An exporter should always be able to " "provide this information if requested. If format is not explicitly requested " "then the format must be returned as *NULL* (which means ``'B'``, or unsigned " "bytes)" msgstr "" #: ../Doc/c-api/buffer.rst:236 msgid ":c:macro:`PyBUF_STRIDED`" msgstr "" #: ../Doc/c-api/buffer.rst:236 msgid "This is equivalent to ``(PyBUF_STRIDES | PyBUF_WRITABLE)``." msgstr "" #: ../Doc/c-api/buffer.rst:239 msgid ":c:macro:`PyBUF_STRIDED_RO`" msgstr "" #: ../Doc/c-api/buffer.rst:239 msgid "This is equivalent to ``(PyBUF_STRIDES)``." msgstr "" #: ../Doc/c-api/buffer.rst:242 msgid ":c:macro:`PyBUF_RECORDS`" msgstr "" #: ../Doc/c-api/buffer.rst:242 msgid "" "This is equivalent to ``(PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)``." msgstr "" #: ../Doc/c-api/buffer.rst:245 msgid ":c:macro:`PyBUF_RECORDS_RO`" msgstr "" #: ../Doc/c-api/buffer.rst:245 msgid "This is equivalent to ``(PyBUF_STRIDES | PyBUF_FORMAT)``." msgstr "" #: ../Doc/c-api/buffer.rst:248 msgid ":c:macro:`PyBUF_FULL`" msgstr "" #: ../Doc/c-api/buffer.rst:248 msgid "" "This is equivalent to ``(PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)``." msgstr "" #: ../Doc/c-api/buffer.rst:251 msgid ":c:macro:`PyBUF_FULL_RO`" msgstr "" #: ../Doc/c-api/buffer.rst:251 msgid "This is equivalent to ``(PyBUF_INDIRECT | PyBUF_FORMAT)``." msgstr "" #: ../Doc/c-api/buffer.rst:254 msgid ":c:macro:`PyBUF_CONTIG`" msgstr "" #: ../Doc/c-api/buffer.rst:254 msgid "This is equivalent to ``(PyBUF_ND | PyBUF_WRITABLE)``." msgstr "" #: ../Doc/c-api/buffer.rst:257 msgid ":c:macro:`PyBUF_CONTIG_RO`" msgstr "" #: ../Doc/c-api/buffer.rst:257 msgid "This is equivalent to ``(PyBUF_ND)``." msgstr "" #: ../Doc/c-api/buffer.rst:264 msgid "" "Release the buffer *view*. This should be called when the buffer is no " "longer being used as it may free memory from it." msgstr "" #: ../Doc/c-api/buffer.rst:270 msgid "" "Return the implied :c:data:`~Py_buffer.itemsize` from the struct-stype :c:" "data:`~Py_buffer.format`." msgstr "" #: ../Doc/c-api/buffer.rst:276 msgid "" "Return 1 if the memory defined by the *view* is C-style (*fortran* is " "``'C'``) or Fortran-style (*fortran* is ``'F'``) contiguous or either one " "(*fortran* is ``'A'``). Return 0 otherwise." msgstr "" #: ../Doc/c-api/buffer.rst:283 msgid "" "Fill the *strides* array with byte-strides of a contiguous (C-style if " "*fortran* is ``'C'`` or Fortran-style if *fortran* is ``'F'``) array of the " "given shape with the given number of bytes per element." msgstr "" #: ../Doc/c-api/buffer.rst:290 msgid "" "Fill in a buffer-info structure, *view*, correctly for an exporter that can " "only share a contiguous chunk of memory of \"unsigned bytes\" of the given " "length. Return 0 on success and -1 (with raising an error) on error." msgstr "" #: ../Doc/c-api/buffer.rst:296 msgid "MemoryView objects" msgstr "Objets de type MemoryView" #: ../Doc/c-api/buffer.rst:300 msgid "" "A :class:`memoryview` object exposes the new C level buffer interface as a " "Python object which can then be passed around like any other object." msgstr "" #: ../Doc/c-api/buffer.rst:305 msgid "" "Create a memoryview object from an object that defines the new buffer " "interface." msgstr "Un objet MemoryView expose l'interface tampon au niveau C à Python." #: ../Doc/c-api/buffer.rst:311 msgid "" "Create a memoryview object wrapping the given buffer-info structure *view*. " "The memoryview object then owns the buffer, which means you shouldn't try to " "release it yourself: it will be released on deallocation of the memoryview " "object." msgstr "" #: ../Doc/c-api/buffer.rst:319 msgid "" "Create a memoryview object to a contiguous chunk of memory (in either 'C' or " "'F'ortran *order*) from an object that defines the buffer interface. If " "memory is contiguous, the memoryview object points to the original memory. " "Otherwise copy is made and the memoryview points to a new bytes object." msgstr "" #: ../Doc/c-api/buffer.rst:328 msgid "" "Return true if the object *obj* is a memoryview object. It is not currently " "allowed to create subclasses of :class:`memoryview`." msgstr "" #: ../Doc/c-api/buffer.rst:334 msgid "" "Return a pointer to the buffer-info structure wrapped by the given object. " "The object **must** be a memoryview instance; this macro doesn't check its " "type, you must do it yourself or you will risk crashes." msgstr "" #: ../Doc/c-api/buffer.rst:340 msgid "Old-style buffer objects" msgstr "Autres objets" #: ../Doc/c-api/buffer.rst:344 msgid "" "More information on the old buffer interface is provided in the section :ref:" "`buffer-structs`, under the description for :c:type:`PyBufferProcs`." msgstr "" "Plus d'informations sur l'interface sur les tampons sont données dans la " "section :ref:`buffer-structs`, dans la description sur :c:type:" "`PyBufferProcs`." #: ../Doc/c-api/buffer.rst:347 msgid "" "A \"buffer object\" is defined in the :file:`bufferobject.h` header " "(included by :file:`Python.h`). These objects look very similar to string " "objects at the Python programming level: they support slicing, indexing, " "concatenation, and some other standard string operations. However, their " "data can come from one of two sources: from a block of memory, or from " "another object which exports the buffer interface." msgstr "" #: ../Doc/c-api/buffer.rst:354 msgid "" "Buffer objects are useful as a way to expose the data from another object's " "buffer interface to the Python programmer. They can also be used as a zero-" "copy slicing mechanism. Using their ability to reference a block of memory, " "it is possible to expose any data to the Python programmer quite easily. The " "memory could be a large, constant array in a C extension, it could be a raw " "block of memory for manipulation before passing to an operating system " "library, or it could be used to pass around structured data in its native, " "in-memory format." msgstr "" #: ../Doc/c-api/buffer.rst:366 msgid "This subtype of :c:type:`PyObject` represents a buffer object." msgstr "" #: ../Doc/c-api/buffer.rst:373 msgid "" "The instance of :c:type:`PyTypeObject` which represents the Python buffer " "type; it is the same object as ``buffer`` and ``types.BufferType`` in the " "Python layer. ." msgstr "" #: ../Doc/c-api/buffer.rst:380 msgid "" "This constant may be passed as the *size* parameter to :c:func:" "`PyBuffer_FromObject` or :c:func:`PyBuffer_FromReadWriteObject`. It " "indicates that the new :c:type:`PyBufferObject` should refer to *base* " "object from the specified *offset* to the end of its exported buffer. Using " "this enables the caller to avoid querying the *base* object for its length." msgstr "" #: ../Doc/c-api/buffer.rst:390 msgid "Return true if the argument has type :c:data:`PyBuffer_Type`." msgstr "" #: ../Doc/c-api/buffer.rst:395 msgid "" "Return a new read-only buffer object. This raises :exc:`TypeError` if " "*base* doesn't support the read-only buffer protocol or doesn't provide " "exactly one buffer segment, or it raises :exc:`ValueError` if *offset* is " "less than zero. The buffer will hold a reference to the *base* object, and " "the buffer's contents will refer to the *base* object's buffer interface, " "starting as position *offset* and extending for *size* bytes. If *size* is :" "const:`Py_END_OF_BUFFER`, then the new buffer's contents extend to the " "length of the *base* object's exported buffer data." msgstr "" #: ../Doc/c-api/buffer.rst:404 ../Doc/c-api/buffer.rst:416 msgid "" "This function used an :c:type:`int` type for *offset* and *size*. This might " "require changes in your code for properly supporting 64-bit systems." msgstr "" #: ../Doc/c-api/buffer.rst:412 msgid "" "Return a new writable buffer object. Parameters and exceptions are similar " "to those for :c:func:`PyBuffer_FromObject`. If the *base* object does not " "export the writeable buffer protocol, then :exc:`TypeError` is raised." msgstr "" #: ../Doc/c-api/buffer.rst:424 msgid "" "Return a new read-only buffer object that reads from a specified location in " "memory, with a specified size. The caller is responsible for ensuring that " "the memory buffer, passed in as *ptr*, is not deallocated while the returned " "buffer object exists. Raises :exc:`ValueError` if *size* is less than " "zero. Note that :const:`Py_END_OF_BUFFER` may *not* be passed for the " "*size* parameter; :exc:`ValueError` will be raised in that case." msgstr "" #: ../Doc/c-api/buffer.rst:431 ../Doc/c-api/buffer.rst:441 #: ../Doc/c-api/buffer.rst:453 msgid "" "This function used an :c:type:`int` type for *size*. This might require " "changes in your code for properly supporting 64-bit systems." msgstr "" #: ../Doc/c-api/buffer.rst:438 msgid "" "Similar to :c:func:`PyBuffer_FromMemory`, but the returned buffer is " "writable." msgstr "" #: ../Doc/c-api/buffer.rst:448 msgid "" "Return a new writable buffer object that maintains its own memory buffer of " "*size* bytes. :exc:`ValueError` is returned if *size* is not zero or " "positive. Note that the memory buffer (as returned by :c:func:" "`PyObject_AsWriteBuffer`) is not specifically aligned." msgstr ""