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 ""
|
2019-12-05 22:15:54 +00:00
|
|
|
|
"Project-Id-Version: Python 3\n"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
"Report-Msgid-Bugs-To: \n"
|
2020-10-02 08:55:01 +00:00
|
|
|
|
"POT-Creation-Date: 2020-10-01 16:00+0200\n"
|
2018-10-04 10:28:41 +00:00
|
|
|
|
"PO-Revision-Date: 2018-10-04 12:18+0200\n"
|
2018-08-13 13:12:45 +00:00
|
|
|
|
"Last-Translator: \n"
|
2018-07-04 09:14:25 +00:00
|
|
|
|
"Language-Team: FRENCH <traductions@lists.afpy.org>\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"
|
2018-07-16 22:02:01 +00:00
|
|
|
|
"X-Generator: Poedit 2.0.2\n"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:11
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "Buffer Protocol"
|
2018-07-16 22:02:01 +00:00
|
|
|
|
msgstr "Protocole tampon"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:18
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Certain objects available in Python wrap access to an underlying memory "
|
|
|
|
|
"array or *buffer*. Such objects include the built-in :class:`bytes` and :"
|
|
|
|
|
"class:`bytearray`, and some extension types like :class:`array.array`. Third-"
|
|
|
|
|
"party libraries may define their own types for special purposes, such as "
|
|
|
|
|
"image processing or numeric analysis."
|
|
|
|
|
msgstr ""
|
2018-10-04 10:28:41 +00:00
|
|
|
|
"Certains objets Python enveloppent l'accès à un tableau de mémoire sous-"
|
|
|
|
|
"jacente (nommée zone tampon ou simplement tampon, *buffer* en anglais). Les "
|
|
|
|
|
"objets natifs :class:`bytes` et :class:`bytearray` en sont des exemples, "
|
|
|
|
|
"ainsi que quelques types d'extension comme :class:`array.array`. Les "
|
2018-07-16 16:59:59 +00:00
|
|
|
|
"bibliothèques tierces peuvent définir leurs propres types à des fins "
|
|
|
|
|
"spéciales, telles que le traitement d'image ou l'analyse numérique."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:24
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"While each of these types have their own semantics, they share the common "
|
|
|
|
|
"characteristic of being backed by a possibly large memory buffer. It is "
|
|
|
|
|
"then desirable, in some situations, to access that buffer directly and "
|
|
|
|
|
"without intermediate copying."
|
|
|
|
|
msgstr ""
|
2018-07-16 16:59:59 +00:00
|
|
|
|
"Alors que chacun de ces types a sa propre sémantique, ils partagent la "
|
|
|
|
|
"caractéristique commune d'être soutenus par un tampon de mémoire important. "
|
|
|
|
|
"Il est donc souhaitable, dans certains cas, d'accéder à cette mémoire "
|
|
|
|
|
"directement sans l'étape intermédiaire de copie."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:29
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Python provides such a facility at the C level in the form of the :ref:"
|
|
|
|
|
"`buffer protocol <bufferobjects>`. This protocol has two sides:"
|
|
|
|
|
msgstr ""
|
2018-07-16 16:59:59 +00:00
|
|
|
|
"Python fournit une telle facilité au niveau du C sous la forme de :ref:"
|
2018-07-16 22:02:01 +00:00
|
|
|
|
"`protocole tampon <bufferobjects>`. Ce protocole comporte deux aspects :"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:34
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"on the producer side, a type can export a \"buffer interface\" which allows "
|
|
|
|
|
"objects of that type to expose information about their underlying buffer. "
|
|
|
|
|
"This interface is described in the section :ref:`buffer-structs`;"
|
|
|
|
|
msgstr ""
|
2018-07-16 22:02:01 +00:00
|
|
|
|
"du côté producteur, un type peut exporter une \"interface tampon\" qui "
|
|
|
|
|
"permet aux objets de ce type d'exposer des informations concernant leur "
|
|
|
|
|
"tampon sous-jacent. Cette interface est décrite dans la section :ref:`buffer-"
|
|
|
|
|
"structs` ;"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:38
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"on the consumer side, several means are available to obtain a pointer to the "
|
|
|
|
|
"raw underlying data of an object (for example a method parameter)."
|
|
|
|
|
msgstr ""
|
2018-07-16 16:59:59 +00:00
|
|
|
|
"du côté consommateur, plusieurs moyens sont disponibles pour obtenir un "
|
|
|
|
|
"pointeur vers les données sous-jacentes brutes d'un objet (par exemple un "
|
|
|
|
|
"paramètre de méthode)."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:41
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Simple objects such as :class:`bytes` and :class:`bytearray` expose their "
|
|
|
|
|
"underlying buffer in byte-oriented form. Other forms are possible; for "
|
|
|
|
|
"example, the elements exposed by an :class:`array.array` can be multi-byte "
|
|
|
|
|
"values."
|
|
|
|
|
msgstr ""
|
2018-07-16 16:59:59 +00:00
|
|
|
|
"Des objets simples tels que :class:`bytes` et :class:`bytearray` exposent "
|
2018-07-16 22:02:01 +00:00
|
|
|
|
"leur tampon sous-jacent dans un format orienté octet. D'autres formes sont "
|
|
|
|
|
"possibles ; par exemple, les éléments exposés par un :class:`array.array` "
|
2018-07-16 16:59:59 +00:00
|
|
|
|
"peuvent être des valeurs multi-octets."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:45
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"An example consumer of the buffer interface is the :meth:`~io.BufferedIOBase."
|
|
|
|
|
"write` method of file objects: any object that can export a series of bytes "
|
|
|
|
|
"through the buffer interface can be written to a file. While :meth:`write` "
|
|
|
|
|
"only needs read-only access to the internal contents of the object passed to "
|
|
|
|
|
"it, other methods such as :meth:`~io.BufferedIOBase.readinto` need write "
|
|
|
|
|
"access to the contents of their argument. The buffer interface allows "
|
|
|
|
|
"objects to selectively allow or reject exporting of read-write and read-only "
|
|
|
|
|
"buffers."
|
|
|
|
|
msgstr ""
|
2018-10-04 10:28:41 +00:00
|
|
|
|
"Un exemple de consommateur de l'interface tampon est la méthode :meth:`~io."
|
|
|
|
|
"BufferedIOBase.write` des objets fichiers : tout objet qui peut exporter une "
|
2018-07-16 22:02:01 +00:00
|
|
|
|
"série d'octets à travers l'interface tampon peut être écrit dans un fichier. "
|
2018-07-16 16:59:59 +00:00
|
|
|
|
"Alors que :meth:`write` n'a besoin que d'un accès lecture au contenu "
|
2018-10-04 10:28:41 +00:00
|
|
|
|
"interne de l'objet qui lui est passé, d'autres méthodes telles que :meth:"
|
|
|
|
|
"`~io.BufferedIOBase.readinto` nécessitent un accès écriture au contenu de "
|
|
|
|
|
"leur argument. L'interface *buffer* permet aux objets d'autoriser ou de "
|
|
|
|
|
"rejeter sélectivement l'exportation de tampons en mode lecture-écriture et "
|
|
|
|
|
"en mode lecture seule."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:53
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"There are two ways for a consumer of the buffer interface to acquire a "
|
|
|
|
|
"buffer over a target object:"
|
|
|
|
|
msgstr ""
|
2018-07-16 22:02:01 +00:00
|
|
|
|
"Un consommateur de l'interface tampon peut acquérir un tampon sur un objet "
|
|
|
|
|
"cible de deux manières :"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:56
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "call :c:func:`PyObject_GetBuffer` with the right parameters;"
|
2018-07-16 22:02:01 +00:00
|
|
|
|
msgstr "appelez :c:func:`PyObject_GetBuffer` avec les paramètres appropriés ;"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:58
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"call :c:func:`PyArg_ParseTuple` (or one of its siblings) with one of the "
|
|
|
|
|
"``y*``, ``w*`` or ``s*`` :ref:`format codes <arg-parsing>`."
|
|
|
|
|
msgstr ""
|
2018-07-16 16:59:59 +00:00
|
|
|
|
"appelez :c:func:`PyArg_ParseTuple` (ou l'un de ses fonctions sœurs) avec "
|
|
|
|
|
"l'un des ``y*``, ``w*`` ou ``s*`` :ref:`format codes <arg-parsing>`."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:61
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"In both cases, :c:func:`PyBuffer_Release` must be called when the buffer "
|
|
|
|
|
"isn't needed anymore. Failure to do so could lead to various issues such as "
|
|
|
|
|
"resource leaks."
|
|
|
|
|
msgstr ""
|
2018-07-16 22:02:01 +00:00
|
|
|
|
"Dans les deux cas, :c:func:`PyBuffer_Release` doit être appelée quand le "
|
|
|
|
|
"tampon n'est plus nécessaire. Ne pas le faire peut conduire à divers "
|
2018-07-16 16:59:59 +00:00
|
|
|
|
"problèmes tels que des fuites de ressources."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:69
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "Buffer structure"
|
|
|
|
|
msgstr "La structure *buffer*"
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:71
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Buffer structures (or simply \"buffers\") are useful as a way to expose the "
|
|
|
|
|
"binary data from another object 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 ""
|
2018-10-04 10:28:41 +00:00
|
|
|
|
"Les structures tampons (ou simplement les \"tampons\", *buffers* en anglais) "
|
|
|
|
|
"sont utiles pour exposer les données binaires d'un autre objet au "
|
|
|
|
|
"programmeur Python. Elles peuvent également être utilisées comme un "
|
|
|
|
|
"mécanisme de découpage sans copie. En utilisant leur capacité à référencer "
|
|
|
|
|
"un bloc de mémoire, il est possible d'exposer toutes les données au "
|
|
|
|
|
"programmeur Python assez facilement. La mémoire peut être un grand tableau "
|
|
|
|
|
"constant dans une extension C, il peut s'agir d'un bloc brut de mémoire à "
|
|
|
|
|
"manipuler avant de passer à une bibliothèque de système d'exploitation ou "
|
|
|
|
|
"être utilisé pour transmettre des données structurées dans son format natif "
|
|
|
|
|
"en mémoire."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:80
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Contrary to most data types exposed by the Python interpreter, buffers are "
|
|
|
|
|
"not :c:type:`PyObject` pointers but rather simple C structures. This allows "
|
|
|
|
|
"them to be created and copied very simply. When a generic wrapper around a "
|
|
|
|
|
"buffer is needed, a :ref:`memoryview <memoryview-objects>` object can be "
|
|
|
|
|
"created."
|
|
|
|
|
msgstr ""
|
2018-07-16 16:59:59 +00:00
|
|
|
|
"Contrairement à la plupart des types de données exposés par l'interpréteur "
|
2018-07-16 22:02:01 +00:00
|
|
|
|
"Python, les tampons ne sont pas de simples pointeurs vers :c:type:`PyObject` "
|
|
|
|
|
"mais plutôt des structures C simples. Cela leur permet d'être créés et "
|
|
|
|
|
"copiés très simplement. lorsque vous avez besoin d'une enveloppe générique "
|
|
|
|
|
"(*wrapper* en anglais) pour un tampon, un objet :ref:`memoryview <memoryview-"
|
|
|
|
|
"objects>` peut être créé."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:86
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"For short instructions how to write an exporting object, see :ref:`Buffer "
|
|
|
|
|
"Object Structures <buffer-structs>`. For obtaining a buffer, see :c:func:"
|
|
|
|
|
"`PyObject_GetBuffer`."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:94
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"A pointer to the start of the logical structure described by the buffer "
|
|
|
|
|
"fields. This can be any location within the underlying physical memory block "
|
|
|
|
|
"of the exporter. For example, with negative :c:member:`~Py_buffer.strides` "
|
|
|
|
|
"the value may point to the end of the memory block."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:99
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"For :term:`contiguous` arrays, the value points to the beginning of the "
|
|
|
|
|
"memory block."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:104
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"A new reference to the exporting object. The reference is owned by the "
|
2019-11-15 22:57:16 +00:00
|
|
|
|
"consumer and automatically decremented and set to ``NULL`` by :c:func:"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
"`PyBuffer_Release`. The field is the equivalent of the return value of any "
|
|
|
|
|
"standard C-API function."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:109
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"As a special case, for *temporary* buffers that are wrapped by :c:func:"
|
|
|
|
|
"`PyMemoryView_FromBuffer` or :c:func:`PyBuffer_FillInfo` this field is "
|
2019-11-15 22:57:16 +00:00
|
|
|
|
"``NULL``. In general, exporting objects MUST NOT use this scheme."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:116
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"``product(shape) * itemsize``. For contiguous arrays, this is the length of "
|
|
|
|
|
"the underlying memory block. For non-contiguous arrays, it is the length "
|
|
|
|
|
"that the logical structure would have if it were copied to a contiguous "
|
|
|
|
|
"representation."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:121
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Accessing ``((char *)buf)[0] up to ((char *)buf)[len-1]`` is only valid if "
|
|
|
|
|
"the buffer has been obtained by a request that guarantees contiguity. In "
|
|
|
|
|
"most cases such a request will be :c:macro:`PyBUF_SIMPLE` or :c:macro:"
|
|
|
|
|
"`PyBUF_WRITABLE`."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:127
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"An indicator of whether the buffer is read-only. This field is controlled by "
|
|
|
|
|
"the :c:macro:`PyBUF_WRITABLE` flag."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:132
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Item size in bytes of a single element. Same as the value of :func:`struct."
|
2019-11-15 22:57:16 +00:00
|
|
|
|
"calcsize` called on non-``NULL`` :c:member:`~Py_buffer.format` values."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:135
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Important exception: If a consumer requests a buffer without the :c:macro:"
|
2019-11-15 22:57:16 +00:00
|
|
|
|
"`PyBUF_FORMAT` flag, :c:member:`~Py_buffer.format` will be set to "
|
|
|
|
|
"``NULL``, but :c:member:`~Py_buffer.itemsize` still has the value for the "
|
|
|
|
|
"original format."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:140
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"If :c:member:`~Py_buffer.shape` is present, the equality ``product(shape) * "
|
|
|
|
|
"itemsize == len`` still holds and the consumer can use :c:member:`~Py_buffer."
|
|
|
|
|
"itemsize` to navigate the buffer."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:144
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
2019-11-15 22:57:16 +00:00
|
|
|
|
"If :c:member:`~Py_buffer.shape` is ``NULL`` as a result of a :c:macro:"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
"`PyBUF_SIMPLE` or a :c:macro:`PyBUF_WRITABLE` request, the consumer must "
|
|
|
|
|
"disregard :c:member:`~Py_buffer.itemsize` and assume ``itemsize == 1``."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:150
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"A *NUL* terminated string in :mod:`struct` module style syntax describing "
|
2019-11-15 22:57:16 +00:00
|
|
|
|
"the contents of a single item. If this is ``NULL``, ``\"B\"`` (unsigned "
|
|
|
|
|
"bytes) is assumed."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:154
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "This field is controlled by the :c:macro:`PyBUF_FORMAT` flag."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:158
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"The number of dimensions the memory represents as an n-dimensional array. If "
|
2017-04-02 20:14:06 +00:00
|
|
|
|
"it is ``0``, :c:member:`~Py_buffer.buf` points to a single item representing "
|
|
|
|
|
"a scalar. In this case, :c:member:`~Py_buffer.shape`, :c:member:`~Py_buffer."
|
2019-11-15 22:57:16 +00:00
|
|
|
|
"strides` and :c:member:`~Py_buffer.suboffsets` MUST be ``NULL``."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:163
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"The macro :c:macro:`PyBUF_MAX_NDIM` limits the maximum number of dimensions "
|
|
|
|
|
"to 64. Exporters MUST respect this limit, consumers of multi-dimensional "
|
|
|
|
|
"buffers SHOULD be able to handle up to :c:macro:`PyBUF_MAX_NDIM` dimensions."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:169
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` "
|
|
|
|
|
"indicating the shape of the memory as an n-dimensional array. Note that "
|
|
|
|
|
"``shape[0] * ... * shape[ndim-1] * itemsize`` MUST be equal to :c:member:"
|
|
|
|
|
"`~Py_buffer.len`."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:174
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Shape values are restricted to ``shape[n] >= 0``. The case ``shape[n] == 0`` "
|
|
|
|
|
"requires special attention. See `complex arrays`_ for further information."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:178
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "The shape array is read-only for the consumer."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:182
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim` "
|
|
|
|
|
"giving the number of bytes to skip to get to a new element in each dimension."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:186
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Stride values can be any integer. For regular arrays, strides are usually "
|
|
|
|
|
"positive, but a consumer MUST be able to handle the case ``strides[n] <= "
|
|
|
|
|
"0``. See `complex arrays`_ for further information."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:190
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "The strides array is read-only for the consumer."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:194
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"An array of :c:type:`Py_ssize_t` of length :c:member:`~Py_buffer.ndim`. If "
|
|
|
|
|
"``suboffsets[n] >= 0``, the values stored along the nth dimension are "
|
|
|
|
|
"pointers and the suboffset value dictates how many bytes to add to each "
|
|
|
|
|
"pointer after de-referencing. A suboffset value that is negative indicates "
|
|
|
|
|
"that no de-referencing should occur (striding in a contiguous memory block)."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:201
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
2018-12-24 13:20:55 +00:00
|
|
|
|
"If all suboffsets are negative (i.e. no de-referencing is needed), then this "
|
2019-11-15 22:57:16 +00:00
|
|
|
|
"field must be ``NULL`` (the default value)."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:204
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"This type of array representation is used by the Python Imaging Library "
|
|
|
|
|
"(PIL). See `complex arrays`_ for further information how to access elements "
|
|
|
|
|
"of such an array."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:208
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "The suboffsets array is read-only for the consumer."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:212
|
2016-10-30 09:46:26 +00:00
|
|
|
|
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 MUST NOT alter this value."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:221
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "Buffer request types"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:223
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Buffers are usually obtained by sending a buffer request to an exporting "
|
|
|
|
|
"object via :c:func:`PyObject_GetBuffer`. Since the complexity of the logical "
|
|
|
|
|
"structure of the memory can vary drastically, the consumer uses the *flags* "
|
|
|
|
|
"argument to specify the exact buffer type it can handle."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:228
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"All :c:data:`Py_buffer` fields are unambiguously defined by the request type."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:232
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "request-independent fields"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:233
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"The following fields are not influenced by *flags* and must always be filled "
|
|
|
|
|
"in with the correct values: :c:member:`~Py_buffer.obj`, :c:member:"
|
|
|
|
|
"`~Py_buffer.buf`, :c:member:`~Py_buffer.len`, :c:member:`~Py_buffer."
|
|
|
|
|
"itemsize`, :c:member:`~Py_buffer.ndim`."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:239
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "readonly, format"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:243
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Controls the :c:member:`~Py_buffer.readonly` field. If set, the exporter "
|
|
|
|
|
"MUST provide a writable buffer or else report failure. Otherwise, the "
|
|
|
|
|
"exporter MAY provide either a read-only or writable buffer, but the choice "
|
|
|
|
|
"MUST be consistent for all consumers."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:250
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Controls the :c:member:`~Py_buffer.format` field. If set, this field MUST be "
|
2019-11-15 22:57:16 +00:00
|
|
|
|
"filled in correctly. Otherwise, this field MUST be ``NULL``."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:254
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
":c:macro:`PyBUF_WRITABLE` can be \\|'d to any of the flags in the next "
|
|
|
|
|
"section. Since :c:macro:`PyBUF_SIMPLE` is defined as 0, :c:macro:"
|
|
|
|
|
"`PyBUF_WRITABLE` can be used as a stand-alone flag to request a simple "
|
|
|
|
|
"writable buffer."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:258
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
":c:macro:`PyBUF_FORMAT` can be \\|'d to any of the flags except :c:macro:"
|
|
|
|
|
"`PyBUF_SIMPLE`. The latter already implies format ``B`` (unsigned bytes)."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:263
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "shape, strides, suboffsets"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:265
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"The flags that control the logical structure of the memory are listed in "
|
|
|
|
|
"decreasing order of complexity. Note that each flag contains all bits of the "
|
|
|
|
|
"flags below it."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-10-02 08:55:01 +00:00
|
|
|
|
#: c-api/buffer.rst:296 c-api/buffer.rst:321
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "Request"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-10-02 08:55:01 +00:00
|
|
|
|
#: c-api/buffer.rst:296 c-api/buffer.rst:321
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "shape"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-10-02 08:55:01 +00:00
|
|
|
|
#: c-api/buffer.rst:296 c-api/buffer.rst:321
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "strides"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-10-02 08:55:01 +00:00
|
|
|
|
#: c-api/buffer.rst:296 c-api/buffer.rst:321
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "suboffsets"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-10-02 08:55:01 +00:00
|
|
|
|
#: c-api/buffer.rst:276 c-api/buffer.rst:298 c-api/buffer.rst:302
|
|
|
|
|
#: c-api/buffer.rst:323 c-api/buffer.rst:327 c-api/buffer.rst:331
|
|
|
|
|
#: c-api/buffer.rst:335 c-api/buffer.rst:337
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "yes"
|
|
|
|
|
msgstr "oui"
|
|
|
|
|
|
2020-10-02 08:55:01 +00:00
|
|
|
|
#: c-api/buffer.rst:323 c-api/buffer.rst:325
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "if needed"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-10-02 08:55:01 +00:00
|
|
|
|
#: c-api/buffer.rst:278 c-api/buffer.rst:298 c-api/buffer.rst:302
|
|
|
|
|
#: c-api/buffer.rst:327 c-api/buffer.rst:331 c-api/buffer.rst:335
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:337
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "NULL"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:287
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "contiguity requests"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:289
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"C or Fortran :term:`contiguity <contiguous>` can be explicitly requested, "
|
|
|
|
|
"with and without stride information. Without stride information, the buffer "
|
|
|
|
|
"must be C-contiguous."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-10-02 08:55:01 +00:00
|
|
|
|
#: c-api/buffer.rst:321
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "contig"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-10-02 08:55:01 +00:00
|
|
|
|
#: c-api/buffer.rst:304 c-api/buffer.rst:337
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "C"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:300
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "F"
|
|
|
|
|
msgstr "F"
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:302
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "C or F"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-09-11 07:11:46 +00:00
|
|
|
|
#: c-api/buffer.rst:304
|
|
|
|
|
msgid ":c:macro:`PyBUF_ND`"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:309
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "compound requests"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:311
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"All possible requests are fully defined by some combination of the flags in "
|
|
|
|
|
"the previous section. For convenience, the buffer protocol provides "
|
|
|
|
|
"frequently used combinations as single flags."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:315
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"In the following table *U* stands for undefined contiguity. The consumer "
|
|
|
|
|
"would have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:321
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "readonly"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:321
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "format"
|
2019-09-16 10:08:42 +00:00
|
|
|
|
msgstr "format"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-10-02 08:55:01 +00:00
|
|
|
|
#: c-api/buffer.rst:325 c-api/buffer.rst:329 c-api/buffer.rst:333
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "U"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-10-02 08:55:01 +00:00
|
|
|
|
#: c-api/buffer.rst:327 c-api/buffer.rst:335
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "0"
|
|
|
|
|
msgstr "0"
|
|
|
|
|
|
2020-10-02 08:55:01 +00:00
|
|
|
|
#: c-api/buffer.rst:329 c-api/buffer.rst:337
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "1 or 0"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:342
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "Complex arrays"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:345
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "NumPy-style: shape and strides"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:347
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"The logical structure of NumPy-style arrays is defined by :c:member:"
|
|
|
|
|
"`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`, :c:member:`~Py_buffer."
|
|
|
|
|
"shape` and :c:member:`~Py_buffer.strides`."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:350
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"If ``ndim == 0``, the memory location pointed to by :c:member:`~Py_buffer."
|
|
|
|
|
"buf` is interpreted as a scalar of size :c:member:`~Py_buffer.itemsize`. In "
|
|
|
|
|
"that case, both :c:member:`~Py_buffer.shape` and :c:member:`~Py_buffer."
|
2019-11-15 22:57:16 +00:00
|
|
|
|
"strides` are ``NULL``."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:354
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
2019-11-15 22:57:16 +00:00
|
|
|
|
"If :c:member:`~Py_buffer.strides` is ``NULL``, the array is interpreted as a "
|
2016-10-30 09:46:26 +00:00
|
|
|
|
"standard n-dimensional C-array. Otherwise, the consumer must access an n-"
|
|
|
|
|
"dimensional array as follows:"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:364
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"As noted above, :c:member:`~Py_buffer.buf` can point to any location within "
|
|
|
|
|
"the actual memory block. An exporter can check the validity of a buffer with "
|
|
|
|
|
"this function:"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:398
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "PIL-style: shape, strides and suboffsets"
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:400
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"In addition to the regular items, PIL-style arrays can contain pointers that "
|
|
|
|
|
"must be followed in order to get to the next element in a dimension. For "
|
|
|
|
|
"example, the regular three-dimensional C-array ``char v[2][2][3]`` can also "
|
|
|
|
|
"be viewed as an array of 2 pointers to 2 two-dimensional arrays: ``char "
|
|
|
|
|
"(*v[2])[2][3]``. In suboffsets representation, those two pointers can be "
|
|
|
|
|
"embedded at the start of :c:member:`~Py_buffer.buf`, pointing to two ``char "
|
|
|
|
|
"x[2][3]`` arrays that can be located anywhere in memory."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:409
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Here is a function that returns a pointer to the element in an N-D array "
|
2019-11-15 22:57:16 +00:00
|
|
|
|
"pointed to by an N-dimensional index when there are both non-``NULL`` "
|
|
|
|
|
"strides and suboffsets::"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:428
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid "Buffer-related functions"
|
2018-10-04 10:28:41 +00:00
|
|
|
|
msgstr "Fonctions relatives aux tampons"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:432
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
2017-04-02 20:14:06 +00:00
|
|
|
|
"Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When "
|
|
|
|
|
"``1`` is returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` "
|
2018-12-24 13:20:55 +00:00
|
|
|
|
"will succeed. This function always succeeds."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:439
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Send a request to *exporter* to fill in *view* as specified by *flags*. If "
|
|
|
|
|
"the exporter cannot provide a buffer of the exact type, it MUST raise :c:"
|
2020-09-11 07:11:46 +00:00
|
|
|
|
"data:`PyExc_BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:444
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
2020-09-11 07:11:46 +00:00
|
|
|
|
"On success, fill in *view*, set ``view->obj`` to a new reference to "
|
2016-10-30 09:46:26 +00:00
|
|
|
|
"*exporter* and return 0. In the case of chained buffer providers that "
|
2020-09-11 07:11:46 +00:00
|
|
|
|
"redirect requests to a single object, ``view->obj`` MAY refer to this object "
|
|
|
|
|
"instead of *exporter* (See :ref:`Buffer Object Structures <buffer-structs>`)."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:449
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Successful calls to :c:func:`PyObject_GetBuffer` must be paired with calls "
|
|
|
|
|
"to :c:func:`PyBuffer_Release`, similar to :c:func:`malloc` and :c:func:"
|
|
|
|
|
"`free`. Thus, after the consumer is done with the buffer, :c:func:"
|
|
|
|
|
"`PyBuffer_Release` must be called exactly once."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:457
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
2020-09-11 07:11:46 +00:00
|
|
|
|
"Release the buffer *view* and decrement the reference count for ``view-"
|
|
|
|
|
">obj``. This function MUST be called when the buffer is no longer being "
|
2016-10-30 09:46:26 +00:00
|
|
|
|
"used, otherwise reference leaks may occur."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:461
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"It is an error to call this function on a buffer that was not obtained via :"
|
|
|
|
|
"c:func:`PyObject_GetBuffer`."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:45:25 +00:00
|
|
|
|
#: c-api/buffer.rst:467
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Return the implied :c:data:`~Py_buffer.itemsize` from :c:data:`~Py_buffer."
|
2020-07-20 08:56:42 +00:00
|
|
|
|
"format`. On error, raise an exception and return -1."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:56:42 +00:00
|
|
|
|
#: c-api/buffer.rst:475
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
2017-04-02 20:14:06 +00:00
|
|
|
|
"Return ``1`` if the memory defined by the *view* is C-style (*order* is "
|
|
|
|
|
"``'C'``) or Fortran-style (*order* is ``'F'``) :term:`contiguous` or either "
|
2018-12-24 13:20:55 +00:00
|
|
|
|
"one (*order* is ``'A'``). Return ``0`` otherwise. This function always "
|
|
|
|
|
"succeeds."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:56:42 +00:00
|
|
|
|
#: c-api/buffer.rst:482
|
2019-09-04 09:35:23 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Get the memory area pointed to by the *indices* inside the given *view*. "
|
|
|
|
|
"*indices* must point to an array of ``view->ndim`` indices."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:56:42 +00:00
|
|
|
|
#: c-api/buffer.rst:488
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
2019-10-09 16:10:12 +00:00
|
|
|
|
"Copy contiguous *len* bytes from *buf* to *view*. *fort* can be ``'C'`` or "
|
|
|
|
|
"``'F'`` (for C-style or Fortran-style ordering). ``0`` is returned on "
|
|
|
|
|
"success, ``-1`` on error."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:56:42 +00:00
|
|
|
|
#: c-api/buffer.rst:495
|
2019-10-09 16:10:12 +00:00
|
|
|
|
msgid ""
|
2018-04-28 22:28:01 +00:00
|
|
|
|
"Copy *len* bytes from *src* to its contiguous representation in *buf*. "
|
2019-10-09 16:10:12 +00:00
|
|
|
|
"*order* can be ``'C'`` or ``'F'`` or ``'A'`` (for C-style or Fortran-style "
|
|
|
|
|
"ordering or either one). ``0`` is returned on success, ``-1`` on error."
|
2018-04-28 22:28:01 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:56:42 +00:00
|
|
|
|
#: c-api/buffer.rst:499
|
2018-04-28 22:28:01 +00:00
|
|
|
|
msgid "This function fails if *len* != *src->len*."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:56:42 +00:00
|
|
|
|
#: c-api/buffer.rst:504
|
2018-04-28 22:28:01 +00:00
|
|
|
|
msgid ""
|
2016-10-30 09:46:26 +00:00
|
|
|
|
"Fill the *strides* array with byte-strides of a :term:`contiguous` (C-style "
|
|
|
|
|
"if *order* is ``'C'`` or Fortran-style if *order* is ``'F'``) array of the "
|
|
|
|
|
"given shape with the given number of bytes per element."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:56:42 +00:00
|
|
|
|
#: c-api/buffer.rst:511
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"Handle buffer requests for an exporter that wants to expose *buf* of size "
|
|
|
|
|
"*len* with writability set according to *readonly*. *buf* is interpreted as "
|
|
|
|
|
"a sequence of unsigned bytes."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:56:42 +00:00
|
|
|
|
#: c-api/buffer.rst:515
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"The *flags* argument indicates the request type. This function always fills "
|
|
|
|
|
"in *view* as specified by flags, unless *buf* has been designated as read-"
|
|
|
|
|
"only and :c:macro:`PyBUF_WRITABLE` is set in *flags*."
|
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:56:42 +00:00
|
|
|
|
#: c-api/buffer.rst:519
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
2020-09-11 07:11:46 +00:00
|
|
|
|
"On success, set ``view->obj`` to a new reference to *exporter* and return 0. "
|
|
|
|
|
"Otherwise, raise :c:data:`PyExc_BufferError`, set ``view->obj`` to ``NULL`` "
|
|
|
|
|
"and return ``-1``;"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|
|
|
|
|
|
2020-07-20 08:56:42 +00:00
|
|
|
|
#: c-api/buffer.rst:523
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgid ""
|
|
|
|
|
"If this function is used as part of a :ref:`getbufferproc <buffer-structs>`, "
|
|
|
|
|
"*exporter* MUST be set to the exporting object and *flags* must be passed "
|
2019-11-15 22:57:16 +00:00
|
|
|
|
"unmodified. Otherwise, *exporter* MUST be ``NULL``."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
msgstr ""
|