python-docs-fr/c-api.po

14055 lines
488 KiB
Plaintext

# SOME DESCRIPTIVE TITLE.
# Copyright (C) 1990-2010, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-01-23 10:04+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Translate Toolkit 1.7.0\n"
#: c-api/abstract.rst:8
msgid "Abstract Objects Layer"
msgstr "Couche d'Abstraction des Objets"
#: c-api/abstract.rst:10
msgid ""
"The functions in this chapter interact with Python objects regardless of "
"their type, or with wide classes of object types (e.g. all numerical types, "
"or all sequence types). When used on object types for which they do not "
"apply, they will raise a Python exception."
msgstr ""
"Dans ce chapitre, les fonctions s'appliquent à des objets Python sans tenir "
"compte de leur type, ou des classes d'objets au sens large (par exemple, "
"tous les types numériques, ou tous les types de séquence). Quand ils sont "
"utilisés sur des types d'objets qui ne correspondent pas, ils lèveront une "
"exception Python."
#: c-api/abstract.rst:15
#, fuzzy
msgid ""
"It is not possible to use these functions on objects that are not properly "
"initialized, such as a list object that has been created by :c:func:"
"`PyList_New`, but whose items have not been set to some non-\\ ``NULL`` "
"value yet."
msgstr ""
"Il n'est pas possible d'utiliser ces fonctions sur des objets qui n'ont pas "
"été correctement initialisés, comme un objet liste qui a été créé avec :"
"cfunc:`PyList_New` mais dont les éléments n'ont pas encore été mis à une "
"valeur non-\\ ``NULL``."
#: c-api/allocation.rst:6
msgid "Allocating Objects on the Heap"
msgstr "Allouer des objets dans le tas"
#: c-api/allocation.rst:14 c-api/allocation.rst:36 c-api/allocation.rst:61
#: c-api/buffer.rst:431 c-api/buffer.rst:441 c-api/buffer.rst:453
#: c-api/gcsupport.rst:51 c-api/string.rst:288 c-api/string.rst:318
#: c-api/unicode.rst:218 c-api/unicode.rst:386 c-api/unicode.rst:449
#: c-api/unicode.rst:462 c-api/unicode.rst:487 c-api/unicode.rst:501
#: c-api/unicode.rst:511 c-api/unicode.rst:631 c-api/unicode.rst:670
#: c-api/unicode.rst:725 c-api/unicode.rst:736 c-api/unicode.rst:759
#: c-api/unicode.rst:770 c-api/unicode.rst:794 c-api/unicode.rst:804
#: c-api/unicode.rst:828 c-api/unicode.rst:838 c-api/unicode.rst:888
#: c-api/unicode.rst:899 c-api/unicode.rst:926 c-api/unicode.rst:945
#: c-api/unicode.rst:965
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 ""
#: c-api/allocation.rst:24
msgid ""
"Initialize a newly-allocated object *op* with its type and initial "
"reference. Returns the initialized object. If *type* indicates that the "
"object participates in the cyclic garbage detector, it is added to the "
"detector's set of observed objects. Other fields of the object are not "
"affected."
msgstr ""
"Permet d'initialiser un objet *op* nouvellement alloué ainsi que son type et "
"sa référence initiale. Retourne l'objet initialisé. La présence de *type* "
"indique que l'objet doit être traité par le détecteur d'ordures cycliques, "
"il est de ce fait ajouté à l'ensemble du détecteur d'objets observés. Les "
"autres champs de l'objet ne sont pas affectés."
#: c-api/allocation.rst:33
msgid ""
"This does everything :c:func:`PyObject_Init` does, and also initializes the "
"length information for a variable-size object."
msgstr ""
#: c-api/allocation.rst:43
msgid ""
"Allocate a new Python object using the C structure type *TYPE* and the "
"Python type object *type*. Fields not defined by the Python object header "
"are not initialized; the object's reference count will be one. The size of "
"the memory allocation is determined from the :c:member:`~PyTypeObject."
"tp_basicsize` field of the type object."
msgstr ""
#: c-api/allocation.rst:52
msgid ""
"Allocate a new Python object using the C structure type *TYPE* and the "
"Python type object *type*. Fields not defined by the Python object header "
"are not initialized. The allocated memory allows for the *TYPE* structure "
"plus *size* fields of the size given by the :c:member:`~PyTypeObject."
"tp_itemsize` field of *type*. This is useful for implementing objects like "
"tuples, which are able to determine their size at construction time. "
"Embedding the array of fields into the same allocation decreases the number "
"of allocations, improving the memory management efficiency."
msgstr ""
#: c-api/allocation.rst:68
msgid ""
"Releases memory allocated to an object using :c:func:`PyObject_New` or :c:"
"func:`PyObject_NewVar`. This is normally called from the :c:member:"
"`~PyTypeObject.tp_dealloc` handler specified in the object's type. The "
"fields of the object should not be accessed after this call as the memory is "
"no longer a valid Python object."
msgstr ""
#: c-api/allocation.rst:77
msgid ""
"Create a new module object based on a name and table of functions, returning "
"the new module object."
msgstr ""
#: c-api/allocation.rst:80 c-api/allocation.rst:91 c-api/allocation.rst:113
msgid ""
"Older versions of Python did not support *NULL* as the value for the "
"*methods* argument."
msgstr ""
#: c-api/allocation.rst:87
msgid ""
"Create a new module object based on a name and table of functions, returning "
"the new module object. If *doc* is non-*NULL*, it will be used to define "
"the docstring for the module."
msgstr ""
#: c-api/allocation.rst:98
msgid ""
"Create a new module object based on a name and table of functions, returning "
"the new module object. If *doc* is non-*NULL*, it will be used to define "
"the docstring for the module. If *self* is non-*NULL*, it will passed to "
"the functions of the module as their (otherwise *NULL*) first parameter. "
"(This was added as an experimental feature, and there are no known uses in "
"the current version of Python.) For *apiver*, the only value which should "
"be passed is defined by the constant :const:`PYTHON_API_VERSION`."
msgstr ""
#: c-api/allocation.rst:109
msgid ""
"Most uses of this function should probably be using the :c:func:"
"`Py_InitModule3` instead; only use this if you are sure you need it."
msgstr ""
#: c-api/allocation.rst:120
msgid ""
"Object which is visible in Python as ``None``. This should only be accessed "
"using the ``Py_None`` macro, which evaluates to a pointer to this object."
msgstr ""
#: c-api/arg.rst:6
msgid "Parsing arguments and building values"
msgstr "Analyse des arguments et construction des valeurs"
#: c-api/arg.rst:8
msgid ""
"These functions are useful when creating your own extensions functions and "
"methods. Additional information and examples are available in :ref:"
"`extending-index`."
msgstr ""
"Ces fonctions sont utiles pour créer vos propres fonctions et méthodes "
"d'extensions. Des informations supplémentaires et des exemples sont "
"disponibles ici: ref:`extending-index`."
#: c-api/arg.rst:12
#, fuzzy
msgid ""
"The first three of these functions described, :c:func:`PyArg_ParseTuple`, :c:"
"func:`PyArg_ParseTupleAndKeywords`, and :c:func:`PyArg_Parse`, all use "
"*format strings* which are used to tell the function about the expected "
"arguments. The format strings use the same syntax for each of these "
"functions."
msgstr ""
"Dans Les trois premières de ces fonctions décrites, :cfunc: "
"`PyArg_ParseTuple`, :cfunc: `PyArg_ParseTupleAndKeywords`, et :cfunc: "
"`PyArg_Parse`, toutes utilisent *des chaînes de format* qui sont utilisées "
"pour indiquer à la fonction les arguments attendus. Les chaînes de format "
"utilise la même syntaxe pour chacune de ces fonctions."
#: c-api/arg.rst:18
msgid ""
"A format string consists of zero or more \"format units.\" A format unit "
"describes one Python object; it is usually a single character or a "
"parenthesized sequence of format units. With a few exceptions, a format "
"unit that is not a parenthesized sequence normally corresponds to a single "
"address argument to these functions. In the following description, the "
"quoted form is the format unit; the entry in (round) parentheses is the "
"Python object type that matches the format unit; and the entry in [square] "
"brackets is the type of the C variable(s) whose address should be passed."
msgstr ""
"Une chaîne de format se compose de zéro ou plusieurs \"unités de format\". "
"Une unité de format décrit un objet Python, elle est généralement composée "
"d'un seul caractère ou d'une séquence d'unités de format entre parenthèses. "
"À quelques exceptions près, une unité de format qui n'est pas une séquence "
"entre parenthèses correspond normalement à un argument d'une seule adresse "
"pour ces fonctions. Dans la description qui suit, la forme entre guillemets "
"est l'unité de format, l'entrée entre parenthèses est le type d'objet Python "
"qui correspond à l'unité de format, et l'entrée entre crochets est le type "
"de la variable C (ou des variables) dont l'adresse doit être donnée."
#: c-api/arg.rst:27
#, fuzzy
msgid ""
"These formats allow to access an object as a contiguous chunk of memory. You "
"don't have to provide raw storage for the returned unicode or bytes area. "
"Also, you won't have to release any memory yourself, except with the ``es``, "
"``es#``, ``et`` and ``et#`` formats."
msgstr ""
"Ces formats n'attendent pas que vous fournissiez un stockage sous forme "
"brute pour les chaînes ou octets retournés. Alors, vous n'aurez pas à "
"libérer la mémoire vous-même, excepté pour les formats ``es``, ``es#``, "
"``et`` et ``et#``."
#: c-api/arg.rst:39
msgid "s (string or Unicode) [const char *]"
msgstr ""
#: c-api/arg.rst:33
#, fuzzy
msgid ""
"Convert a Python string or Unicode object to a C pointer to a character "
"string. You must not provide storage for the string itself; a pointer to an "
"existing string is stored into the character pointer variable whose address "
"you pass. The C string is NUL-terminated. The Python string must not "
"contain embedded NUL bytes; if it does, a :exc:`TypeError` exception is "
"raised. Unicode objects are converted to C strings using the default "
"encoding. If this conversion fails, a :exc:`UnicodeError` is raised."
msgstr ""
"Convertir un objet Unicode en un pointeur C sur une chaîne de caractères. Un "
"pointeur sur une chaîne existante est stocké dans le pointeur de la variable "
"caractère dont vous passez l'adresse. La chaîne C est terminée par le "
"caractère NUL. La chaîne Python ne doit pas contenir d'octets NUL, sinon une "
"exception de type :exc:`TypeError` sera levée. Les objets Unicode sont "
"convertis en chaîne de caractères C avec l'encodage ``'utf-8'``. Si la "
"conversion échoue, une exception :exc:`UnicodeError` sera levée."
#: c-api/arg.rst:52
msgid ""
"s# (string, Unicode or any read buffer compatible object) [const char *, int "
"(or Py_ssize_t, see below)]"
msgstr ""
#: c-api/arg.rst:42
msgid ""
"This variant on ``s`` stores into two C variables, the first one a pointer "
"to a character string, the second one its length. In this case the Python "
"string may contain embedded null bytes. Unicode objects pass back a pointer "
"to the default encoded string version of the object if such a conversion is "
"possible. All other read-buffer compatible objects pass back a reference to "
"the raw internal data representation."
msgstr ""
#: c-api/arg.rst:49
#, fuzzy
msgid ""
"Starting with Python 2.5 the type of the length argument can be controlled "
"by defining the macro :c:macro:`PY_SSIZE_T_CLEAN` before including :file:"
"`Python.h`. If the macro is defined, length is a :c:type:`Py_ssize_t` "
"rather than an int."
msgstr ""
"Pour toutes les variantes de formats ``#`` (``s#``, ``y#``, etc), le type de "
"l'argument longueur (int ou :ctype:`Py_ssize_t`) est contrôlé en définissant "
"la macro :cmacro:`PY_SSIZE_T_CLEAN` avant d'inclure le fichier :file:`Python."
"h`. Si la macro est définie, la longueur est de type :ctype:`Py_ssize_t` au "
"lieu d'être de type :ctype:`int`. Ce comportement changera dans une future "
"version de Python, qui supportera seulement :ctype:`Py_ssize_t` et plus :"
"ctype:`int`. Il est préférable de toujours définir :cmacro:"
"`PY_SSIZE_T_CLEAN`."
#: c-api/arg.rst:61
msgid "s* (string, Unicode, or any buffer compatible object) [Py_buffer]"
msgstr ""
#: c-api/arg.rst:55
#, fuzzy
msgid ""
"Similar to ``s#``, this code fills a Py_buffer structure provided by the "
"caller. The buffer gets locked, so that the caller can subsequently use the "
"buffer even inside a ``Py_BEGIN_ALLOW_THREADS`` block; the caller is "
"responsible for calling ``PyBuffer_Release`` with the structure after it has "
"processed the data."
msgstr ""
"Néanmoins, quand une structure :ctype:`Py_buffer` est en cours de "
"remplissage, le tampon sous-jacent est verrouillé pour permettre à "
"l'appelant d'utiliser le buffer par la suite, même lorsqu'il est à "
"'intérieur d'un bloc :ctype:`Py_BEGIN_ALLOW_THREADS`. Ceci sans le risque "
"pour les données mutables de voir leur taille changée ou d'être supprimées. "
"En conséquence, **il vous appartient d'appeler** :cfunc:`PyBuffer_Release` "
"après que vous ayez terminé de traiter les données (ou après une "
"interruption prémataturée du traitement de ces données)."
#: c-api/arg.rst:65
msgid "z (string, Unicode or None) [const char *]"
msgstr ""
#: c-api/arg.rst:64
msgid ""
"Like ``s``, but the Python object may also be ``None``, in which case the C "
"pointer is set to *NULL*."
msgstr ""
"Comme ``s``, mais l'objet Python peut aussi être ``None``, auquel cas le "
"pointeur C devient *NULL*."
#: c-api/arg.rst:68
msgid ""
"z# (string, Unicode, None or any read buffer compatible object) [const char "
"*, int]"
msgstr ""
#: c-api/arg.rst:68
msgid "This is to ``s#`` as ``z`` is to ``s``."
msgstr ""
#: c-api/arg.rst:73
msgid "z* (string, Unicode, None or any buffer compatible object) [Py_buffer]"
msgstr ""
#: c-api/arg.rst:71
msgid "This is to ``s*`` as ``z`` is to ``s``."
msgstr ""
#: c-api/arg.rst:80
msgid "u (Unicode) [Py_UNICODE *]"
msgstr ""
#: c-api/arg.rst:76
msgid ""
"Convert a Python Unicode object to a C pointer to a NUL-terminated buffer of "
"16-bit Unicode (UTF-16) data. As with ``s``, there is no need to provide "
"storage for the Unicode data buffer; a pointer to the existing Unicode data "
"is stored into the :c:type:`Py_UNICODE` pointer variable whose address you "
"pass."
msgstr ""
#: c-api/arg.rst:86
msgid "u# (Unicode) [Py_UNICODE *, int]"
msgstr ""
#: c-api/arg.rst:83
#, fuzzy
msgid ""
"This variant on ``u`` stores into two C variables, the first one a pointer "
"to a Unicode data buffer, the second one its length. Non-Unicode objects are "
"handled by interpreting their read-buffer pointer as pointer to a :c:type:"
"`Py_UNICODE` array."
msgstr ""
"Cette variante de ``u`` stocke son résultat dans deux variables C, la "
"première pointant vers un tampon de données Unicode, la seconde donnant sa "
"longueur."
#: c-api/arg.rst:105
msgid ""
"es (string, Unicode or character buffer compatible object) [const char "
"*encoding, char **buffer]"
msgstr ""
#: c-api/arg.rst:89
#, fuzzy
msgid ""
"This variant on ``s`` is used for encoding Unicode and objects convertible "
"to Unicode into a character buffer. It only works for encoded data without "
"embedded NUL bytes."
msgstr ""
"Cette variante ``s`` est utilisée pour encoder de l'Unicode dans un buffer "
"de caractères. Cela ne fonctionne que pour les données encodées qui ne "
"contiennent pas d'octets NUL."
#: c-api/arg.rst:93
#, fuzzy
msgid ""
"This format requires two arguments. The first is only used as input, and "
"must be a :c:type:`const char\\*` which points to the name of an encoding as "
"a NUL-terminated string, or *NULL*, in which case the default encoding is "
"used. An exception is raised if the named encoding is not known to Python. "
"The second argument must be a :c:type:`char\\*\\*`; the value of the pointer "
"it references will be set to a buffer with the contents of the argument "
"text. The text will be encoded in the encoding specified by the first "
"argument."
msgstr ""
"Ce format requiert deux arguments. Le premier est seulement utilisé en "
"entrée, et doit être de type :ctype:`const char\\*`. Il pointe sur une "
"chaîne de caractères contenant le nom d'un encodage, terminée par NUL. Si "
"cette chaîne contient *NULL*, l'encoding ``'utf-8'`` sera utilisé. Une "
"exception sera levé si le nom de l'encodage est inconnu de Python. Le second "
"argument doit être de type :ctype:`char\\*\\*`, la valeur du pointeur qu'il "
"référence sera fixée à la valeur d'un tampon contenant le texte de "
"l'argument. Le texte sera encodé avec l'encodage spécifié dans le premier "
"argument. "
#: c-api/arg.rst:102
#, fuzzy
msgid ""
":c:func:`PyArg_ParseTuple` will allocate a buffer of the needed size, copy "
"the encoded data into this buffer and adjust *\\*buffer* to reference the "
"newly allocated storage. The caller is responsible for calling :c:func:"
"`PyMem_Free` to free the allocated buffer after use."
msgstr ""
":cfunc:`PyArg_ParseTuple` allouera un tampon de la taille nécessaire, "
"copiera les données encodées dans ce tampon et fera pointer *\\*buffer* vers "
"le nouveau tampon alloué. L'appelant est responsable de l'invocation de :"
"cfunc:`PyMem_Free` pour libérer le tampon alloué après utilisatiopn"
#: c-api/arg.rst:110
msgid ""
"et (string, Unicode or character buffer compatible object) [const char "
"*encoding, char **buffer]"
msgstr ""
#: c-api/arg.rst:108
#, fuzzy
msgid ""
"Same as ``es`` except that 8-bit string objects are passed through without "
"recoding them. Instead, the implementation assumes that the string object "
"uses the encoding passed in as parameter."
msgstr ""
"Comme pour ``es``, excepté que les objets chaînes de caractères sont passées "
"sans les ré-encoder. À la place, l'implémentation assume que l'objet chaîne "
"de caractères utilise l'encodage passé en tant que paramètre."
#: c-api/arg.rst:142
msgid ""
"es# (string, Unicode or character buffer compatible object) [const char "
"*encoding, char **buffer, int *buffer_length]"
msgstr ""
#: c-api/arg.rst:113
#, fuzzy
msgid ""
"This variant on ``s#`` is used for encoding Unicode and objects convertible "
"to Unicode into a character buffer. Unlike the ``es`` format, this variant "
"allows input data which contains NUL characters."
msgstr ""
"Cette variante de ``s#`` est utilisée pour encoder de l'Unicode dans un "
"tampon de caractères. Contrairement au format ``es``, cette variante "
"autorise les caractères NUL dans les données d'entrée."
#: c-api/arg.rst:117
#, fuzzy
msgid ""
"It requires three arguments. The first is only used as input, and must be "
"a :c:type:`const char\\*` which points to the name of an encoding as a NUL-"
"terminated string, or *NULL*, in which case the default encoding is used. "
"An exception is raised if the named encoding is not known to Python. The "
"second argument must be a :c:type:`char\\*\\*`; the value of the pointer it "
"references will be set to a buffer with the contents of the argument text. "
"The text will be encoded in the encoding specified by the first argument. "
"The third argument must be a pointer to an integer; the referenced integer "
"will be set to the number of bytes in the output buffer."
msgstr ""
"Ce format requiert deux arguments. Le premier est seulement utilisé en "
"entrée, et doit être de type :ctype:`const char\\*`. Il pointe sur une "
"chaîne de caractères contenant le nom d'un encodage, terminée par NUL. Si "
"cette chaîne contient *NULL*, l'encoding ``'utf-8'`` sera utilisé. Une "
"exception sera levé si le nom de l'encodage est inconnu de Python. Le second "
"argument doit être de type :ctype:`char\\*\\*`, la valeur du pointeur qu'il "
"référence sera fixée à la valeur d'un tampon contenant le texte de "
"l'argument. Le texte sera encodé avec l'encodage spécifié dans le premier "
"argument. Le troisième argument doit être un pointeur sur un entier ; "
"l'entier référencé sera positionné avec le nombre d'octets dans le tampon de "
"sortie"
#: c-api/arg.rst:127
msgid "There are two modes of operation:"
msgstr "Il existe deux modes de fonctionnement :"
#: c-api/arg.rst:129
#, fuzzy
msgid ""
"If *\\*buffer* points a *NULL* pointer, the function will allocate a buffer "
"of the needed size, copy the encoded data into this buffer and set *"
"\\*buffer* to reference the newly allocated storage. The caller is "
"responsible for calling :c:func:`PyMem_Free` to free the allocated buffer "
"after usage."
msgstr ""
"Si *\\*buffer* pointe sur un pointeur *NULL*, la fonction allouera un tampon "
"de la taille nécessaire, copiera les données encodées dans ce tampon et "
"mettra dans *\\*buffer* le nouveau tampon alloué. L'appelant est responsable "
"de la libération de la mémoire après utilisation du tampon, par un appel à :"
"cfunc:`PyMem_Free`."
#: c-api/arg.rst:135
#, fuzzy
msgid ""
"If *\\*buffer* points to a non-*NULL* pointer (an already allocated "
"buffer), :c:func:`PyArg_ParseTuple` will use this location as the buffer and "
"interpret the initial value of *\\*buffer_length* as the buffer size. It "
"will then copy the encoded data into the buffer and NUL-terminate it. If "
"the buffer is not large enough, a :exc:`ValueError` will be set."
msgstr ""
"Si *\\*buffer* pointe sur un pointeur qui n'est pas *NULL* (un tampon déjà "
"alloué), :cfunc:`PyArg_ParseTuple` utilisera cet espace comme le tampon et "
"interprétera la valeur initiale de *\\*buffer_length* comme la taille du "
"tampon. Il copiera alors les données encodées dans le tampon et terminera ce "
"dernier par NUL. Si le tampon n'est pas de taille suffisante, une exception :"
"exc:`ValueError` sera levée."
#: c-api/arg.rst:141
msgid ""
"In both cases, *\\*buffer_length* is set to the length of the encoded data "
"without the trailing NUL byte."
msgstr ""
"Dans les deux cas, *\\*buffer_length* est la longueur des données encodées, "
"sans l'octet NUL de fin."
#: c-api/arg.rst:147
msgid ""
"et# (string, Unicode or character buffer compatible object) [const char "
"*encoding, char **buffer, int *buffer_length]"
msgstr ""
#: c-api/arg.rst:145
#, fuzzy
msgid ""
"Same as ``es#`` except that string objects are passed through without "
"recoding them. Instead, the implementation assumes that the string object "
"uses the encoding passed in as parameter."
msgstr ""
"Comme pour ``es#`` excepté que les objets chaînes de caractères sont traités "
"sans recodage. À la place, l'implémentation assume que les objets de type "
"chaînes de caractères utilisent l'encodage passé en tant que paramètre."
#: c-api/arg.rst:151
msgid "b (integer) [unsigned char]"
msgstr ""
#: c-api/arg.rst:150
#, fuzzy
msgid ""
"Convert a nonnegative Python integer to an unsigned tiny int, stored in a C :"
"c:type:`unsigned char`."
msgstr ""
"Convertit un entier Python positif ou nul en un unsigned tiny int, stocké "
"dans un C :ctype:`unsigned char`."
#: c-api/arg.rst:157 c-api/arg.rst:484
msgid "B (integer) [unsigned char]"
msgstr ""
#: c-api/arg.rst:154
#, fuzzy
msgid ""
"Convert a Python integer to a tiny int without overflow checking, stored in "
"a C :c:type:`unsigned char`."
msgstr ""
"Convertit un entier Python en un tiny int sans vérifier le débordement, "
"stocké dans un C :ctype:`unsigned char`."
#: c-api/arg.rst:160 c-api/arg.rst:478
msgid "h (integer) [short int]"
msgstr ""
#: c-api/arg.rst:160
#, fuzzy
msgid "Convert a Python integer to a C :c:type:`short int`."
msgstr "Convertit un entier Python en un C :ctype:`short int`."
#: c-api/arg.rst:166 c-api/arg.rst:487
msgid "H (integer) [unsigned short int]"
msgstr ""
#: c-api/arg.rst:163
#, fuzzy
msgid ""
"Convert a Python integer to a C :c:type:`unsigned short int`, without "
"overflow checking."
msgstr ""
"Convertit un entier Python en un C :ctype:`unsigned short int`, sans "
"contrôle de débordement."
#: c-api/arg.rst:169 c-api/arg.rst:472
msgid "i (integer) [int]"
msgstr ""
#: c-api/arg.rst:169
#, fuzzy
msgid "Convert a Python integer to a plain C :c:type:`int`."
msgstr "Convertit un entier Python en un type C :ctype:`int`."
#: c-api/arg.rst:175
msgid "I (integer) [unsigned int]"
msgstr ""
#: c-api/arg.rst:172
#, fuzzy
msgid ""
"Convert a Python integer to a C :c:type:`unsigned int`, without overflow "
"checking."
msgstr ""
"Convertit un entier Python en un type C :ctype:`unsigned int`, sans contrôle "
"de le débordement."
#: c-api/arg.rst:178 c-api/arg.rst:481
msgid "l (integer) [long int]"
msgstr ""
#: c-api/arg.rst:178
#, fuzzy
msgid "Convert a Python integer to a C :c:type:`long int`."
msgstr "Convertit un entier Python en un type :ctype:`long int`."
#: c-api/arg.rst:184
msgid "k (integer) [unsigned long]"
msgstr ""
#: c-api/arg.rst:181
#, fuzzy
msgid ""
"Convert a Python integer or long integer to a C :c:type:`unsigned long` "
"without overflow checking."
msgstr ""
"Convertit un entier Python en un type C :ctype:`unsigned long` sans en "
"vérifier le débordement."
#: c-api/arg.rst:189
msgid "L (integer) [PY_LONG_LONG]"
msgstr ""
#: c-api/arg.rst:187
#, fuzzy
msgid ""
"Convert a Python integer to a C :c:type:`long long`. This format is only "
"available on platforms that support :c:type:`long long` (or :c:type:`_int64` "
"on Windows)."
msgstr ""
"Convertit un entier Python en un type C :ctype:`long long`. Ce format est "
"uniquement disponible sur les plates-formes qui prennent en charge :ctype:"
"`long long` (ou :ctype:`_int64` sous Windows)."
#: c-api/arg.rst:197
msgid "K (integer) [unsigned PY_LONG_LONG]"
msgstr ""
#: c-api/arg.rst:192
#, fuzzy
msgid ""
"Convert a Python integer or long integer to a C :c:type:`unsigned long long` "
"without overflow checking. This format is only available on platforms that "
"support :c:type:`unsigned long long` (or :c:type:`unsigned _int64` on "
"Windows)."
msgstr ""
"Convertit un entier Python en un type C :ctype:`unsigned long long` sans en "
"vérifier le débordement. Ce format est uniquement disponible sur les plates-"
"formes qui prennent en charge :ctype:`unsigned long long` (ou :ctype:"
"`unsigned _int64` sous Windows)."
#: c-api/arg.rst:202
msgid "n (integer) [Py_ssize_t]"
msgstr ""
#: c-api/arg.rst:200
#, fuzzy
msgid "Convert a Python integer or long integer to a C :c:type:`Py_ssize_t`."
msgstr "Convertit un entier Python en un type C :ctype:`Py_ssize_t`."
#: c-api/arg.rst:206 c-api/arg.rst:512
msgid "c (string of length 1) [char]"
msgstr ""
#: c-api/arg.rst:205
#, fuzzy
msgid ""
"Convert a Python character, represented as a string of length 1, to a C :c:"
"type:`char`."
msgstr ""
"Convertit un caractère Python, représenté comme un objet :class:`str` de "
"longueur 1, en un type C :ctype:`int`."
#: c-api/arg.rst:209 c-api/arg.rst:518
msgid "f (float) [float]"
msgstr ""
#: c-api/arg.rst:209
#, fuzzy
msgid "Convert a Python floating point number to a C :c:type:`float`."
msgstr "Convertit un nombre flottant Python vers un type C :ctype:`float`."
#: c-api/arg.rst:212 c-api/arg.rst:515
msgid "d (float) [double]"
msgstr ""
#: c-api/arg.rst:212
#, fuzzy
msgid "Convert a Python floating point number to a C :c:type:`double`."
msgstr "Convertit un nombre flottant Python vers un type C :ctype:`double`."
#: c-api/arg.rst:215
msgid "D (complex) [Py_complex]"
msgstr ""
#: c-api/arg.rst:215
#, fuzzy
msgid "Convert a Python complex number to a C :c:type:`Py_complex` structure."
msgstr ""
"Convertit un nombre complexe Python vers une structure C :ctype:`Py_complex`."
#: c-api/arg.rst:220 c-api/arg.rst:529
msgid "O (object) [PyObject *]"
msgstr "O (object) [PyObject *]"
#: c-api/arg.rst:218
msgid ""
"Store a Python object (without any conversion) in a C object pointer. The C "
"program thus receives the actual object that was passed. The object's "
"reference count is not increased. The pointer stored is not *NULL*."
msgstr ""
"Stocke un objet Python (sans aucune conversion) en un pointeur sur un objet "
"C. Ainsi, Le programme C reçoit l'objet réel qui a été passé. Le compteur de "
"référence sur l'objet n'est pas incrémenté. Le pointeur stocké n'est pas "
"*NULL*."
#: c-api/arg.rst:227
msgid "O! (object) [typeobject, PyObject *]"
msgstr "O! (object) [typeobject, PyObject *]"
#: c-api/arg.rst:223
#, fuzzy
msgid ""
"Store a Python object in a C object pointer. This is similar to ``O``, but "
"takes two C arguments: the first is the address of a Python type object, the "
"second is the address of the C variable (of type :c:type:`PyObject\\*`) into "
"which the object pointer is stored. If the Python object does not have the "
"required type, :exc:`TypeError` is raised."
msgstr ""
"Stocke un objet Python en pointeur sur un objet C. C'est comparable à ``O``, "
"mais la fonction prend deux arguments C : le premier est l'adresse d'un "
"objet de type Python, le second est l'adresse d'une variable C (de type :"
"ctype:`P:exc:`TypeError`yObject\\*`) dans laquelle le pointeur sur l'objet "
"sera stocké. Si l'objet Python n'est pas du type requis, une exception :exc:"
"`TypeError` sera levée."
#: c-api/arg.rst:242 c-api/arg.rst:543
msgid "O& (object) [converter, anything]"
msgstr ""
#: c-api/arg.rst:230
#, fuzzy
msgid ""
"Convert a Python object to a C variable through a *converter* function. This "
"takes two arguments: the first is a function, the second is the address of a "
"C variable (of arbitrary type), converted to :c:type:`void \\*`. The "
"*converter* function in turn is called as follows::"
msgstr ""
"Converti un objet Python en une variable C en utilisant une fonction de "
"*conversion*. La fonction prend deux arguments : le premier est une "
"fonction, le second est l'adresse d'une variable C (de type arbitraire), "
"convertie en :ctype:`void \\*`. La fonction de *conversion* est appellée à "
"son tour de la manière suivante :"
#: c-api/arg.rst:237
#, fuzzy
msgid ""
"where *object* is the Python object to be converted and *address* is the :c:"
"type:`void\\*` argument that was passed to the :c:func:`PyArg_Parse\\*` "
"function. The returned *status* should be ``1`` for a successful conversion "
"and ``0`` if the conversion has failed. When the conversion fails, the "
"*converter* function should raise an exception and leave the content of "
"*address* unmodified."
msgstr ""
"Où *objet* est l'objet Python à convertir et *adresse* est l'argument de "
"type :ctype:`void\\*` qui a été passé à la function :cfunc:`PyArg_Parse\\*`. "
"Le status retourné devrait être ``1`` pour conversion réussie, et ``0`` si "
"la conversion a échouée. Quand la conversion échoue, la fonction de "
"*conversion* devrait lever une exception et laisser le contenu de *adresse* "
"non modifié."
#: c-api/arg.rst:247
msgid "S (string) [PyStringObject *]"
msgstr ""
#: c-api/arg.rst:245
#, fuzzy
msgid ""
"Like ``O`` but requires that the Python object is a string object. Raises :"
"exc:`TypeError` if the object is not a string object. The C variable may "
"also be declared as :c:type:`PyObject\\*`."
msgstr ""
"Exige que l'objet Python soit un objet Unicode, sans tenter aucune "
"conversion. Lève une :exc:`TypeError` si l'objet n'est pas un objet Unicode. "
"La variable C peut également être déclarée en tant que :ctype:`PyObject\\*`."
#: c-api/arg.rst:252
msgid "U (Unicode string) [PyUnicodeObject *]"
msgstr ""
#: c-api/arg.rst:250
#, fuzzy
msgid ""
"Like ``O`` but requires that the Python object is a Unicode object. Raises :"
"exc:`TypeError` if the object is not a Unicode object. The C variable may "
"also be declared as :c:type:`PyObject\\*`."
msgstr ""
"Exige que l'objet Python soit un objet Unicode, sans tenter aucune "
"conversion. Lève une :exc:`TypeError` si l'objet n'est pas un objet Unicode. "
"La variable C peut également être déclarée en tant que :ctype:`PyObject\\*`."
#: c-api/arg.rst:259
msgid "t# (read-only character buffer) [char *, int]"
msgstr ""
#: c-api/arg.rst:255
msgid ""
"Like ``s#``, but accepts any object which implements the read-only buffer "
"interface. The :c:type:`char\\*` variable is set to point to the first byte "
"of the buffer, and the :c:type:`int` is set to the length of the buffer. "
"Only single-segment buffer objects are accepted; :exc:`TypeError` is raised "
"for all others."
msgstr ""
#: c-api/arg.rst:265
msgid "w (read-write character buffer) [char *]"
msgstr ""
#: c-api/arg.rst:262
msgid ""
"Similar to ``s``, but accepts any object which implements the read-write "
"buffer interface. The caller must determine the length of the buffer by "
"other means, or use ``w#`` instead. Only single-segment buffer objects are "
"accepted; :exc:`TypeError` is raised for all others."
msgstr ""
#: c-api/arg.rst:272
msgid "w# (read-write character buffer) [char *, Py_ssize_t]"
msgstr ""
#: c-api/arg.rst:268
msgid ""
"Like ``s#``, but accepts any object which implements the read-write buffer "
"interface. The :c:type:`char \\*` variable is set to point to the first "
"byte of the buffer, and the :c:type:`Py_ssize_t` is set to the length of the "
"buffer. Only single-segment buffer objects are accepted; :exc:`TypeError` "
"is raised for all others."
msgstr ""
#: c-api/arg.rst:277
msgid "w* (read-write byte-oriented buffer) [Py_buffer]"
msgstr ""
#: c-api/arg.rst:275
msgid "This is to ``w`` what ``s*`` is to ``s``."
msgstr ""
#: c-api/arg.rst:290 c-api/arg.rst:547
msgid "(items) (tuple) [matching-items]"
msgstr ""
#: c-api/arg.rst:280
msgid ""
"The object must be a Python sequence whose length is the number of format "
"units in *items*. The C arguments must correspond to the individual format "
"units in *items*. Format units for sequences may be nested."
msgstr ""
"L'objet doit être une séquence Python dont la longueur est le nombre "
"d'unités de formats dans *articles*. Les arguments C doivent correspondre à "
"chaque unité de format particulière dans *articles*. Les unités de formats "
"pour les séquences peuvent être imbriquées. "
#: c-api/arg.rst:286
msgid ""
"Prior to Python version 1.5.2, this format specifier only accepted a tuple "
"containing the individual parameters, not an arbitrary sequence. Code which "
"previously caused :exc:`TypeError` to be raised here may now proceed without "
"an exception. This is not expected to be a problem for existing code."
msgstr ""
#: c-api/arg.rst:292
#, fuzzy
msgid ""
"It is possible to pass Python long integers where integers are requested; "
"however no proper range checking is done --- the most significant bits are "
"silently truncated when the receiving field is too small to receive the "
"value (actually, the semantics are inherited from downcasts in C --- your "
"mileage may vary)."
msgstr ""
"Il est possible de passer des entiers de type \"long\" (dont la valeur "
"dépasse le :const:`LONG_MAX` de la plateforme), cependant aucun contrôle "
"d'intervalle n'est effectué --- les bits les plus significatifs sont "
"tronqués silencieusement quand le champ cible est trop petit (en fait, la "
"sémantique est héritée du transtypage en C --- la perte peut varier)."
#: c-api/arg.rst:298
msgid ""
"A few other characters have a meaning in a format string. These may not "
"occur inside nested parentheses. They are:"
msgstr ""
"Quelques autres caractères ont un sens dans une chaîne de format. On ne doit "
"pas les trouvées dans des parenthèses imbriquées. Ce sont :"
#: c-api/arg.rst:306
msgid "|"
msgstr ""
#: c-api/arg.rst:302
#, fuzzy
msgid ""
"Indicates that the remaining arguments in the Python argument list are "
"optional. The C variables corresponding to optional arguments should be "
"initialized to their default value --- when an optional argument is not "
"specified, :c:func:`PyArg_ParseTuple` does not touch the contents of the "
"corresponding C variable(s)."
msgstr ""
"Incique que les arguments restants dans la liste Python des arguments sont "
"optionels. Les variables C correspondant à ces arguments optionnels "
"devraient être initialisés avec leur valeur par défaut --- quan un argument "
"optionnel n'est pas spécifié, la fonction :cfunc:`PyArg_ParseTuple` ne "
"modifie par le contenu de la ou des variables C correspondantes."
#: c-api/arg.rst:311
msgid ":"
msgstr ""
#: c-api/arg.rst:309
#, fuzzy
msgid ""
"The list of format units ends here; the string after the colon is used as "
"the function name in error messages (the \"associated value\" of the "
"exception that :c:func:`PyArg_ParseTuple` raises)."
msgstr ""
"La liste des unités de format s'arrête ici ; la chaîne après les deux-points "
"est utilisée comme le nom de la fonction dans les messages d'erreur (la "
"\"valeur associée\" de l'exception levée par :cfunc:`PyArg_ParseTuple`)."
#: c-api/arg.rst:316
msgid ";"
msgstr ""
#: c-api/arg.rst:314
msgid ""
"The list of format units ends here; the string after the semicolon is used "
"as the error message *instead* of the default error message. ``:`` and ``;"
"`` mutually exclude each other."
msgstr ""
"La liste des unités de format s'arrête ici ; la chaîne après le point-"
"virgule est utilise comme message d'erreur *au lieu* du message d'erreur par "
"défaut. ``:`` et ``;`` sont mutuellement exclusifs. "
#: c-api/arg.rst:318
msgid ""
"Note that any Python object references which are provided to the caller are "
"*borrowed* references; do not decrement their reference count!"
msgstr ""
"Notez que n'importe quelles références sur un objet Python qui sont données "
"à l'appelant sont des références *empruntées* ; ne décrémentez pas leur "
"compteur de références ! "
#: c-api/arg.rst:321
msgid ""
"Additional arguments passed to these functions must be addresses of "
"variables whose type is determined by the format string; these are used to "
"store values from the input tuple. There are a few cases, as described in "
"the list of format units above, where these parameters are used as input "
"values; they should match what is specified for the corresponding format "
"unit in that case."
msgstr ""
"Les arguments additionnels qui sont donnés à ces fonctions doivent être des "
"adresses de variables dont le type est déterminé par la chaîine de format. "
"Elles sont utilisées pour stocker les valeurs du n-uplet d'entrée. Il y a "
"quelques cas, comme décrit précédemment dans le liste des unités de formats, "
"où ces paramètres sont utilisés comme valeurs d'entrée. Dans ce cas, ils "
"devraient correspondre à ce qui est spécifié pour l'unité de format "
"correspondante."
#: c-api/arg.rst:327
#, fuzzy
msgid ""
"For the conversion to succeed, the *arg* object must match the format and "
"the format must be exhausted. On success, the :c:func:`PyArg_Parse\\*` "
"functions return true, otherwise they return false and raise an appropriate "
"exception. When the :c:func:`PyArg_Parse\\*` functions fail due to "
"conversion failure in one of the format units, the variables at the "
"addresses corresponding to that and the following format units are left "
"untouched."
msgstr ""
"Pour que la conversion réussise, l'objet *arg* doit correspondre au format, "
"et le format doit être épuisé. En cas de succès, les fonctions :cfunc:"
"`PyArg_Parse\\*` retournent vrai, sinon elles retournent faux et lèvent "
"l'exception appropriée. Quand une fonction :cfunc:`PyArg_Parse\\*` échoue en "
"raison d'une erreur de conversion dans une des unités de format, les "
"variables aux adresses correspondantes à cette erreur et les unités de "
"formats suivantes sont laissées telles quelles."
#: c-api/arg.rst:337
msgid ""
"Parse the parameters of a function that takes only positional parameters "
"into local variables. Returns true on success; on failure, it returns false "
"and raises the appropriate exception."
msgstr ""
#: c-api/arg.rst:344
msgid ""
"Identical to :c:func:`PyArg_ParseTuple`, except that it accepts a va_list "
"rather than a variable number of arguments."
msgstr ""
#: c-api/arg.rst:350
msgid ""
"Parse the parameters of a function that takes both positional and keyword "
"parameters into local variables. Returns true on success; on failure, it "
"returns false and raises the appropriate exception."
msgstr ""
#: c-api/arg.rst:357
msgid ""
"Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a "
"va_list rather than a variable number of arguments."
msgstr ""
#: c-api/arg.rst:363
msgid ""
"Function used to deconstruct the argument lists of \"old-style\" functions "
"--- these are functions which use the :const:`METH_OLDARGS` parameter "
"parsing method. This is not recommended for use in parameter parsing in new "
"code, and most code in the standard interpreter has been modified to no "
"longer use this for that purpose. It does remain a convenient way to "
"decompose other tuples, however, and may continue to be used for that "
"purpose."
msgstr ""
#: c-api/arg.rst:374
msgid ""
"A simpler form of parameter retrieval which does not use a format string to "
"specify the types of the arguments. Functions which use this method to "
"retrieve their parameters should be declared as :const:`METH_VARARGS` in "
"function or method tables. The tuple containing the actual parameters "
"should be passed as *args*; it must actually be a tuple. The length of the "
"tuple must be at least *min* and no more than *max*; *min* and *max* may be "
"equal. Additional arguments must be passed to the function, each of which "
"should be a pointer to a :c:type:`PyObject\\*` variable; these will be "
"filled in with the values from *args*; they will contain borrowed "
"references. The variables which correspond to optional parameters not given "
"by *args* will not be filled in; these should be initialized by the caller. "
"This function returns true on success and false if *args* is not a tuple or "
"contains the wrong number of elements; an exception will be set if there was "
"a failure."
msgstr ""
#: c-api/arg.rst:388
msgid ""
"This is an example of the use of this function, taken from the sources for "
"the :mod:`_weakref` helper module for weak references::"
msgstr ""
#: c-api/arg.rst:404
msgid ""
"The call to :c:func:`PyArg_UnpackTuple` in this example is entirely "
"equivalent to this call to :c:func:`PyArg_ParseTuple`::"
msgstr ""
#: c-api/arg.rst:411
msgid ""
"This function used an :c:type:`int` type for *min* and *max*. This might "
"require changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/arg.rst:418
msgid ""
"Create a new value based on a format string similar to those accepted by "
"the :c:func:`PyArg_Parse\\*` family of functions and a sequence of values. "
"Returns the value or *NULL* in the case of an error; an exception will be "
"raised if *NULL* is returned."
msgstr ""
#: c-api/arg.rst:423
msgid ""
":c:func:`Py_BuildValue` does not always build a tuple. It builds a tuple "
"only if its format string contains two or more format units. If the format "
"string is empty, it returns ``None``; if it contains exactly one format "
"unit, it returns whatever object is described by that format unit. To force "
"it to return a tuple of size 0 or one, parenthesize the format string."
msgstr ""
#: c-api/arg.rst:430
msgid ""
"When memory buffers are passed as parameters to supply data to build "
"objects, as for the ``s`` and ``s#`` formats, the required data is copied. "
"Buffers provided by the caller are never referenced by the objects created "
"by :c:func:`Py_BuildValue`. In other words, if your code invokes :c:func:"
"`malloc` and passes the allocated memory to :c:func:`Py_BuildValue`, your "
"code is responsible for calling :c:func:`free` for that memory once :c:func:"
"`Py_BuildValue` returns."
msgstr ""
#: c-api/arg.rst:438
msgid ""
"In the following description, the quoted form is the format unit; the entry "
"in (round) parentheses is the Python object type that the format unit will "
"return; and the entry in [square] brackets is the type of the C value(s) to "
"be passed."
msgstr ""
#: c-api/arg.rst:443
msgid ""
"The characters space, tab, colon and comma are ignored in format strings "
"(but not within format units such as ``s#``). This can be used to make long "
"format strings a tad more readable."
msgstr ""
#: c-api/arg.rst:449
msgid "s (string) [char *]"
msgstr ""
#: c-api/arg.rst:448
msgid ""
"Convert a null-terminated C string to a Python object. If the C string "
"pointer is *NULL*, ``None`` is used."
msgstr ""
#: c-api/arg.rst:453
msgid "s# (string) [char *, int]"
msgstr ""
#: c-api/arg.rst:452
msgid ""
"Convert a C string and its length to a Python object. If the C string "
"pointer is *NULL*, the length is ignored and ``None`` is returned."
msgstr ""
#: c-api/arg.rst:456
msgid "z (string or None) [char *]"
msgstr ""
#: c-api/arg.rst:456
msgid "Same as ``s``."
msgstr ""
#: c-api/arg.rst:459
msgid "z# (string or None) [char *, int]"
msgstr ""
#: c-api/arg.rst:459
msgid "Same as ``s#``."
msgstr ""
#: c-api/arg.rst:464
msgid "u (Unicode string) [Py_UNICODE *]"
msgstr ""
#: c-api/arg.rst:462
msgid ""
"Convert a null-terminated buffer of Unicode (UCS-2 or UCS-4) data to a "
"Python Unicode object. If the Unicode buffer pointer is *NULL*, ``None`` is "
"returned."
msgstr ""
#: c-api/arg.rst:469
msgid "u# (Unicode string) [Py_UNICODE *, int]"
msgstr ""
#: c-api/arg.rst:467
msgid ""
"Convert a Unicode (UCS-2 or UCS-4) data buffer and its length to a Python "
"Unicode object. If the Unicode buffer pointer is *NULL*, the length is "
"ignored and ``None`` is returned."
msgstr ""
#: c-api/arg.rst:472
msgid "Convert a plain C :c:type:`int` to a Python integer object."
msgstr ""
#: c-api/arg.rst:475
msgid "b (integer) [char]"
msgstr ""
#: c-api/arg.rst:475
msgid "Convert a plain C :c:type:`char` to a Python integer object."
msgstr ""
#: c-api/arg.rst:478
msgid "Convert a plain C :c:type:`short int` to a Python integer object."
msgstr ""
#: c-api/arg.rst:481
#, fuzzy
msgid "Convert a C :c:type:`long int` to a Python integer object."
msgstr ""
"Convertit un entier Python en un C :ctype:`unsigned short int`, sans "
"contrôle de débordement."
#: c-api/arg.rst:484
#, fuzzy
msgid "Convert a C :c:type:`unsigned char` to a Python integer object."
msgstr ""
"Convertit un entier Python en un C :ctype:`unsigned short int`, sans "
"contrôle de débordement."
#: c-api/arg.rst:487
#, fuzzy
msgid "Convert a C :c:type:`unsigned short int` to a Python integer object."
msgstr ""
"Convertit un entier Python en un C :ctype:`unsigned short int`, sans "
"contrôle de débordement."
#: c-api/arg.rst:491
msgid "I (integer/long) [unsigned int]"
msgstr ""
#: c-api/arg.rst:490
msgid ""
"Convert a C :c:type:`unsigned int` to a Python integer object or a Python "
"long integer object, if it is larger than ``sys.maxint``."
msgstr ""
#: c-api/arg.rst:495
msgid "k (integer/long) [unsigned long]"
msgstr ""
#: c-api/arg.rst:494
msgid ""
"Convert a C :c:type:`unsigned long` to a Python integer object or a Python "
"long integer object, if it is larger than ``sys.maxint``."
msgstr ""
#: c-api/arg.rst:499
msgid "L (long) [PY_LONG_LONG]"
msgstr ""
#: c-api/arg.rst:498
#, fuzzy
msgid ""
"Convert a C :c:type:`long long` to a Python long integer object. Only "
"available on platforms that support :c:type:`long long`."
msgstr ""
"Convertit un entier Python en un type C :ctype:`long long`. Ce format est "
"uniquement disponible sur les plates-formes qui prennent en charge :ctype:"
"`long long` (ou :ctype:`_int64` sous Windows)."
#: c-api/arg.rst:503
msgid "K (long) [unsigned PY_LONG_LONG]"
msgstr ""
#: c-api/arg.rst:502
#, fuzzy
msgid ""
"Convert a C :c:type:`unsigned long long` to a Python long integer object. "
"Only available on platforms that support :c:type:`unsigned long long`."
msgstr ""
"Convertit un entier Python en un type C :ctype:`unsigned long long` sans en "
"vérifier le débordement. Ce format est uniquement disponible sur les plates-"
"formes qui prennent en charge :ctype:`unsigned long long` (ou :ctype:"
"`unsigned _int64` sous Windows)."
#: c-api/arg.rst:508
msgid "n (int) [Py_ssize_t]"
msgstr ""
#: c-api/arg.rst:506
#, fuzzy
msgid "Convert a C :c:type:`Py_ssize_t` to a Python integer or long integer."
msgstr "Convertit un entier Python en un type :ctype:`long int`."
#: c-api/arg.rst:511
msgid ""
"Convert a C :c:type:`int` representing a character to a Python string of "
"length 1."
msgstr ""
#: c-api/arg.rst:515
#, fuzzy
msgid "Convert a C :c:type:`double` to a Python floating point number."
msgstr "Convertit un nombre flottant Python vers un type C :ctype:`float`."
#: c-api/arg.rst:518
msgid "Same as ``d``."
msgstr ""
#: c-api/arg.rst:521
msgid "D (complex) [Py_complex *]"
msgstr ""
#: c-api/arg.rst:521
#, fuzzy
msgid "Convert a C :c:type:`Py_complex` structure to a Python complex number."
msgstr ""
"Convertit un nombre complexe Python vers une structure C :ctype:`Py_complex`."
#: c-api/arg.rst:524
msgid ""
"Pass a Python object untouched (except for its reference count, which is "
"incremented by one). If the object passed in is a *NULL* pointer, it is "
"assumed that this was caused because the call producing the argument found "
"an error and set an exception. Therefore, :c:func:`Py_BuildValue` will "
"return *NULL* but won't raise an exception. If no exception has been raised "
"yet, :exc:`SystemError` is set."
msgstr ""
#: c-api/arg.rst:532
msgid "S (object) [PyObject *]"
msgstr "S (object) [PyObject *]"
#: c-api/arg.rst:532
msgid "Same as ``O``."
msgstr ""
#: c-api/arg.rst:537
msgid "N (object) [PyObject *]"
msgstr "N (object) [PyObject *]"
#: c-api/arg.rst:535
msgid ""
"Same as ``O``, except it doesn't increment the reference count on the "
"object. Useful when the object is created by a call to an object "
"constructor in the argument list."
msgstr ""
#: c-api/arg.rst:540
msgid ""
"Convert *anything* to a Python object through a *converter* function. The "
"function is called with *anything* (which should be compatible with :c:type:"
"`void \\*`) as its argument and should return a \"new\" Python object, or "
"*NULL* if an error occurred."
msgstr ""
#: c-api/arg.rst:546
msgid ""
"Convert a sequence of C values to a Python tuple with the same number of "
"items."
msgstr ""
#: c-api/arg.rst:551
msgid "[items] (list) [matching-items]"
msgstr ""
#: c-api/arg.rst:550
msgid ""
"Convert a sequence of C values to a Python list with the same number of "
"items."
msgstr ""
#: c-api/arg.rst:556
msgid "{items} (dictionary) [matching-items]"
msgstr ""
#: c-api/arg.rst:554
msgid ""
"Convert a sequence of C values to a Python dictionary. Each pair of "
"consecutive C values adds one item to the dictionary, serving as key and "
"value, respectively."
msgstr ""
#: c-api/arg.rst:558
msgid ""
"If there is an error in the format string, the :exc:`SystemError` exception "
"is set and *NULL* returned."
msgstr ""
#: c-api/arg.rst:563
msgid ""
"Identical to :c:func:`Py_BuildValue`, except that it accepts a va_list "
"rather than a variable number of arguments."
msgstr ""
#: c-api/bool.rst:6
msgid "Boolean Objects"
msgstr "Les objets booléens"
#: c-api/bool.rst:8
msgid ""
"Booleans in Python are implemented as a subclass of integers. There are "
"only two booleans, :const:`Py_False` and :const:`Py_True`. As such, the "
"normal creation and deletion functions don't apply to booleans. The "
"following macros are available, however."
msgstr ""
"Les booléens en Python sont implémentés comme une classe dérivée des "
"entiers. Il y a seulement deux booléens, :const:`Py_False` et :const:"
"`Py_True`. Comme tel, les fonctions de création de suppression ne "
"s'appliquent pas aux booléens. Toutefois, les macros suivantes sont "
"disponibles."
#: c-api/bool.rst:16
msgid "Return true if *o* is of type :c:data:`PyBool_Type`."
msgstr ""
#: c-api/bool.rst:23
msgid ""
"The Python ``False`` object. This object has no methods. It needs to be "
"treated just like any other object with respect to reference counts."
msgstr ""
#: c-api/bool.rst:29
msgid ""
"The Python ``True`` object. This object has no methods. It needs to be "
"treated just like any other object with respect to reference counts."
msgstr ""
#: c-api/bool.rst:35
msgid ""
"Return :const:`Py_False` from a function, properly incrementing its "
"reference count."
msgstr ""
#: c-api/bool.rst:43
msgid ""
"Return :const:`Py_True` from a function, properly incrementing its reference "
"count."
msgstr ""
#: c-api/bool.rst:51
msgid ""
"Return a new reference to :const:`Py_True` or :const:`Py_False` depending on "
"the truth value of *v*."
msgstr ""
#: c-api/buffer.rst:6
#, fuzzy
msgid "Buffers and Memoryview Objects"
msgstr "Objets de type MemoryView"
#: c-api/buffer.rst:16
#, fuzzy
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."
#: c-api/buffer.rst:22
#, fuzzy
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."
#: c-api/buffer.rst:29
#, fuzzy
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 :cfunc:`PyArg_ParseTuple` qui contredisent "
"l'interface tampon de l'objet, en retournant les données de l'objet cible."
#: 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 ""
#: 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 ""
#: c-api/buffer.rst:49
msgid "The new-style Py_buffer struct"
msgstr ""
#: c-api/buffer.rst:56
msgid "A pointer to the start of the memory for the object."
msgstr ""
#: c-api/buffer.rst:61
msgid "The total length of the memory in bytes."
msgstr ""
#: c-api/buffer.rst:65
msgid "An indicator of whether the buffer is read only."
msgstr ""
#: 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 ""
#: 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 ""
#: 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 ""
#: 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 ""
#: 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 ""
#: 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 ""
#: 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 ""
#: 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 ""
#: 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 ""
#: c-api/buffer.rst:141
msgid "Buffer related functions"
msgstr "Fonctions relatives aux tampons"
#: c-api/buffer.rst:146
msgid "Return 1 if *obj* supports the buffer interface otherwise 0."
msgstr ""
#: 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 ""
#: 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 ""
#: c-api/buffer.rst:167
msgid "0 is returned on success and -1 on error."
msgstr ""
#: c-api/buffer.rst:169
msgid "The following table gives possible values to the *flags* arguments."
msgstr ""
#: c-api/buffer.rst:172
msgid "Flag"
msgstr ""
#: c-api/buffer.rst:172
msgid "Description"
msgstr "Description"
#: c-api/buffer.rst:174
msgid ":c:macro:`PyBUF_SIMPLE`"
msgstr ""
#: 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 ""
#: c-api/buffer.rst:183
msgid ":c:macro:`PyBUF_WRITABLE`"
msgstr ""
#: c-api/buffer.rst:183
msgid ""
"The returned buffer must be writable. If it is not writable, then raise an "
"error."
msgstr ""
#: c-api/buffer.rst:186
msgid ":c:macro:`PyBUF_STRIDES`"
msgstr ""
#: 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 ""
#: c-api/buffer.rst:196
msgid ":c:macro:`PyBUF_ND`"
msgstr ""
#: 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 ""
#: c-api/buffer.rst:206
msgid ""
":c:macro:`PyBUF_C_CONTIGUOUS` :c:macro:`PyBUF_F_CONTIGUOUS` :c:macro:"
"`PyBUF_ANY_CONTIGUOUS`"
msgstr ""
#: 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 ""
#: c-api/buffer.rst:216
msgid ":c:macro:`PyBUF_INDIRECT`"
msgstr ""
#: 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 ""
#: c-api/buffer.rst:226
msgid ":c:macro:`PyBUF_FORMAT`"
msgstr ""
#: 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 ""
#: c-api/buffer.rst:236
msgid ":c:macro:`PyBUF_STRIDED`"
msgstr ""
#: c-api/buffer.rst:236
msgid "This is equivalent to ``(PyBUF_STRIDES | PyBUF_WRITABLE)``."
msgstr ""
#: c-api/buffer.rst:239
msgid ":c:macro:`PyBUF_STRIDED_RO`"
msgstr ""
#: c-api/buffer.rst:239
msgid "This is equivalent to ``(PyBUF_STRIDES)``."
msgstr ""
#: c-api/buffer.rst:242
msgid ":c:macro:`PyBUF_RECORDS`"
msgstr ""
#: c-api/buffer.rst:242
msgid ""
"This is equivalent to ``(PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)``."
msgstr ""
#: c-api/buffer.rst:245
msgid ":c:macro:`PyBUF_RECORDS_RO`"
msgstr ""
#: c-api/buffer.rst:245
msgid "This is equivalent to ``(PyBUF_STRIDES | PyBUF_FORMAT)``."
msgstr ""
#: c-api/buffer.rst:248
msgid ":c:macro:`PyBUF_FULL`"
msgstr ""
#: c-api/buffer.rst:248
msgid ""
"This is equivalent to ``(PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)``."
msgstr ""
#: c-api/buffer.rst:251
msgid ":c:macro:`PyBUF_FULL_RO`"
msgstr ""
#: c-api/buffer.rst:251
msgid "This is equivalent to ``(PyBUF_INDIRECT | PyBUF_FORMAT)``."
msgstr ""
#: c-api/buffer.rst:254
msgid ":c:macro:`PyBUF_CONTIG`"
msgstr ""
#: c-api/buffer.rst:254
msgid "This is equivalent to ``(PyBUF_ND | PyBUF_WRITABLE)``."
msgstr ""
#: c-api/buffer.rst:257
msgid ":c:macro:`PyBUF_CONTIG_RO`"
msgstr ""
#: c-api/buffer.rst:257
msgid "This is equivalent to ``(PyBUF_ND)``."
msgstr ""
#: 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 ""
#: c-api/buffer.rst:270
msgid ""
"Return the implied :c:data:`~Py_buffer.itemsize` from the struct-stype :c:"
"data:`~Py_buffer.format`."
msgstr ""
#: 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 ""
#: 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 ""
#: 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 ""
#: c-api/buffer.rst:296
msgid "MemoryView objects"
msgstr "Objets de type MemoryView"
#: c-api/buffer.rst:300
#, fuzzy
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 "Un objet MemoryView expose l'interface tampon au niveau C à Python."
#: c-api/buffer.rst:305
#, fuzzy
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."
#: 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 ""
#: 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 ""
#: 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 ""
#: 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 ""
#: c-api/buffer.rst:340
#, fuzzy
msgid "Old-style buffer objects"
msgstr "Autres objets"
#: c-api/buffer.rst:344
#, fuzzy
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 :ctype:"
"`PyBufferProcs`."
#: 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 ""
#: c-api/buffer.rst:354
#, fuzzy
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 ""
"Les objets tampons sont utiles pour exposer les données d'une autre "
"interface d'un objet tampon au développeur Python. Ils peuvent aussi être "
"utilisés 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 "
"n'importe quelle donnée au développeur Python assez simplement. La mémoire "
"peut ainsi être un tableau constant de grande taille d'une extension en C, "
"elle peut être un bloc mémoire destiné à être modifié avant de le passer à "
"une librairie système, ou encore elle peut permettre de faire passer des "
"données structurées dans leur format originel en mémoire."
#: c-api/buffer.rst:366
msgid "This subtype of :c:type:`PyObject` represents a buffer object."
msgstr ""
#: 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 ""
#: 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 ""
#: c-api/buffer.rst:390
msgid "Return true if the argument has type :c:data:`PyBuffer_Type`."
msgstr ""
#: 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 ""
#: c-api/buffer.rst:404 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 ""
#: 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 ""
#: 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 ""
#: c-api/buffer.rst:438
msgid ""
"Similar to :c:func:`PyBuffer_FromMemory`, but the returned buffer is "
"writable."
msgstr ""
#: 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 ""
#: c-api/bytearray.rst:6
msgid "Byte Array Objects"
msgstr "Objets Tableau d'Octets"
#: c-api/bytearray.rst:15
msgid ""
"This subtype of :c:type:`PyObject` represents a Python bytearray object."
msgstr ""
#: c-api/bytearray.rst:20
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python bytearray "
"type; it is the same object as ``bytearray`` in the Python layer."
msgstr ""
#: c-api/bytearray.rst:24
msgid "Type check macros"
msgstr "Macros de vérification de type"
#: c-api/bytearray.rst:28
msgid ""
"Return true if the object *o* is a bytearray object or an instance of a "
"subtype of the bytearray type."
msgstr ""
#: c-api/bytearray.rst:34
msgid ""
"Return true if the object *o* is a bytearray object, but not an instance of "
"a subtype of the bytearray type."
msgstr ""
#: c-api/bytearray.rst:39
msgid "Direct API functions"
msgstr "Fonctions directes sur l'API"
#: c-api/bytearray.rst:43
msgid ""
"Return a new bytearray object from any object, *o*, that implements the "
"buffer protocol."
msgstr ""
#: c-api/bytearray.rst:51
msgid ""
"Create a new bytearray object from *string* and its length, *len*. On "
"failure, *NULL* is returned."
msgstr ""
#: c-api/bytearray.rst:57
msgid ""
"Concat bytearrays *a* and *b* and return a new bytearray with the result."
msgstr ""
#: c-api/bytearray.rst:62
msgid "Return the size of *bytearray* after checking for a *NULL* pointer."
msgstr ""
#: c-api/bytearray.rst:67
msgid ""
"Return the contents of *bytearray* as a char array after checking for a "
"*NULL* pointer."
msgstr ""
#: c-api/bytearray.rst:73
msgid "Resize the internal buffer of *bytearray* to *len*."
msgstr ""
#: c-api/bytearray.rst:76
msgid "Macros"
msgstr "Macros"
#: c-api/bytearray.rst:78
msgid "These macros trade safety for speed and they don't check pointers."
msgstr ""
"Ces macros sont taillées pour la vitesse d'exécution et ne vérifient pas les "
"pointeurs."
#: c-api/bytearray.rst:82
msgid "Macro version of :c:func:`PyByteArray_AsString`."
msgstr ""
#: c-api/bytearray.rst:87
msgid "Macro version of :c:func:`PyByteArray_Size`."
msgstr ""
#: c-api/capsule.rst:6
msgid "Capsules"
msgstr "Capsules"
#: c-api/capsule.rst:10
msgid ""
"Refer to :ref:`using-capsules` for more information on using these objects."
msgstr ""
"Reportez-vous à :ref:`using-capsules` pour plus d'informations sur "
"l'utilisation de ces objets."
#: c-api/capsule.rst:15 c-api/cobject.rst:18
msgid ""
"This subtype of :c:type:`PyObject` represents an opaque value, useful for C "
"extension modules who need to pass an opaque value (as a :c:type:`void\\*` "
"pointer) through Python code to other C code. It is often used to make a C "
"function pointer defined in one module available to other modules, so the "
"regular import mechanism can be used to access C APIs defined in dynamically "
"loaded modules."
msgstr ""
#: c-api/capsule.rst:24
msgid "The type of a destructor callback for a capsule. Defined as::"
msgstr ""
#: c-api/capsule.rst:28
msgid ""
"See :c:func:`PyCapsule_New` for the semantics of PyCapsule_Destructor "
"callbacks."
msgstr ""
#: c-api/capsule.rst:34
msgid "Return true if its argument is a :c:type:`PyCapsule`."
msgstr ""
#: c-api/capsule.rst:39
msgid ""
"Create a :c:type:`PyCapsule` encapsulating the *pointer*. The *pointer* "
"argument may not be *NULL*."
msgstr ""
#: c-api/capsule.rst:42
msgid "On failure, set an exception and return *NULL*."
msgstr ""
#: c-api/capsule.rst:44
msgid ""
"The *name* string may either be *NULL* or a pointer to a valid C string. If "
"non-*NULL*, this string must outlive the capsule. (Though it is permitted "
"to free it inside the *destructor*.)"
msgstr ""
#: c-api/capsule.rst:48
msgid ""
"If the *destructor* argument is not *NULL*, it will be called with the "
"capsule as its argument when it is destroyed."
msgstr ""
#: c-api/capsule.rst:51
msgid ""
"If this capsule will be stored as an attribute of a module, the *name* "
"should be specified as ``modulename.attributename``. This will enable other "
"modules to import the capsule using :c:func:`PyCapsule_Import`."
msgstr ""
#: c-api/capsule.rst:58
msgid ""
"Retrieve the *pointer* stored in the capsule. On failure, set an exception "
"and return *NULL*."
msgstr ""
#: c-api/capsule.rst:61
msgid ""
"The *name* parameter must compare exactly to the name stored in the capsule. "
"If the name stored in the capsule is *NULL*, the *name* passed in must also "
"be *NULL*. Python uses the C function :c:func:`strcmp` to compare capsule "
"names."
msgstr ""
#: c-api/capsule.rst:69
msgid ""
"Return the current destructor stored in the capsule. On failure, set an "
"exception and return *NULL*."
msgstr ""
#: c-api/capsule.rst:72
msgid ""
"It is legal for a capsule to have a *NULL* destructor. This makes a *NULL* "
"return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :c:func:"
"`PyErr_Occurred` to disambiguate."
msgstr ""
#: c-api/capsule.rst:79
msgid ""
"Return the current context stored in the capsule. On failure, set an "
"exception and return *NULL*."
msgstr ""
#: c-api/capsule.rst:82
msgid ""
"It is legal for a capsule to have a *NULL* context. This makes a *NULL* "
"return code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :c:func:"
"`PyErr_Occurred` to disambiguate."
msgstr ""
#: c-api/capsule.rst:89
msgid ""
"Return the current name stored in the capsule. On failure, set an exception "
"and return *NULL*."
msgstr ""
#: c-api/capsule.rst:92
msgid ""
"It is legal for a capsule to have a *NULL* name. This makes a *NULL* return "
"code somewhat ambiguous; use :c:func:`PyCapsule_IsValid` or :c:func:"
"`PyErr_Occurred` to disambiguate."
msgstr ""
#: c-api/capsule.rst:99
msgid ""
"Import a pointer to a C object from a capsule attribute in a module. The "
"*name* parameter should specify the full name to the attribute, as in "
"``module.attribute``. The *name* stored in the capsule must match this "
"string exactly. If *no_block* is true, import the module without blocking "
"(using :c:func:`PyImport_ImportModuleNoBlock`). If *no_block* is false, "
"import the module conventionally (using :c:func:`PyImport_ImportModule`)."
msgstr ""
#: c-api/capsule.rst:106
msgid ""
"Return the capsule's internal *pointer* on success. On failure, set an "
"exception and return *NULL*. However, if :c:func:`PyCapsule_Import` failed "
"to import the module, and *no_block* was true, no exception is set."
msgstr ""
#: c-api/capsule.rst:112
msgid ""
"Determines whether or not *capsule* is a valid capsule. A valid capsule is "
"non-*NULL*, passes :c:func:`PyCapsule_CheckExact`, has a non-*NULL* pointer "
"stored in it, and its internal name matches the *name* parameter. (See :c:"
"func:`PyCapsule_GetPointer` for information on how capsule names are "
"compared.)"
msgstr ""
#: c-api/capsule.rst:118
msgid ""
"In other words, if :c:func:`PyCapsule_IsValid` returns a true value, calls "
"to any of the accessors (any function starting with :c:func:`PyCapsule_Get`) "
"are guaranteed to succeed."
msgstr ""
#: c-api/capsule.rst:122
msgid ""
"Return a nonzero value if the object is valid and matches the name passed "
"in. Return 0 otherwise. This function will not fail."
msgstr ""
#: c-api/capsule.rst:127
msgid "Set the context pointer inside *capsule* to *context*."
msgstr ""
#: c-api/capsule.rst:129 c-api/capsule.rst:135 c-api/capsule.rst:143
#: c-api/capsule.rst:150
msgid "Return 0 on success. Return nonzero and set an exception on failure."
msgstr ""
#: c-api/capsule.rst:133
msgid "Set the destructor inside *capsule* to *destructor*."
msgstr ""
#: c-api/capsule.rst:139
msgid ""
"Set the name inside *capsule* to *name*. If non-*NULL*, the name must "
"outlive the capsule. If the previous *name* stored in the capsule was not "
"*NULL*, no attempt is made to free it."
msgstr ""
#: c-api/capsule.rst:147
msgid ""
"Set the void pointer inside *capsule* to *pointer*. The pointer may not be "
"*NULL*."
msgstr ""
#: c-api/cell.rst:6
msgid "Cell Objects"
msgstr "Objets Cellules"
#: c-api/cell.rst:8
msgid ""
"\"Cell\" objects are used to implement variables referenced by multiple "
"scopes. For each such variable, a cell object is created to store the value; "
"the local variables of each stack frame that references the value contains a "
"reference to the cells from outer scopes which also use that variable. When "
"the value is accessed, the value contained in the cell is used instead of "
"the cell object itself. This de-referencing of the cell object requires "
"support from the generated byte-code; these are not automatically de-"
"referenced when accessed. Cell objects are not likely to be useful elsewhere."
msgstr ""
"Les objets \"Cellules\" sont utilisés pour implémenter des variables "
"référencées dans de multiples enviromments. Pour chacune de ces variables, "
"un objet cellule est créé pour stocker sa valeur ; les variables locales de "
"chaque pile d'exécution qui référence cette valeur contiennent une référence "
"sur les cellules des autres environnements qui utilisent aussi cette "
"variable. Quand la valeur est accédée, la valeur de la cellule est utilisée, "
"au lei de celle de l'objet cellule proprement dit. Ce dé-référencement de "
"l'objet cellule requiert l'intervention du bytecode généré ; il n'est pas "
"automatiquement dé-référencé quand il est accédé. Il est plausible que les "
"objets cellules ne soit utilisés ailleurs."
#: c-api/cell.rst:20
msgid "The C structure used for cell objects."
msgstr ""
#: c-api/cell.rst:25
msgid "The type object corresponding to cell objects."
msgstr ""
#: c-api/cell.rst:30
msgid "Return true if *ob* is a cell object; *ob* must not be *NULL*."
msgstr ""
#: c-api/cell.rst:35
msgid ""
"Create and return a new cell object containing the value *ob*. The parameter "
"may be *NULL*."
msgstr ""
#: c-api/cell.rst:41
msgid "Return the contents of the cell *cell*."
msgstr ""
#: c-api/cell.rst:46
msgid ""
"Return the contents of the cell *cell*, but without checking that *cell* is "
"non-*NULL* and a cell object."
msgstr ""
#: c-api/cell.rst:52
msgid ""
"Set the contents of the cell object *cell* to *value*. This releases the "
"reference to any current content of the cell. *value* may be *NULL*. *cell* "
"must be non-*NULL*; if it is not a cell object, ``-1`` will be returned. On "
"success, ``0`` will be returned."
msgstr ""
#: c-api/cell.rst:60
msgid ""
"Sets the value of the cell object *cell* to *value*. No reference counts "
"are adjusted, and no checks are made for safety; *cell* must be non-*NULL* "
"and must be a cell object."
msgstr ""
#: c-api/class.rst:6
msgid "Class and Instance Objects"
msgstr ""
#: c-api/class.rst:10
msgid ""
"Note that the class objects described here represent old-style classes, "
"which will go away in Python 3. When creating new types for extension "
"modules, you will want to work with type objects (section :ref:"
"`typeobjects`)."
msgstr ""
#: c-api/class.rst:17
msgid "The C structure of the objects used to describe built-in classes."
msgstr ""
#: c-api/class.rst:24
msgid ""
"This is the type object for class objects; it is the same object as ``types."
"ClassType`` in the Python layer."
msgstr ""
#: c-api/class.rst:30
msgid ""
"Return true if the object *o* is a class object, including instances of "
"types derived from the standard class object. Return false in all other "
"cases."
msgstr ""
#: c-api/class.rst:36
msgid ""
"Return true if *klass* is a subclass of *base*. Return false in all other "
"cases."
msgstr ""
#: c-api/class.rst:41
msgid "There are very few functions specific to instance objects."
msgstr ""
#: c-api/class.rst:46
msgid "Type object for class instances."
msgstr ""
#: c-api/class.rst:51
msgid "Return true if *obj* is an instance."
msgstr ""
#: c-api/class.rst:56
msgid ""
"Create a new instance of a specific class. The parameters *arg* and *kw* "
"are used as the positional and keyword parameters to the object's "
"constructor."
msgstr ""
#: c-api/class.rst:62
msgid ""
"Create a new instance of a specific class without calling its constructor. "
"*class* is the class of new object. The *dict* parameter will be used as "
"the object's :attr:`__dict__`; if *NULL*, a new dictionary will be created "
"for the instance."
msgstr ""
#: c-api/cobject.rst:6
#, fuzzy
msgid "CObjects"
msgstr "Objets Cellules"
#: c-api/cobject.rst:13
msgid ""
"The CObject API is deprecated as of Python 2.7. Please switch to the new :"
"ref:`capsules` API."
msgstr ""
#: c-api/cobject.rst:28
msgid "Return true if its argument is a :c:type:`PyCObject`."
msgstr ""
#: c-api/cobject.rst:33
msgid ""
"Create a :c:type:`PyCObject` from the ``void *`` *cobj*. The *destr* "
"function will be called when the object is reclaimed, unless it is *NULL*."
msgstr ""
#: c-api/cobject.rst:39
msgid ""
"Create a :c:type:`PyCObject` from the :c:type:`void \\*` *cobj*. The "
"*destr* function will be called when the object is reclaimed. The *desc* "
"argument can be used to pass extra callback data for the destructor function."
msgstr ""
#: c-api/cobject.rst:46
msgid ""
"Return the object :c:type:`void \\*` that the :c:type:`PyCObject` *self* was "
"created with."
msgstr ""
#: c-api/cobject.rst:52
msgid ""
"Return the description :c:type:`void \\*` that the :c:type:`PyCObject` "
"*self* was created with."
msgstr ""
#: c-api/cobject.rst:58
msgid ""
"Set the void pointer inside *self* to *cobj*. The :c:type:`PyCObject` must "
"not have an associated destructor. Return true on success, false on failure."
msgstr ""
#: c-api/code.rst:6
msgid "Code Objects"
msgstr "Objets Code"
#: c-api/code.rst:14
msgid ""
"Code objects are a low-level detail of the CPython implementation. Each one "
"represents a chunk of executable code that hasn't yet been bound into a "
"function."
msgstr ""
"Les objets Code sont un détail bas-niveau de l'implémentation CPython. "
"Chacun d'eux représente une partie de code exécutable, qui n'a pas encore "
"été lié dans une fonction."
#: c-api/code.rst:20
msgid ""
"The C structure of the objects used to describe code objects. The fields of "
"this type are subject to change at any time."
msgstr ""
#: c-api/code.rst:26
msgid ""
"This is an instance of :c:type:`PyTypeObject` representing the Python :class:"
"`code` type."
msgstr ""
#: c-api/code.rst:32
#, fuzzy
msgid "Return true if *co* is a :class:`code` object."
msgstr "Convertit un nombre flottant Python vers un type C :ctype:`double`."
#: c-api/code.rst:36
msgid "Return the number of free variables in *co*."
msgstr ""
#: c-api/code.rst:40
msgid ""
"Return a new code object. If you need a dummy code object to create a "
"frame, use :c:func:`PyCode_NewEmpty` instead. Calling :c:func:`PyCode_New` "
"directly can bind you to a precise Python version since the definition of "
"the bytecode changes often."
msgstr ""
#: c-api/code.rst:48
msgid ""
"Return a new empty code object with the specified filename, function name, "
"and first line number. It is illegal to :keyword:`exec` or :func:`eval` the "
"resulting code object."
msgstr ""
#: c-api/codec.rst:4
msgid "Codec registry and support functions"
msgstr ""
#: c-api/codec.rst:8
msgid "Register a new codec search function."
msgstr ""
#: c-api/codec.rst:10
msgid ""
"As side effect, this tries to load the :mod:`encodings` package, if not yet "
"done, to make sure that it is always first in the list of search functions."
msgstr ""
#: c-api/codec.rst:15
msgid ""
"Return ``1`` or ``0`` depending on whether there is a registered codec for "
"the given *encoding*."
msgstr ""
#: c-api/codec.rst:20
msgid "Generic codec based encoding API."
msgstr ""
#: c-api/codec.rst:22
msgid ""
"*object* is passed through the encoder function found for the given "
"*encoding* using the error handling method defined by *errors*. *errors* "
"may be *NULL* to use the default method defined for the codec. Raises a :"
"exc:`LookupError` if no encoder can be found."
msgstr ""
#: c-api/codec.rst:29
msgid "Generic codec based decoding API."
msgstr ""
#: c-api/codec.rst:31
msgid ""
"*object* is passed through the decoder function found for the given "
"*encoding* using the error handling method defined by *errors*. *errors* "
"may be *NULL* to use the default method defined for the codec. Raises a :"
"exc:`LookupError` if no encoder can be found."
msgstr ""
#: c-api/codec.rst:38
msgid "Codec lookup API"
msgstr ""
#: c-api/codec.rst:40
msgid ""
"In the following functions, the *encoding* string is looked up converted to "
"all lower-case characters, which makes encodings looked up through this "
"mechanism effectively case-insensitive. If no codec is found, a :exc:"
"`KeyError` is set and *NULL* returned."
msgstr ""
#: c-api/codec.rst:47
msgid "Get an encoder function for the given *encoding*."
msgstr ""
#: c-api/codec.rst:51
msgid "Get a decoder function for the given *encoding*."
msgstr ""
#: c-api/codec.rst:55
msgid ""
"Get an :class:`~codecs.IncrementalEncoder` object for the given *encoding*."
msgstr ""
#: c-api/codec.rst:59
msgid ""
"Get an :class:`~codecs.IncrementalDecoder` object for the given *encoding*."
msgstr ""
#: c-api/codec.rst:63
msgid ""
"Get a :class:`~codecs.StreamReader` factory function for the given "
"*encoding*."
msgstr ""
#: c-api/codec.rst:67
msgid ""
"Get a :class:`~codecs.StreamWriter` factory function for the given "
"*encoding*."
msgstr ""
#: c-api/codec.rst:71
msgid "Registry API for Unicode encoding error handlers"
msgstr ""
#: c-api/codec.rst:75
msgid ""
"Register the error handling callback function *error* under the given "
"*name*. This callback function will be called by a codec when it encounters "
"unencodable characters/undecodable bytes and *name* is specified as the "
"error parameter in the call to the encode/decode function."
msgstr ""
#: c-api/codec.rst:80
msgid ""
"The callback gets a single argument, an instance of :exc:"
"`UnicodeEncodeError`, :exc:`UnicodeDecodeError` or :exc:"
"`UnicodeTranslateError` that holds information about the problematic "
"sequence of characters or bytes and their offset in the original string "
"(see :ref:`unicodeexceptions` for functions to extract this information). "
"The callback must either raise the given exception, or return a two-item "
"tuple containing the replacement for the problematic sequence, and an "
"integer giving the offset in the original string at which encoding/decoding "
"should be resumed."
msgstr ""
#: c-api/codec.rst:90
msgid "Return ``0`` on success, ``-1`` on error."
msgstr ""
#: c-api/codec.rst:94
msgid ""
"Lookup the error handling callback function registered under *name*. As a "
"special case *NULL* can be passed, in which case the error handling callback "
"for \"strict\" will be returned."
msgstr ""
#: c-api/codec.rst:100
msgid "Raise *exc* as an exception."
msgstr ""
#: c-api/codec.rst:104
msgid "Ignore the unicode error, skipping the faulty input."
msgstr ""
#: c-api/codec.rst:108
msgid "Replace the unicode encode error with ``?`` or ``U+FFFD``."
msgstr ""
#: c-api/codec.rst:112
msgid "Replace the unicode encode error with XML character references."
msgstr ""
#: c-api/codec.rst:116
msgid ""
"Replace the unicode encode error with backslash escapes (``\\x``, ``\\u`` "
"and ``\\U``)."
msgstr ""
#: c-api/complex.rst:6
msgid "Complex Number Objects"
msgstr "Objets Nombres Complexes"
#: c-api/complex.rst:10
msgid ""
"Python's complex number objects are implemented as two distinct types when "
"viewed from the C API: one is the Python object exposed to Python programs, "
"and the other is a C structure which represents the actual complex number "
"value. The API provides functions for working with both."
msgstr ""
"Les objets Python nombres complexes sont implémentés comme deux types "
"distincts, lorsqu'ils sont vus de l'API C : l'un est l'objet Python tel "
"qu'il est vu par les programmes Python, et l'autre est une structure C qui "
"représente la valeur complexe courante. L'API fournit des fonctions pour "
"travailler avec ces deux représentations."
#: c-api/complex.rst:17
msgid "Complex Numbers as C Structures"
msgstr "Nombres complexes en tant que structures C"
#: c-api/complex.rst:19
msgid ""
"Note that the functions which accept these structures as parameters and "
"return them as results do so *by value* rather than dereferencing them "
"through pointers. This is consistent throughout the API."
msgstr ""
"Remarquez que les fonctions qui acceptent ces structures comme paramètres et "
"les retournent comme résultats le font *par valeur* au lieur de les dé-"
"référencer en utilisant des pointeurs. Cela est constant dans toute l'API."
#: c-api/complex.rst:26
msgid ""
"The C structure which corresponds to the value portion of a Python complex "
"number object. Most of the functions for dealing with complex number "
"objects use structures of this type as input or output values, as "
"appropriate. It is defined as::"
msgstr ""
#: c-api/complex.rst:39
#, fuzzy
msgid ""
"Return the sum of two complex numbers, using the C :c:type:`Py_complex` "
"representation."
msgstr ""
"Convertit un nombre complexe Python vers une structure C :ctype:`Py_complex`."
#: c-api/complex.rst:45
#, fuzzy
msgid ""
"Return the difference between two complex numbers, using the C :c:type:"
"`Py_complex` representation."
msgstr ""
"Convertit un nombre complexe Python vers une structure C :ctype:`Py_complex`."
#: c-api/complex.rst:51
#, fuzzy
msgid ""
"Return the negation of the complex number *complex*, using the C :c:type:"
"`Py_complex` representation."
msgstr ""
"Convertit un nombre complexe Python vers une structure C :ctype:`Py_complex`."
#: c-api/complex.rst:57
#, fuzzy
msgid ""
"Return the product of two complex numbers, using the C :c:type:`Py_complex` "
"representation."
msgstr ""
"Convertit un nombre complexe Python vers une structure C :ctype:`Py_complex`."
#: c-api/complex.rst:63
#, fuzzy
msgid ""
"Return the quotient of two complex numbers, using the C :c:type:`Py_complex` "
"representation."
msgstr ""
"Convertit un nombre complexe Python vers une structure C :ctype:`Py_complex`."
#: c-api/complex.rst:66
msgid ""
"If *divisor* is null, this method returns zero and sets :c:data:`errno` to :"
"c:data:`EDOM`."
msgstr ""
#: c-api/complex.rst:72
msgid ""
"Return the exponentiation of *num* by *exp*, using the C :c:type:"
"`Py_complex` representation."
msgstr ""
#: c-api/complex.rst:75
msgid ""
"If *num* is null and *exp* is not a positive real number, this method "
"returns zero and sets :c:data:`errno` to :c:data:`EDOM`."
msgstr ""
#: c-api/complex.rst:80
msgid "Complex Numbers as Python Objects"
msgstr "Nombres complexes en tant qu'objets Python"
#: c-api/complex.rst:85
msgid ""
"This subtype of :c:type:`PyObject` represents a Python complex number object."
msgstr ""
#: c-api/complex.rst:90
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python complex number "
"type. It is the same object as ``complex`` and ``types.ComplexType``."
msgstr ""
#: c-api/complex.rst:96
msgid ""
"Return true if its argument is a :c:type:`PyComplexObject` or a subtype of :"
"c:type:`PyComplexObject`."
msgstr ""
#: c-api/complex.rst:99 c-api/dict.rst:32 c-api/file.rst:33 c-api/float.rst:29
#: c-api/int.rst:29 c-api/list.rst:27 c-api/long.rst:29 c-api/module.rst:25
#: c-api/string.rst:38 c-api/tuple.rst:29 c-api/unicode.rst:58
msgid "Allowed subtypes to be accepted."
msgstr ""
#: c-api/complex.rst:105
msgid ""
"Return true if its argument is a :c:type:`PyComplexObject`, but not a "
"subtype of :c:type:`PyComplexObject`."
msgstr ""
#: c-api/complex.rst:113
#, fuzzy
msgid ""
"Create a new Python complex number object from a C :c:type:`Py_complex` "
"value."
msgstr ""
"Convertit un nombre complexe Python vers une structure C :ctype:`Py_complex`."
#: c-api/complex.rst:118
msgid "Return a new :c:type:`PyComplexObject` object from *real* and *imag*."
msgstr ""
#: c-api/complex.rst:123
#, fuzzy
msgid "Return the real part of *op* as a C :c:type:`double`."
msgstr "Convertit un nombre flottant Python vers un type C :ctype:`double`."
#: c-api/complex.rst:128
#, fuzzy
msgid "Return the imaginary part of *op* as a C :c:type:`double`."
msgstr "Convertit un nombre flottant Python vers un type C :ctype:`double`."
#: c-api/complex.rst:133
msgid ""
"Return the :c:type:`Py_complex` value of the complex number *op*. Upon "
"failure, this method returns ``-1.0`` as a real value."
msgstr ""
#: c-api/complex.rst:136
msgid ""
"If *op* is not a Python complex number object but has a :meth:`__complex__` "
"method, this method will first be called to convert *op* to a Python complex "
"number object."
msgstr ""
#: c-api/concrete.rst:8
msgid "Concrete Objects Layer"
msgstr "Couche des Objets Concrets"
#: c-api/concrete.rst:10
#, fuzzy
msgid ""
"The functions in this chapter are specific to certain Python object types. "
"Passing them an object of the wrong type is not a good idea; if you receive "
"an object from a Python program and you are not sure that it has the right "
"type, you must perform a type check first; for example, to check that an "
"object is a dictionary, use :c:func:`PyDict_Check`. The chapter is "
"structured like the \"family tree\" of Python object types."
msgstr ""
"Les fonctions dans ce chapitre sont spécifiques à certains types d'objets "
"Python. Leur donner un objet d'un mauvais type n'est pas une bonne idée. Si "
"vous recevez un objet d'un programme Python et que vous n'êtes pas sûr qu'il "
"est du bon type, vous devez tout d'abord vérifier son type. Par exemple, "
"pour vérifier qu'un objet est un dictionnaire, utiliser :cfunc:"
"`PyDict_Check`. Ce chapitre est structuré comme un \"arbre des familles\" "
"des types d'objets Python."
#: c-api/concrete.rst:19
msgid ""
"While the functions described in this chapter carefully check the type of "
"the objects which are passed in, many of them do not check for *NULL* being "
"passed instead of a valid object. Allowing *NULL* to be passed in can cause "
"memory access violations and immediate termination of the interpreter."
msgstr ""
"Tandis que les fonctions décrites dans ce chapitre vérifient avec soin le "
"type des objets qui leur sont passés, beaucoup d'entre elles ne vérifient "
"pas que *NULL* est passé au lieu d'un objet valide. Autoriser *NULL* à être "
"passé peut provoquer des violations d'accès à la mémoire et ainsi terminer "
"immédiatement l'interpréteur."
#: c-api/concrete.rst:28
msgid "Fundamental Objects"
msgstr "Objets fondamentaux"
#: c-api/concrete.rst:30
msgid ""
"This section describes Python type objects and the singleton object ``None``."
msgstr ""
"Cette section décrit les objets de type Python et l'objet singleton ``None``."
#: c-api/concrete.rst:41
msgid "Numeric Objects"
msgstr "Objets numériques"
#: c-api/concrete.rst:57
msgid "Sequence Objects"
msgstr "Objets séquences"
#: c-api/concrete.rst:61
msgid ""
"Generic operations on sequence objects were discussed in the previous "
"chapter; this section deals with the specific kinds of sequence objects that "
"are intrinsic to the Python language."
msgstr ""
"Les opérations génériques sur les objets séquences ont été discutées dans le "
"chapitre précédent. Cette section traite des genres spécifiques d'objets "
"séquences qui sont intrinsèques au langage Python."
#: c-api/concrete.rst:78
msgid "Mapping Objects"
msgstr "Objets association"
#: c-api/concrete.rst:90
msgid "Other Objects"
msgstr "Autres Objets"
#: c-api/conversion.rst:6
msgid "String conversion and formatting"
msgstr "Conversion et formatage de chaînes"
#: c-api/conversion.rst:8
msgid "Functions for number conversion and formatted string output."
msgstr ""
"Fonctions de conversion pour les nombres et pour la sortie des chaînes "
"formattées."
#: c-api/conversion.rst:13
msgid ""
"Output not more than *size* bytes to *str* according to the format string "
"*format* and the extra arguments. See the Unix man page :manpage:"
"`snprintf(2)`."
msgstr ""
#: c-api/conversion.rst:19
msgid ""
"Output not more than *size* bytes to *str* according to the format string "
"*format* and the variable argument list *va*. Unix man page :manpage:"
"`vsnprintf(2)`."
msgstr ""
#: c-api/conversion.rst:23
msgid ""
":c:func:`PyOS_snprintf` and :c:func:`PyOS_vsnprintf` wrap the Standard C "
"library functions :c:func:`snprintf` and :c:func:`vsnprintf`. Their purpose "
"is to guarantee consistent behavior in corner cases, which the Standard C "
"functions do not."
msgstr ""
#: c-api/conversion.rst:28
msgid ""
"The wrappers ensure that *str*[*size*-1] is always ``'\\0'`` upon return. "
"They never write more than *size* bytes (including the trailing ``'\\0'`` "
"into str. Both functions require that ``str != NULL``, ``size > 0`` and "
"``format != NULL``."
msgstr ""
#: c-api/conversion.rst:33
msgid ""
"If the platform doesn't have :c:func:`vsnprintf` and the buffer size needed "
"to avoid truncation exceeds *size* by more than 512 bytes, Python aborts "
"with a *Py_FatalError*."
msgstr ""
#: c-api/conversion.rst:37
msgid ""
"The return value (*rv*) for these functions should be interpreted as follows:"
msgstr ""
#: c-api/conversion.rst:39
msgid ""
"When ``0 <= rv < size``, the output conversion was successful and *rv* "
"characters were written to *str* (excluding the trailing ``'\\0'`` byte at "
"*str*[*rv*])."
msgstr ""
#: c-api/conversion.rst:43
msgid ""
"When ``rv >= size``, the output conversion was truncated and a buffer with "
"``rv + 1`` bytes would have been needed to succeed. *str*[*size*-1] is "
"``'\\0'`` in this case."
msgstr ""
#: c-api/conversion.rst:47
msgid ""
"When ``rv < 0``, \"something bad happened.\" *str*[*size*-1] is ``'\\0'`` in "
"this case too, but the rest of *str* is undefined. The exact cause of the "
"error depends on the underlying platform."
msgstr ""
#: c-api/conversion.rst:51
msgid ""
"The following functions provide locale-independent string to number "
"conversions."
msgstr ""
#: c-api/conversion.rst:56
msgid ""
"Convert a string ``s`` to a :c:type:`double`, raising a Python exception on "
"failure. The set of accepted strings corresponds to the set of strings "
"accepted by Python's :func:`float` constructor, except that ``s`` must not "
"have leading or trailing whitespace. The conversion is independent of the "
"current locale."
msgstr ""
#: c-api/conversion.rst:62
msgid ""
"If ``endptr`` is ``NULL``, convert the whole string. Raise ValueError and "
"return ``-1.0`` if the string is not a valid representation of a floating-"
"point number."
msgstr ""
#: c-api/conversion.rst:66
msgid ""
"If endptr is not ``NULL``, convert as much of the string as possible and set "
"``*endptr`` to point to the first unconverted character. If no initial "
"segment of the string is the valid representation of a floating-point "
"number, set ``*endptr`` to point to the beginning of the string, raise "
"ValueError, and return ``-1.0``."
msgstr ""
#: c-api/conversion.rst:73
msgid ""
"If ``s`` represents a value that is too large to store in a float (for "
"example, ``\"1e500\"`` is such a string on many platforms) then if "
"``overflow_exception`` is ``NULL`` return ``Py_HUGE_VAL`` (with an "
"appropriate sign) and don't set any exception. Otherwise, "
"``overflow_exception`` must point to a Python exception object; raise that "
"exception and return ``-1.0``. In both cases, set ``*endptr`` to point to "
"the first character after the converted value."
msgstr ""
#: c-api/conversion.rst:81
msgid ""
"If any other error occurs during the conversion (for example an out-of-"
"memory error), set the appropriate Python exception and return ``-1.0``."
msgstr ""
#: c-api/conversion.rst:90
msgid ""
"Convert a string to a :c:type:`double`. This function behaves like the "
"Standard C function :c:func:`strtod` does in the C locale. It does this "
"without changing the current locale, since that would not be thread-safe."
msgstr ""
#: c-api/conversion.rst:94
msgid ""
":c:func:`PyOS_ascii_strtod` should typically be used for reading "
"configuration files or other non-user input that should be locale "
"independent."
msgstr ""
#: c-api/conversion.rst:97
msgid "See the Unix man page :manpage:`strtod(2)` for details."
msgstr ""
#: c-api/conversion.rst:101 c-api/conversion.rst:164
msgid "Use :c:func:`PyOS_string_to_double` instead."
msgstr ""
#: c-api/conversion.rst:108
msgid ""
"Convert a :c:type:`double` to a string using the ``'.'`` as the decimal "
"separator. *format* is a :c:func:`printf`\\ -style format string specifying "
"the number format. Allowed conversion characters are ``'e'``, ``'E'``, "
"``'f'``, ``'F'``, ``'g'`` and ``'G'``."
msgstr ""
#: c-api/conversion.rst:113
msgid ""
"The return value is a pointer to *buffer* with the converted string or NULL "
"if the conversion failed."
msgstr ""
#: c-api/conversion.rst:117
msgid ""
"This function is removed in Python 2.7 and 3.1. Use :func:"
"`PyOS_double_to_string` instead."
msgstr ""
#: c-api/conversion.rst:124
msgid ""
"Convert a :c:type:`double` *val* to a string using supplied *format_code*, "
"*precision*, and *flags*."
msgstr ""
#: c-api/conversion.rst:127
msgid ""
"*format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, "
"``'G'`` or ``'r'``. For ``'r'``, the supplied *precision* must be 0 and is "
"ignored. The ``'r'`` format code specifies the standard :func:`repr` format."
msgstr ""
#: c-api/conversion.rst:132
msgid ""
"*flags* can be zero or more of the values *Py_DTSF_SIGN*, "
"*Py_DTSF_ADD_DOT_0*, or *Py_DTSF_ALT*, or-ed together:"
msgstr ""
#: c-api/conversion.rst:135
msgid ""
"*Py_DTSF_SIGN* means to always precede the returned string with a sign "
"character, even if *val* is non-negative."
msgstr ""
#: c-api/conversion.rst:138
msgid ""
"*Py_DTSF_ADD_DOT_0* means to ensure that the returned string will not look "
"like an integer."
msgstr ""
#: c-api/conversion.rst:141
msgid ""
"*Py_DTSF_ALT* means to apply \"alternate\" formatting rules. See the "
"documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for details."
msgstr ""
#: c-api/conversion.rst:145
msgid ""
"If *ptype* is non-NULL, then the value it points to will be set to one of "
"*Py_DTST_FINITE*, *Py_DTST_INFINITE*, or *Py_DTST_NAN*, signifying that "
"*val* is a finite number, an infinite number, or not a number, respectively."
msgstr ""
#: c-api/conversion.rst:149
msgid ""
"The return value is a pointer to *buffer* with the converted string or "
"*NULL* if the conversion failed. The caller is responsible for freeing the "
"returned string by calling :c:func:`PyMem_Free`."
msgstr ""
#: c-api/conversion.rst:158
msgid "Convert a string to a :c:type:`double` in a locale-independent way."
msgstr ""
#: c-api/conversion.rst:160
msgid "See the Unix man page :manpage:`atof(2)` for details."
msgstr ""
#: c-api/conversion.rst:170
msgid ""
"Case insensitive comparison of strings. The function works almost "
"identically to :c:func:`strcmp` except that it ignores the case."
msgstr ""
#: c-api/conversion.rst:178
msgid ""
"Case insensitive comparison of strings. The function works almost "
"identically to :c:func:`strncmp` except that it ignores the case."
msgstr ""
#: c-api/datetime.rst:6
msgid "DateTime Objects"
msgstr "Objets DateTime"
#: c-api/datetime.rst:8
msgid ""
"Various date and time objects are supplied by the :mod:`datetime` module. "
"Before using any of these functions, the header file :file:`datetime.h` must "
"be included in your source (note that this is not included by :file:`Python."
"h`), and the macro :c:macro:`PyDateTime_IMPORT` must be invoked, usually as "
"part of the module initialisation function. The macro puts a pointer to a C "
"structure into a static variable, :c:data:`PyDateTimeAPI`, that is used by "
"the following macros."
msgstr ""
#: c-api/datetime.rst:16
msgid "Type-check macros:"
msgstr ""
#: c-api/datetime.rst:21
msgid ""
"Return true if *ob* is of type :c:data:`PyDateTime_DateType` or a subtype "
"of :c:data:`PyDateTime_DateType`. *ob* must not be *NULL*."
msgstr ""
#: c-api/datetime.rst:29
msgid ""
"Return true if *ob* is of type :c:data:`PyDateTime_DateType`. *ob* must not "
"be *NULL*."
msgstr ""
#: c-api/datetime.rst:37
msgid ""
"Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType` or a "
"subtype of :c:data:`PyDateTime_DateTimeType`. *ob* must not be *NULL*."
msgstr ""
#: c-api/datetime.rst:45
msgid ""
"Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType`. *ob* must "
"not be *NULL*."
msgstr ""
#: c-api/datetime.rst:53
msgid ""
"Return true if *ob* is of type :c:data:`PyDateTime_TimeType` or a subtype "
"of :c:data:`PyDateTime_TimeType`. *ob* must not be *NULL*."
msgstr ""
#: c-api/datetime.rst:61
msgid ""
"Return true if *ob* is of type :c:data:`PyDateTime_TimeType`. *ob* must not "
"be *NULL*."
msgstr ""
#: c-api/datetime.rst:69
msgid ""
"Return true if *ob* is of type :c:data:`PyDateTime_DeltaType` or a subtype "
"of :c:data:`PyDateTime_DeltaType`. *ob* must not be *NULL*."
msgstr ""
#: c-api/datetime.rst:77
msgid ""
"Return true if *ob* is of type :c:data:`PyDateTime_DeltaType`. *ob* must not "
"be *NULL*."
msgstr ""
#: c-api/datetime.rst:85
msgid ""
"Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType` or a subtype "
"of :c:data:`PyDateTime_TZInfoType`. *ob* must not be *NULL*."
msgstr ""
#: c-api/datetime.rst:93
msgid ""
"Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType`. *ob* must "
"not be *NULL*."
msgstr ""
#: c-api/datetime.rst:98
msgid "Macros to create objects:"
msgstr ""
#: c-api/datetime.rst:103
msgid ""
"Return a ``datetime.date`` object with the specified year, month and day."
msgstr ""
#: c-api/datetime.rst:110
msgid ""
"Return a ``datetime.datetime`` object with the specified year, month, day, "
"hour, minute, second and microsecond."
msgstr ""
#: c-api/datetime.rst:118
msgid ""
"Return a ``datetime.time`` object with the specified hour, minute, second "
"and microsecond."
msgstr ""
#: c-api/datetime.rst:126
msgid ""
"Return a ``datetime.timedelta`` object representing the given number of "
"days, seconds and microseconds. Normalization is performed so that the "
"resulting number of microseconds and seconds lie in the ranges documented "
"for ``datetime.timedelta`` objects."
msgstr ""
#: c-api/datetime.rst:133
msgid ""
"Macros to extract fields from date objects. The argument must be an "
"instance of :c:data:`PyDateTime_Date`, including subclasses (such as :c:data:"
"`PyDateTime_DateTime`). The argument must not be *NULL*, and the type is "
"not checked:"
msgstr ""
#: c-api/datetime.rst:141
msgid "Return the year, as a positive int."
msgstr ""
#: c-api/datetime.rst:148
msgid "Return the month, as an int from 1 through 12."
msgstr ""
#: c-api/datetime.rst:155
msgid "Return the day, as an int from 1 through 31."
msgstr ""
#: c-api/datetime.rst:159
msgid ""
"Macros to extract fields from datetime objects. The argument must be an "
"instance of :c:data:`PyDateTime_DateTime`, including subclasses. The "
"argument must not be *NULL*, and the type is not checked:"
msgstr ""
#: c-api/datetime.rst:166 c-api/datetime.rst:198
msgid "Return the hour, as an int from 0 through 23."
msgstr ""
#: c-api/datetime.rst:173 c-api/datetime.rst:205
msgid "Return the minute, as an int from 0 through 59."
msgstr ""
#: c-api/datetime.rst:180 c-api/datetime.rst:212
msgid "Return the second, as an int from 0 through 59."
msgstr ""
#: c-api/datetime.rst:187 c-api/datetime.rst:219
msgid "Return the microsecond, as an int from 0 through 999999."
msgstr ""
#: c-api/datetime.rst:191
msgid ""
"Macros to extract fields from time objects. The argument must be an "
"instance of :c:data:`PyDateTime_Time`, including subclasses. The argument "
"must not be *NULL*, and the type is not checked:"
msgstr ""
#: c-api/datetime.rst:223
msgid "Macros for the convenience of modules implementing the DB API:"
msgstr ""
#: c-api/datetime.rst:228
msgid ""
"Create and return a new ``datetime.datetime`` object given an argument tuple "
"suitable for passing to ``datetime.datetime.fromtimestamp()``."
msgstr ""
#: c-api/datetime.rst:236
msgid ""
"Create and return a new ``datetime.date`` object given an argument tuple "
"suitable for passing to ``datetime.date.fromtimestamp()``."
msgstr ""
#: c-api/descriptor.rst:6
msgid "Descriptor Objects"
msgstr ""
#: c-api/descriptor.rst:8
msgid ""
"\"Descriptors\" are objects that describe some attribute of an object. They "
"are found in the dictionary of type objects."
msgstr ""
#: c-api/descriptor.rst:14
msgid "The type object for the built-in descriptor types."
msgstr ""
#: c-api/descriptor.rst:46
msgid ""
"Return true if the descriptor objects *descr* describes a data attribute, or "
"false if it describes a method. *descr* must be a descriptor object; there "
"is no error checking."
msgstr ""
#: c-api/dict.rst:6
msgid "Dictionary Objects"
msgstr "Objets dictionnaires"
#: c-api/dict.rst:13
msgid ""
"This subtype of :c:type:`PyObject` represents a Python dictionary object."
msgstr ""
#: c-api/dict.rst:22
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python dictionary "
"type. This is exposed to Python programs as ``dict`` and ``types.DictType``."
msgstr ""
#: c-api/dict.rst:29
msgid ""
"Return true if *p* is a dict object or an instance of a subtype of the dict "
"type."
msgstr ""
#: c-api/dict.rst:38
msgid ""
"Return true if *p* is a dict object, but not an instance of a subtype of the "
"dict type."
msgstr ""
#: c-api/dict.rst:46
msgid "Return a new empty dictionary, or *NULL* on failure."
msgstr ""
#: c-api/dict.rst:51
msgid ""
"Return a proxy object for a mapping which enforces read-only behavior. This "
"is normally used to create a proxy to prevent modification of the dictionary "
"for non-dynamic class types."
msgstr ""
#: c-api/dict.rst:60
msgid "Empty an existing dictionary of all key-value pairs."
msgstr ""
#: c-api/dict.rst:65
msgid ""
"Determine if dictionary *p* contains *key*. If an item in *p* is matches "
"*key*, return ``1``, otherwise return ``0``. On error, return ``-1``. This "
"is equivalent to the Python expression ``key in p``."
msgstr ""
#: c-api/dict.rst:74
msgid "Return a new dictionary that contains the same key-value pairs as *p*."
msgstr ""
#: c-api/dict.rst:81
msgid ""
"Insert *value* into the dictionary *p* with a key of *key*. *key* must be :"
"term:`hashable`; if it isn't, :exc:`TypeError` will be raised. Return ``0`` "
"on success or ``-1`` on failure."
msgstr ""
#: c-api/dict.rst:90
msgid ""
"Insert *value* into the dictionary *p* using *key* as a key. *key* should be "
"a :c:type:`char\\*`. The key object is created using "
"``PyString_FromString(key)``. Return ``0`` on success or ``-1`` on failure."
msgstr ""
#: c-api/dict.rst:98
msgid ""
"Remove the entry in dictionary *p* with key *key*. *key* must be hashable; "
"if it isn't, :exc:`TypeError` is raised. Return ``0`` on success or ``-1`` "
"on failure."
msgstr ""
#: c-api/dict.rst:105
msgid ""
"Remove the entry in dictionary *p* which has a key specified by the string "
"*key*. Return ``0`` on success or ``-1`` on failure."
msgstr ""
#: c-api/dict.rst:111
msgid ""
"Return the object from dictionary *p* which has a key *key*. Return *NULL* "
"if the key *key* is not present, but *without* setting an exception."
msgstr ""
#: c-api/dict.rst:117
msgid ""
"This is the same as :c:func:`PyDict_GetItem`, but *key* is specified as a :c:"
"type:`char\\*`, rather than a :c:type:`PyObject\\*`."
msgstr ""
#: c-api/dict.rst:123
msgid ""
"Return a :c:type:`PyListObject` containing all the items from the "
"dictionary, as in the dictionary method :meth:`dict.items`."
msgstr ""
#: c-api/dict.rst:129
msgid ""
"Return a :c:type:`PyListObject` containing all the keys from the dictionary, "
"as in the dictionary method :meth:`dict.keys`."
msgstr ""
#: c-api/dict.rst:135
msgid ""
"Return a :c:type:`PyListObject` containing all the values from the "
"dictionary *p*, as in the dictionary method :meth:`dict.values`."
msgstr ""
#: c-api/dict.rst:143
msgid ""
"Return the number of items in the dictionary. This is equivalent to "
"``len(p)`` on a dictionary."
msgstr ""
#: c-api/dict.rst:146
msgid ""
"This function returned an :c:type:`int` type. This might require changes in "
"your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/dict.rst:153
msgid ""
"Iterate over all key-value pairs in the dictionary *p*. The :c:type:"
"`Py_ssize_t` referred to by *ppos* must be initialized to ``0`` prior to the "
"first call to this function to start the iteration; the function returns "
"true for each pair in the dictionary, and false once all pairs have been "
"reported. The parameters *pkey* and *pvalue* should either point to :c:type:"
"`PyObject\\*` variables that will be filled in with each key and value, "
"respectively, or may be *NULL*. Any references returned through them are "
"borrowed. *ppos* should not be altered during iteration. Its value "
"represents offsets within the internal dictionary structure, and since the "
"structure is sparse, the offsets are not consecutive."
msgstr ""
#: c-api/dict.rst:164
msgid "For example::"
msgstr "Par exemple : ::"
#: c-api/dict.rst:174
msgid ""
"The dictionary *p* should not be mutated during iteration. It is safe "
"(since Python 2.1) to modify the values of the keys as you iterate over the "
"dictionary, but only so long as the set of keys does not change. For "
"example::"
msgstr ""
#: c-api/dict.rst:194
msgid ""
"This function used an :c:type:`int *` type for *ppos*. This might require "
"changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/dict.rst:201
msgid ""
"Iterate over mapping object *b* adding key-value pairs to dictionary *a*. "
"*b* may be a dictionary, or any object supporting :c:func:`PyMapping_Keys` "
"and :c:func:`PyObject_GetItem`. If *override* is true, existing pairs in *a* "
"will be replaced if a matching key is found in *b*, otherwise pairs will "
"only be added if there is not a matching key in *a*. Return ``0`` on success "
"or ``-1`` if an exception was raised."
msgstr ""
#: c-api/dict.rst:213
msgid ""
"This is the same as ``PyDict_Merge(a, b, 1)`` in C, and is similar to ``a."
"update(b)`` in Python except that :c:func:`PyDict_Update` doesn't fall back "
"to the iterating over a sequence of key value pairs if the second argument "
"has no \"keys\" attribute. Return ``0`` on success or ``-1`` if an "
"exception was raised."
msgstr ""
#: c-api/dict.rst:224
msgid ""
"Update or merge into dictionary *a*, from the key-value pairs in *seq2*. "
"*seq2* must be an iterable object producing iterable objects of length 2, "
"viewed as key-value pairs. In case of duplicate keys, the last wins if "
"*override* is true, else the first wins. Return ``0`` on success or ``-1`` "
"if an exception was raised. Equivalent Python (except for the return value)::"
msgstr ""
#: c-api/exceptions.rst:8
msgid "Exception Handling"
msgstr "Gestion des exceptions"
#: c-api/exceptions.rst:10
msgid ""
"The functions described in this chapter will let you handle and raise Python "
"exceptions. It is important to understand some of the basics of Python "
"exception handling. It works somewhat like the Unix :c:data:`errno` "
"variable: there is a global indicator (per thread) of the last error that "
"occurred. Most functions don't clear this on success, but will set it to "
"indicate the cause of the error on failure. Most functions also return an "
"error indicator, usually *NULL* if they are supposed to return a pointer, or "
"``-1`` if they return an integer (exception: the :c:func:`PyArg_\\*` "
"functions return ``1`` for success and ``0`` for failure)."
msgstr ""
#: c-api/exceptions.rst:20
msgid ""
"When a function must fail because some function it called failed, it "
"generally doesn't set the error indicator; the function it called already "
"set it. It is responsible for either handling the error and clearing the "
"exception or returning after cleaning up any resources it holds (such as "
"object references or memory allocations); it should *not* continue normally "
"if it is not prepared to handle the error. If returning due to an error, it "
"is important to indicate to the caller that an error has been set. If the "
"error is not handled or carefully propagated, additional calls into the "
"Python/C API may not behave as intended and may fail in mysterious ways."
msgstr ""
#: c-api/exceptions.rst:35
msgid ""
"The error indicator consists of three Python objects corresponding to the "
"Python variables ``sys.exc_type``, ``sys.exc_value`` and ``sys."
"exc_traceback``. API functions exist to interact with the error indicator in "
"various ways. There is a separate error indicator for each thread."
msgstr ""
#: c-api/exceptions.rst:46
msgid ""
"Print a standard traceback to ``sys.stderr`` and clear the error indicator. "
"Call this function only when the error indicator is set. (Otherwise it will "
"cause a fatal error!)"
msgstr ""
#: c-api/exceptions.rst:50
msgid ""
"If *set_sys_last_vars* is nonzero, the variables :data:`sys.last_type`, :"
"data:`sys.last_value` and :data:`sys.last_traceback` will be set to the "
"type, value and traceback of the printed exception, respectively."
msgstr ""
#: c-api/exceptions.rst:57
msgid "Alias for ``PyErr_PrintEx(1)``."
msgstr ""
#: c-api/exceptions.rst:62
msgid ""
"Test whether the error indicator is set. If set, return the exception "
"*type* (the first argument to the last call to one of the :c:func:`PyErr_Set"
"\\*` functions or to :c:func:`PyErr_Restore`). If not set, return *NULL*. "
"You do not own a reference to the return value, so you do not need to :c:"
"func:`Py_DECREF` it."
msgstr ""
#: c-api/exceptions.rst:70
msgid ""
"Do not compare the return value to a specific exception; use :c:func:"
"`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily "
"fail since the exception may be an instance instead of a class, in the case "
"of a class exception, or it may be a subclass of the expected exception.)"
msgstr ""
#: c-api/exceptions.rst:78
msgid ""
"Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This "
"should only be called when an exception is actually set; a memory access "
"violation will occur if no exception has been raised."
msgstr ""
#: c-api/exceptions.rst:85
msgid ""
"Return true if the *given* exception matches the exception in *exc*. If "
"*exc* is a class object, this also returns true when *given* is an instance "
"of a subclass. If *exc* is a tuple, all exceptions in the tuple (and "
"recursively in subtuples) are searched for a match."
msgstr ""
#: c-api/exceptions.rst:93
msgid ""
"Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` "
"below can be \"unnormalized\", meaning that ``*exc`` is a class object but "
"``*val`` is not an instance of the same class. This function can be used "
"to instantiate the class in that case. If the values are already "
"normalized, nothing happens. The delayed normalization is implemented to "
"improve performance."
msgstr ""
#: c-api/exceptions.rst:102
msgid ""
"Clear the error indicator. If the error indicator is not set, there is no "
"effect."
msgstr ""
#: c-api/exceptions.rst:108
msgid ""
"Retrieve the error indicator into three variables whose addresses are "
"passed. If the error indicator is not set, set all three variables to "
"*NULL*. If it is set, it will be cleared and you own a reference to each "
"object retrieved. The value and traceback object may be *NULL* even when "
"the type object is not."
msgstr ""
#: c-api/exceptions.rst:115
msgid ""
"This function is normally only used by code that needs to handle exceptions "
"or by code that needs to save and restore the error indicator temporarily."
msgstr ""
#: c-api/exceptions.rst:121
msgid ""
"Set the error indicator from the three objects. If the error indicator is "
"already set, it is cleared first. If the objects are *NULL*, the error "
"indicator is cleared. Do not pass a *NULL* type and non-*NULL* value or "
"traceback. The exception type should be a class. Do not pass an invalid "
"exception type or value. (Violating these rules will cause subtle problems "
"later.) This call takes away a reference to each object: you must own a "
"reference to each object before the call and after the call you no longer "
"own these references. (If you don't understand this, don't use this "
"function. I warned you.)"
msgstr ""
#: c-api/exceptions.rst:133
msgid ""
"This function is normally only used by code that needs to save and restore "
"the error indicator temporarily; use :c:func:`PyErr_Fetch` to save the "
"current exception state."
msgstr ""
#: c-api/exceptions.rst:140
msgid ""
"This is the most common way to set the error indicator. The first argument "
"specifies the exception type; it is normally one of the standard exceptions, "
"e.g. :c:data:`PyExc_RuntimeError`. You need not increment its reference "
"count. The second argument is an error message; it is converted to a string "
"object."
msgstr ""
#: c-api/exceptions.rst:148
msgid ""
"This function is similar to :c:func:`PyErr_SetString` but lets you specify "
"an arbitrary Python object for the \"value\" of the exception."
msgstr ""
#: c-api/exceptions.rst:154
msgid ""
"This function sets the error indicator and returns *NULL*. *exception* "
"should be a Python exception class. The *format* and subsequent parameters "
"help format the error message; they have the same meaning and values as in :"
"c:func:`PyString_FromFormat`."
msgstr ""
#: c-api/exceptions.rst:162
msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``."
msgstr ""
#: c-api/exceptions.rst:167
msgid ""
"This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where "
"*message* indicates that a built-in operation was invoked with an illegal "
"argument. It is mostly for internal use."
msgstr ""
#: c-api/exceptions.rst:174
msgid ""
"This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns "
"*NULL* so an object allocation function can write ``return PyErr_NoMemory();"
"`` when it runs out of memory."
msgstr ""
#: c-api/exceptions.rst:183
msgid ""
"This is a convenience function to raise an exception when a C library "
"function has returned an error and set the C variable :c:data:`errno`. It "
"constructs a tuple object whose first item is the integer :c:data:`errno` "
"value and whose second item is the corresponding error message (gotten from :"
"c:func:`strerror`), and then calls ``PyErr_SetObject(type, object)``. On "
"Unix, when the :c:data:`errno` value is :const:`EINTR`, indicating an "
"interrupted system call, this calls :c:func:`PyErr_CheckSignals`, and if "
"that set the error indicator, leaves it set to that. The function always "
"returns *NULL*, so a wrapper function around a system call can write "
"``return PyErr_SetFromErrno(type);`` when the system call returns an error."
msgstr ""
#: c-api/exceptions.rst:197
msgid ""
"Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that "
"if *filenameObject* is not *NULL*, it is passed to the constructor of *type* "
"as a third parameter. In the case of exceptions such as :exc:`IOError` and :"
"exc:`OSError`, this is used to define the :attr:`filename` attribute of the "
"exception instance."
msgstr ""
#: c-api/exceptions.rst:206
msgid ""
"Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but the filename "
"is given as a C string."
msgstr ""
#: c-api/exceptions.rst:212
msgid ""
"This is a convenience function to raise :exc:`WindowsError`. If called with "
"*ierr* of :c:data:`0`, the error code returned by a call to :c:func:"
"`GetLastError` is used instead. It calls the Win32 function :c:func:"
"`FormatMessage` to retrieve the Windows description of error code given by "
"*ierr* or :c:func:`GetLastError`, then it constructs a tuple object whose "
"first item is the *ierr* value and whose second item is the corresponding "
"error message (gotten from :c:func:`FormatMessage`), and then calls "
"``PyErr_SetObject(PyExc_WindowsError, object)``. This function always "
"returns *NULL*. Availability: Windows."
msgstr ""
#: c-api/exceptions.rst:224
msgid ""
"Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter "
"specifying the exception type to be raised. Availability: Windows."
msgstr ""
#: c-api/exceptions.rst:232
msgid ""
"Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior "
"that if *filenameObject* is not *NULL*, it is passed to the constructor of :"
"exc:`WindowsError` as a third parameter. Availability: Windows."
msgstr ""
#: c-api/exceptions.rst:239
msgid ""
"Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the "
"filename is given as a C string. Availability: Windows."
msgstr ""
#: c-api/exceptions.rst:245
msgid ""
"Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, with an "
"additional parameter specifying the exception type to be raised. "
"Availability: Windows."
msgstr ""
#: c-api/exceptions.rst:254
msgid ""
"Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional "
"parameter specifying the exception type to be raised. Availability: Windows."
msgstr ""
#: c-api/exceptions.rst:262
msgid ""
"This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, "
"where *message* indicates that an internal operation (e.g. a Python/C API "
"function) was invoked with an illegal argument. It is mostly for internal "
"use."
msgstr ""
#: c-api/exceptions.rst:270
msgid ""
"Issue a warning message. The *category* argument is a warning category (see "
"below) or *NULL*; the *message* argument is a message string. *stacklevel* "
"is a positive number giving a number of stack frames; the warning will be "
"issued from the currently executing line of code in that stack frame. A "
"*stacklevel* of 1 is the function calling :c:func:`PyErr_WarnEx`, 2 is the "
"function above that, and so forth."
msgstr ""
#: c-api/exceptions.rst:277
msgid ""
"This function normally prints a warning message to *sys.stderr*; however, it "
"is also possible that the user has specified that warnings are to be turned "
"into errors, and in that case this will raise an exception. It is also "
"possible that the function raises an exception because of a problem with the "
"warning machinery (the implementation imports the :mod:`warnings` module to "
"do the heavy lifting). The return value is ``0`` if no exception is raised, "
"or ``-1`` if an exception is raised. (It is not possible to determine "
"whether a warning message is actually printed, nor what the reason is for "
"the exception; this is intentional.) If an exception is raised, the caller "
"should do its normal exception handling (for example, :c:func:`Py_DECREF` "
"owned references and return an error value)."
msgstr ""
#: c-api/exceptions.rst:289
msgid ""
"Warning categories must be subclasses of :c:data:`Warning`; the default "
"warning category is :c:data:`RuntimeWarning`. The standard Python warning "
"categories are available as global variables whose names are ``PyExc_`` "
"followed by the Python exception name. These have the type :c:type:`PyObject"
"\\*`; they are all class objects. Their names are :c:data:`PyExc_Warning`, :"
"c:data:`PyExc_UserWarning`, :c:data:`PyExc_UnicodeWarning`, :c:data:"
"`PyExc_DeprecationWarning`, :c:data:`PyExc_SyntaxWarning`, :c:data:"
"`PyExc_RuntimeWarning`, and :c:data:`PyExc_FutureWarning`. :c:data:"
"`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`; the other "
"warning categories are subclasses of :c:data:`PyExc_Warning`."
msgstr ""
#: c-api/exceptions.rst:300
msgid ""
"For information about warning control, see the documentation for the :mod:"
"`warnings` module and the :option:`-W` option in the command line "
"documentation. There is no C API for warning control."
msgstr ""
#: c-api/exceptions.rst:307
msgid ""
"Issue a warning message. The *category* argument is a warning category (see "
"below) or *NULL*; the *message* argument is a message string. The warning "
"will appear to be issued from the function calling :c:func:`PyErr_Warn`, "
"equivalent to calling :c:func:`PyErr_WarnEx` with a *stacklevel* of 1."
msgstr ""
#: c-api/exceptions.rst:312
msgid "Deprecated; use :c:func:`PyErr_WarnEx` instead."
msgstr ""
#: c-api/exceptions.rst:317
msgid ""
"Issue a warning message with explicit control over all warning attributes. "
"This is a straightforward wrapper around the Python function :func:`warnings."
"warn_explicit`, see there for more information. The *module* and *registry* "
"arguments may be set to *NULL* to get the default effect described there."
msgstr ""
#: c-api/exceptions.rst:326
msgid ""
"Issue a :exc:`DeprecationWarning` with the given *message* and *stacklevel* "
"if the :c:data:`Py_Py3kWarningFlag` flag is enabled."
msgstr ""
#: c-api/exceptions.rst:339
msgid ""
"This function interacts with Python's signal handling. It checks whether a "
"signal has been sent to the processes and if so, invokes the corresponding "
"signal handler. If the :mod:`signal` module is supported, this can invoke a "
"signal handler written in Python. In all cases, the default effect for :"
"const:`SIGINT` is to raise the :exc:`KeyboardInterrupt` exception. If an "
"exception is raised the error indicator is set and the function returns "
"``-1``; otherwise the function returns ``0``. The error indicator may or "
"may not be cleared if it was previously set."
msgstr ""
#: c-api/exceptions.rst:355
msgid ""
"This function simulates the effect of a :const:`SIGINT` signal arriving --- "
"the next time :c:func:`PyErr_CheckSignals` is called, :exc:"
"`KeyboardInterrupt` will be raised. It may be called without holding the "
"interpreter lock."
msgstr ""
#: c-api/exceptions.rst:365
msgid ""
"This utility function specifies a file descriptor to which a ``'\\0'`` byte "
"will be written whenever a signal is received. It returns the previous such "
"file descriptor. The value ``-1`` disables the feature; this is the initial "
"state. This is equivalent to :func:`signal.set_wakeup_fd` in Python, but "
"without any error checking. *fd* should be a valid file descriptor. The "
"function should only be called from the main thread."
msgstr ""
#: c-api/exceptions.rst:377
msgid ""
"This utility function creates and returns a new exception class. The *name* "
"argument must be the name of the new exception, a C string of the form "
"``module.classname``. The *base* and *dict* arguments are normally *NULL*. "
"This creates a class object derived from :exc:`Exception` (accessible in C "
"as :c:data:`PyExc_Exception`)."
msgstr ""
#: c-api/exceptions.rst:383
msgid ""
"The :attr:`__module__` attribute of the new class is set to the first part "
"(up to the last dot) of the *name* argument, and the class name is set to "
"the last part (after the last dot). The *base* argument can be used to "
"specify alternate base classes; it can either be only one class or a tuple "
"of classes. The *dict* argument can be used to specify a dictionary of class "
"variables and methods."
msgstr ""
#: c-api/exceptions.rst:392
msgid ""
"Same as :c:func:`PyErr_NewException`, except that the new exception class "
"can easily be given a docstring: If *doc* is non-*NULL*, it will be used as "
"the docstring for the exception class."
msgstr ""
#: c-api/exceptions.rst:401
msgid ""
"This utility function prints a warning message to ``sys.stderr`` when an "
"exception has been set but it is impossible for the interpreter to actually "
"raise the exception. It is used, for example, when an exception occurs in "
"an :meth:`__del__` method."
msgstr ""
#: c-api/exceptions.rst:406
msgid ""
"The function is called with a single argument *obj* that identifies the "
"context in which the unraisable exception occurred. The repr of *obj* will "
"be printed in the warning message."
msgstr ""
#: c-api/exceptions.rst:414
#, fuzzy
msgid "Unicode Exception Objects"
msgstr "Objets Exception"
#: c-api/exceptions.rst:416
msgid ""
"The following functions are used to create and modify Unicode exceptions "
"from C."
msgstr ""
#: c-api/exceptions.rst:420
msgid ""
"Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, "
"*object*, *length*, *start*, *end* and *reason*."
msgstr ""
#: c-api/exceptions.rst:425
msgid ""
"Create a :class:`UnicodeEncodeError` object with the attributes *encoding*, "
"*object*, *length*, *start*, *end* and *reason*."
msgstr ""
#: c-api/exceptions.rst:430
msgid ""
"Create a :class:`UnicodeTranslateError` object with the attributes *object*, "
"*length*, *start*, *end* and *reason*."
msgstr ""
#: c-api/exceptions.rst:436
msgid "Return the *encoding* attribute of the given exception object."
msgstr ""
#: c-api/exceptions.rst:442
msgid "Return the *object* attribute of the given exception object."
msgstr ""
#: c-api/exceptions.rst:448
msgid ""
"Get the *start* attribute of the given exception object and place it into *"
"\\*start*. *start* must not be *NULL*. Return ``0`` on success, ``-1`` on "
"failure."
msgstr ""
#: c-api/exceptions.rst:456
msgid ""
"Set the *start* attribute of the given exception object to *start*. Return "
"``0`` on success, ``-1`` on failure."
msgstr ""
#: c-api/exceptions.rst:463
msgid ""
"Get the *end* attribute of the given exception object and place it into *"
"\\*end*. *end* must not be *NULL*. Return ``0`` on success, ``-1`` on "
"failure."
msgstr ""
#: c-api/exceptions.rst:471
msgid ""
"Set the *end* attribute of the given exception object to *end*. Return "
"``0`` on success, ``-1`` on failure."
msgstr ""
#: c-api/exceptions.rst:478
msgid "Return the *reason* attribute of the given exception object."
msgstr ""
#: c-api/exceptions.rst:484
msgid ""
"Set the *reason* attribute of the given exception object to *reason*. "
"Return ``0`` on success, ``-1`` on failure."
msgstr ""
#: c-api/exceptions.rst:489
msgid "Recursion Control"
msgstr "Contrôle de la récursion"
#: c-api/exceptions.rst:491
msgid ""
"These two functions provide a way to perform safe recursive calls at the C "
"level, both in the core and in extension modules. They are needed if the "
"recursive code does not necessarily invoke Python code (which tracks its "
"recursion depth automatically)."
msgstr ""
#: c-api/exceptions.rst:498
msgid "Marks a point where a recursive C-level call is about to be performed."
msgstr ""
#: c-api/exceptions.rst:500
msgid ""
"If :const:`USE_STACKCHECK` is defined, this function checks if the OS stack "
"overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it sets a :"
"exc:`MemoryError` and returns a nonzero value."
msgstr ""
#: c-api/exceptions.rst:504
msgid ""
"The function then checks if the recursion limit is reached. If this is the "
"case, a :exc:`RuntimeError` is set and a nonzero value is returned. "
"Otherwise, zero is returned."
msgstr ""
#: c-api/exceptions.rst:508
msgid ""
"*where* should be a string such as ``\" in instance check\"`` to be "
"concatenated to the :exc:`RuntimeError` message caused by the recursion "
"depth limit."
msgstr ""
#: c-api/exceptions.rst:514
msgid ""
"Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each "
"*successful* invocation of :c:func:`Py_EnterRecursiveCall`."
msgstr ""
#: c-api/exceptions.rst:521
msgid "Standard Exceptions"
msgstr "Exceptions standards"
#: c-api/exceptions.rst:523
msgid ""
"All standard Python exceptions are available as global variables whose names "
"are ``PyExc_`` followed by the Python exception name. These have the type :"
"c:type:`PyObject\\*`; they are all class objects. For completeness, here "
"are all the variables:"
msgstr ""
#: c-api/exceptions.rst:529
msgid "C Name"
msgstr "Nom C"
#: c-api/exceptions.rst:529
msgid "Python Name"
msgstr "Nom Python"
#: c-api/exceptions.rst:529
msgid "Notes"
msgstr "Notes"
#: c-api/exceptions.rst:531
msgid ":c:data:`PyExc_BaseException`"
msgstr ":c:data:`PyExc_BaseException`"
#: c-api/exceptions.rst:531
msgid ":exc:`BaseException`"
msgstr ":exc:`BaseException`"
#: c-api/exceptions.rst:531
msgid "(1), (4)"
msgstr ""
#: c-api/exceptions.rst:533
msgid ":c:data:`PyExc_Exception`"
msgstr ":c:data:`PyExc_Exception`"
#: c-api/exceptions.rst:533
msgid ":exc:`Exception`"
msgstr ":exc:`Exception`"
#: c-api/exceptions.rst:533 c-api/exceptions.rst:535 c-api/exceptions.rst:537
#: c-api/exceptions.rst:539 c-api/exceptions.rst:547
msgid "\\(1)"
msgstr "\\(1)"
#: c-api/exceptions.rst:535
msgid ":c:data:`PyExc_StandardError`"
msgstr ":c:data:`PyExc_StandardError`"
#: c-api/exceptions.rst:535
msgid ":exc:`StandardError`"
msgstr ":exc:`StandardError`"
#: c-api/exceptions.rst:537
msgid ":c:data:`PyExc_ArithmeticError`"
msgstr ":c:data:`PyExc_ArithmeticError`"
#: c-api/exceptions.rst:537
msgid ":exc:`ArithmeticError`"
msgstr ":exc:`ArithmeticError`"
#: c-api/exceptions.rst:539
msgid ":c:data:`PyExc_LookupError`"
msgstr ":c:data:`PyExc_LookupError`"
#: c-api/exceptions.rst:539
msgid ":exc:`LookupError`"
msgstr ":exc:`LookupError`"
#: c-api/exceptions.rst:541
msgid ":c:data:`PyExc_AssertionError`"
msgstr ":c:data:`PyExc_AssertionError`"
#: c-api/exceptions.rst:541
msgid ":exc:`AssertionError`"
msgstr ":exc:`AssertionError`"
#: c-api/exceptions.rst:543
msgid ":c:data:`PyExc_AttributeError`"
msgstr ":c:data:`PyExc_AttributeError`"
#: c-api/exceptions.rst:543
msgid ":exc:`AttributeError`"
msgstr ":exc:`AttributeError`"
#: c-api/exceptions.rst:545
msgid ":c:data:`PyExc_EOFError`"
msgstr ":c:data:`PyExc_EOFError`"
#: c-api/exceptions.rst:545
msgid ":exc:`EOFError`"
msgstr ":exc:`EOFError`"
#: c-api/exceptions.rst:547
msgid ":c:data:`PyExc_EnvironmentError`"
msgstr ":c:data:`PyExc_EnvironmentError`"
#: c-api/exceptions.rst:547
msgid ":exc:`EnvironmentError`"
msgstr ":exc:`EnvironmentError`"
#: c-api/exceptions.rst:549
msgid ":c:data:`PyExc_FloatingPointError`"
msgstr ":c:data:`PyExc_FloatingPointError`"
#: c-api/exceptions.rst:549
msgid ":exc:`FloatingPointError`"
msgstr ":exc:`FloatingPointError`"
#: c-api/exceptions.rst:551
msgid ":c:data:`PyExc_IOError`"
msgstr ":c:data:`PyExc_IOError`"
#: c-api/exceptions.rst:551
msgid ":exc:`IOError`"
msgstr ":exc:`IOError`"
#: c-api/exceptions.rst:553
msgid ":c:data:`PyExc_ImportError`"
msgstr ":c:data:`PyExc_ImportError`"
#: c-api/exceptions.rst:553
msgid ":exc:`ImportError`"
msgstr ":exc:`ImportError`"
#: c-api/exceptions.rst:555
#, fuzzy
msgid ":c:data:`PyExc_IndexError`"
msgstr ":c:data:`PyExc_IndexError`"
#: c-api/exceptions.rst:555
msgid ":exc:`IndexError`"
msgstr ":exc:`IndexError`"
#: c-api/exceptions.rst:557
#, fuzzy
msgid ":c:data:`PyExc_KeyError`"
msgstr ":c:data:`PyExc_KeyError`"
#: c-api/exceptions.rst:557
msgid ":exc:`KeyError`"
msgstr ":exc:`KeyError`"
#: c-api/exceptions.rst:559
#, fuzzy
msgid ":c:data:`PyExc_KeyboardInterrupt`"
msgstr ":c:data:`PyExc_KeyboardInterrupt`"
#: c-api/exceptions.rst:559
msgid ":exc:`KeyboardInterrupt`"
msgstr ":exc:`KeyboardInterrupt`"
#: c-api/exceptions.rst:561
#, fuzzy
msgid ":c:data:`PyExc_MemoryError`"
msgstr ":c:data:`PyExc_MemoryError`"
#: c-api/exceptions.rst:561
msgid ":exc:`MemoryError`"
msgstr ":exc:`MemoryError`"
#: c-api/exceptions.rst:563
#, fuzzy
msgid ":c:data:`PyExc_NameError`"
msgstr ":c:data:`PyExc_NameError`"
#: c-api/exceptions.rst:563
msgid ":exc:`NameError`"
msgstr ":exc:`NameError`"
#: c-api/exceptions.rst:565
#, fuzzy
msgid ":c:data:`PyExc_NotImplementedError`"
msgstr ":c:data:`PyExc_NotImplementedError`"
#: c-api/exceptions.rst:565
msgid ":exc:`NotImplementedError`"
msgstr ":exc:`NotImplementedError`"
#: c-api/exceptions.rst:567
#, fuzzy
msgid ":c:data:`PyExc_OSError`"
msgstr ":c:data:`PyExc_OSError`"
#: c-api/exceptions.rst:567
msgid ":exc:`OSError`"
msgstr ":exc:`OSError`"
#: c-api/exceptions.rst:569
#, fuzzy
msgid ":c:data:`PyExc_OverflowError`"
msgstr ":c:data:`PyExc_OverflowError`"
#: c-api/exceptions.rst:569
msgid ":exc:`OverflowError`"
msgstr ":exc:`OverflowError`"
#: c-api/exceptions.rst:571
#, fuzzy
msgid ":c:data:`PyExc_ReferenceError`"
msgstr ":c:data:`PyExc_ReferenceError`"
#: c-api/exceptions.rst:571
msgid ":exc:`ReferenceError`"
msgstr ":exc:`ReferenceError`"
#: c-api/exceptions.rst:571
msgid "\\(2)"
msgstr "\\(2)"
#: c-api/exceptions.rst:573
msgid ":c:data:`PyExc_RuntimeError`"
msgstr ":c:data:`PyExc_RuntimeError`"
#: c-api/exceptions.rst:573
msgid ":exc:`RuntimeError`"
msgstr ":exc:`RuntimeError`"
#: c-api/exceptions.rst:575
#, fuzzy
msgid ":c:data:`PyExc_SyntaxError`"
msgstr ":c:data:`PyExc_SyntaxError`"
#: c-api/exceptions.rst:575
msgid ":exc:`SyntaxError`"
msgstr ":exc:`SyntaxError`"
#: c-api/exceptions.rst:577
msgid ":c:data:`PyExc_SystemError`"
msgstr ":c:data:`PyExc_SystemError`"
#: c-api/exceptions.rst:577
msgid ":exc:`SystemError`"
msgstr ":exc:`SystemError`"
#: c-api/exceptions.rst:579
msgid ":c:data:`PyExc_SystemExit`"
msgstr ":c:data:`PyExc_SystemExit`"
#: c-api/exceptions.rst:579
msgid ":exc:`SystemExit`"
msgstr ":exc:`SystemExit`"
#: c-api/exceptions.rst:581
msgid ":c:data:`PyExc_TypeError`"
msgstr ":c:data:`PyExc_TypeError`"
#: c-api/exceptions.rst:581
msgid ":exc:`TypeError`"
msgstr ":exc:`TypeError`"
#: c-api/exceptions.rst:583
msgid ":c:data:`PyExc_ValueError`"
msgstr ":c:data:`PyExc_ValueError`"
#: c-api/exceptions.rst:583
msgid ":exc:`ValueError`"
msgstr ":exc:`ValueError`"
#: c-api/exceptions.rst:585
msgid ":c:data:`PyExc_WindowsError`"
msgstr ":c:data:`PyExc_WindowsError`"
#: c-api/exceptions.rst:585
msgid ":exc:`WindowsError`"
msgstr ":exc:`WindowsError`"
#: c-api/exceptions.rst:585
msgid "\\(3)"
msgstr "\\(3)"
#: c-api/exceptions.rst:587
msgid ":c:data:`PyExc_ZeroDivisionError`"
msgstr ":c:data:`PyExc_ZeroDivisionError`"
#: c-api/exceptions.rst:587
msgid ":exc:`ZeroDivisionError`"
msgstr ":exc:`ZeroDivisionError`"
#: c-api/exceptions.rst:621
msgid "Notes:"
msgstr "Notes : "
#: c-api/exceptions.rst:624
msgid "This is a base class for other standard exceptions."
msgstr "C'est la classe de base pour les autres exceptions standards"
#: c-api/exceptions.rst:627
msgid "This is the same as :exc:`weakref.ReferenceError`."
msgstr "Identique à :exc:`weakref.ReferenceError`."
#: c-api/exceptions.rst:630
msgid ""
"Only defined on Windows; protect code that uses this by testing that the "
"preprocessor macro ``MS_WINDOWS`` is defined."
msgstr ""
#: c-api/exceptions.rst:638
msgid "String Exceptions"
msgstr ""
#: c-api/exceptions.rst:640
msgid ""
"All exceptions to be raised or caught must be derived from :exc:"
"`BaseException`. Trying to raise a string exception now raises :exc:"
"`TypeError`."
msgstr ""
#: c-api/file.rst:6
msgid "File Objects"
msgstr "Objets fichiers"
#: c-api/file.rst:10
msgid ""
"Python's built-in file objects are implemented entirely on the :c:type:`FILE"
"\\*` support from the C standard library. This is an implementation detail "
"and may change in future releases of Python."
msgstr ""
#: c-api/file.rst:17
msgid "This subtype of :c:type:`PyObject` represents a Python file object."
msgstr ""
#: c-api/file.rst:24
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python file type. "
"This is exposed to Python programs as ``file`` and ``types.FileType``."
msgstr ""
#: c-api/file.rst:30
msgid ""
"Return true if its argument is a :c:type:`PyFileObject` or a subtype of :c:"
"type:`PyFileObject`."
msgstr ""
#: c-api/file.rst:39
msgid ""
"Return true if its argument is a :c:type:`PyFileObject`, but not a subtype "
"of :c:type:`PyFileObject`."
msgstr ""
#: c-api/file.rst:49
msgid ""
"On success, return a new file object that is opened on the file given by "
"*filename*, with a file mode given by *mode*, where *mode* has the same "
"semantics as the standard C routine :c:func:`fopen`. On failure, return "
"*NULL*."
msgstr ""
#: c-api/file.rst:56
msgid ""
"Create a new :c:type:`PyFileObject` from the already-open standard C file "
"pointer, *fp*. The function *close* will be called when the file should be "
"closed. Return *NULL* and close the file using *close* on failure. *close* "
"is optional and can be set to *NULL*."
msgstr ""
#: c-api/file.rst:64
msgid "Return the file object associated with *p* as a :c:type:`FILE\\*`."
msgstr ""
#: c-api/file.rst:66
msgid ""
"If the caller will ever use the returned :c:type:`FILE\\*` object while the :"
"term:`GIL` is released it must also call the :c:func:`PyFile_IncUseCount` "
"and :c:func:`PyFile_DecUseCount` functions described below as appropriate."
msgstr ""
#: c-api/file.rst:73
msgid ""
"Increments the PyFileObject's internal use count to indicate that the "
"underlying :c:type:`FILE\\*` is being used. This prevents Python from "
"calling f_close() on it from another thread. Callers of this must call :c:"
"func:`PyFile_DecUseCount` when they are finished with the :c:type:`FILE"
"\\*`. Otherwise the file object will never be closed by Python."
msgstr ""
#: c-api/file.rst:80
msgid "The :term:`GIL` must be held while calling this function."
msgstr ""
#: c-api/file.rst:82
msgid ""
"The suggested use is to call this after :c:func:`PyFile_AsFile` and before "
"you release the GIL::"
msgstr ""
#: c-api/file.rst:99
msgid ""
"Decrements the PyFileObject's internal unlocked_count member to indicate "
"that the caller is done with its own use of the :c:type:`FILE\\*`. This may "
"only be called to undo a prior call to :c:func:`PyFile_IncUseCount`."
msgstr ""
#: c-api/file.rst:103
msgid ""
"The :term:`GIL` must be held while calling this function (see the example "
"above)."
msgstr ""
#: c-api/file.rst:113
msgid ""
"Equivalent to ``p.readline([n])``, this function reads one line from the "
"object *p*. *p* may be a file object or any object with a :meth:`~io.IOBase."
"readline` method. If *n* is ``0``, exactly one line is read, regardless of "
"the length of the line. If *n* is greater than ``0``, no more than *n* "
"bytes will be read from the file; a partial line can be returned. In both "
"cases, an empty string is returned if the end of the file is reached "
"immediately. If *n* is less than ``0``, however, one line is read "
"regardless of length, but :exc:`EOFError` is raised if the end of the file "
"is reached immediately."
msgstr ""
#: c-api/file.rst:126
msgid "Return the name of the file specified by *p* as a string object."
msgstr ""
#: c-api/file.rst:133
msgid ""
"Available on systems with :c:func:`setvbuf` only. This should only be "
"called immediately after file object creation."
msgstr ""
#: c-api/file.rst:139
msgid ""
"Set the file's encoding for Unicode output to *enc*. Return 1 on success and "
"0 on failure."
msgstr ""
#: c-api/file.rst:147
msgid ""
"Set the file's encoding for Unicode output to *enc*, and its error mode to "
"*err*. Return 1 on success and 0 on failure."
msgstr ""
#: c-api/file.rst:157
msgid ""
"This function exists for internal use by the interpreter. Set the :attr:"
"`softspace` attribute of *p* to *newflag* and return the previous value. *p* "
"does not have to be a file object for this function to work properly; any "
"object is supported (thought its only interesting if the :attr:`softspace` "
"attribute can be set). This function clears any errors, and will return "
"``0`` as the previous value if the attribute either does not exist or if "
"there were errors in retrieving it. There is no way to detect errors from "
"this function, but doing so should not be needed."
msgstr ""
#: c-api/file.rst:171
msgid ""
"Write object *obj* to file object *p*. The only supported flag for *flags* "
"is :const:`Py_PRINT_RAW`; if given, the :func:`str` of the object is written "
"instead of the :func:`repr`. Return ``0`` on success or ``-1`` on failure; "
"the appropriate exception will be set."
msgstr ""
#: c-api/file.rst:179
msgid ""
"Write string *s* to file object *p*. Return ``0`` on success or ``-1`` on "
"failure; the appropriate exception will be set."
msgstr ""
#: c-api/float.rst:6
msgid "Floating Point Objects"
msgstr ""
#: c-api/float.rst:13
msgid ""
"This subtype of :c:type:`PyObject` represents a Python floating point object."
msgstr ""
#: c-api/float.rst:20
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python floating point "
"type. This is the same object as ``float`` and ``types.FloatType``."
msgstr ""
#: c-api/float.rst:26
msgid ""
"Return true if its argument is a :c:type:`PyFloatObject` or a subtype of :c:"
"type:`PyFloatObject`."
msgstr ""
#: c-api/float.rst:35
msgid ""
"Return true if its argument is a :c:type:`PyFloatObject`, but not a subtype "
"of :c:type:`PyFloatObject`."
msgstr ""
#: c-api/float.rst:43
msgid ""
"Create a :c:type:`PyFloatObject` object based on the string value in *str*, "
"or *NULL* on failure. The *pend* argument is ignored. It remains only for "
"backward compatibility."
msgstr ""
#: c-api/float.rst:50
msgid "Create a :c:type:`PyFloatObject` object from *v*, or *NULL* on failure."
msgstr ""
#: c-api/float.rst:55
msgid ""
"Return a C :c:type:`double` representation of the contents of *pyfloat*. If "
"*pyfloat* is not a Python floating point object but has a :meth:`__float__` "
"method, this method will first be called to convert *pyfloat* into a float. "
"This method returns ``-1.0`` upon failure, so one should call :c:func:"
"`PyErr_Occurred` to check for errors."
msgstr ""
#: c-api/float.rst:64
msgid ""
"Return a C :c:type:`double` representation of the contents of *pyfloat*, but "
"without error checking."
msgstr ""
#: c-api/float.rst:70
msgid ""
"Return a structseq instance which contains information about the precision, "
"minimum and maximum values of a float. It's a thin wrapper around the header "
"file :file:`float.h`."
msgstr ""
#: c-api/float.rst:79
msgid ""
"Return the maximum representable finite float *DBL_MAX* as C :c:type:"
"`double`."
msgstr ""
#: c-api/float.rst:86
msgid ""
"Return the minimum normalized positive float *DBL_MIN* as C :c:type:`double`."
msgstr ""
#: c-api/float.rst:93
msgid ""
"Clear the float free list. Return the number of items that could not be "
"freed."
msgstr ""
#: c-api/float.rst:101
msgid ""
"Convert the argument *v* to a string, using the same rules as :func:`str`. "
"The length of *buf* should be at least 100."
msgstr ""
#: c-api/float.rst:104 c-api/float.rst:116
msgid ""
"This function is unsafe to call because it writes to a buffer whose length "
"it does not know."
msgstr ""
#: c-api/float.rst:107
msgid "Use :func:`PyObject_Str` or :func:`PyOS_double_to_string` instead."
msgstr ""
#: c-api/float.rst:113
msgid ""
"Same as PyFloat_AsString, except uses the same rules as :func:`repr`. The "
"length of *buf* should be at least 100."
msgstr ""
#: c-api/float.rst:119
msgid "Use :func:`PyObject_Repr` or :func:`PyOS_double_to_string` instead."
msgstr ""
#: c-api/function.rst:6
msgid "Function Objects"
msgstr ""
#: c-api/function.rst:10
msgid "There are a few functions specific to Python functions."
msgstr ""
#: c-api/function.rst:15
msgid "The C structure used for functions."
msgstr ""
#: c-api/function.rst:22
msgid ""
"This is an instance of :c:type:`PyTypeObject` and represents the Python "
"function type. It is exposed to Python programmers as ``types."
"FunctionType``."
msgstr ""
#: c-api/function.rst:28
msgid ""
"Return true if *o* is a function object (has type :c:data:"
"`PyFunction_Type`). The parameter must not be *NULL*."
msgstr ""
#: c-api/function.rst:34
msgid ""
"Return a new function object associated with the code object *code*. "
"*globals* must be a dictionary with the global variables accessible to the "
"function."
msgstr ""
#: c-api/function.rst:37
msgid ""
"The function's docstring, name and *__module__* are retrieved from the code "
"object, the argument defaults and closure are set to *NULL*."
msgstr ""
#: c-api/function.rst:43
msgid "Return the code object associated with the function object *op*."
msgstr ""
#: c-api/function.rst:48
msgid "Return the globals dictionary associated with the function object *op*."
msgstr ""
#: c-api/function.rst:53
msgid ""
"Return the *__module__* attribute of the function object *op*. This is "
"normally a string containing the module name, but can be set to any other "
"object by Python code."
msgstr ""
#: c-api/function.rst:60
msgid ""
"Return the argument default values of the function object *op*. This can be "
"a tuple of arguments or *NULL*."
msgstr ""
#: c-api/function.rst:66
msgid ""
"Set the argument default values for the function object *op*. *defaults* "
"must be *Py_None* or a tuple."
msgstr ""
#: c-api/function.rst:69 c-api/function.rst:83
msgid "Raises :exc:`SystemError` and returns ``-1`` on failure."
msgstr ""
#: c-api/function.rst:74
msgid ""
"Return the closure associated with the function object *op*. This can be "
"*NULL* or a tuple of cell objects."
msgstr ""
#: c-api/function.rst:80
msgid ""
"Set the closure associated with the function object *op*. *closure* must be "
"*Py_None* or a tuple of cell objects."
msgstr ""
#: c-api/gcsupport.rst:6
msgid "Supporting Cyclic Garbage Collection"
msgstr ""
#: c-api/gcsupport.rst:8
msgid ""
"Python's support for detecting and collecting garbage which involves "
"circular references requires support from object types which are \"containers"
"\" for other objects which may also be containers. Types which do not store "
"references to other objects, or which only store references to atomic types "
"(such as numbers or strings), do not need to provide any explicit support "
"for garbage collection."
msgstr ""
#: c-api/gcsupport.rst:18
msgid ""
"To create a container type, the :c:member:`~PyTypeObject.tp_flags` field of "
"the type object must include the :const:`Py_TPFLAGS_HAVE_GC` and provide an "
"implementation of the :c:member:`~PyTypeObject.tp_traverse` handler. If "
"instances of the type are mutable, a :c:member:`~PyTypeObject.tp_clear` "
"implementation must also be provided."
msgstr ""
#: c-api/gcsupport.rst:27
msgid ""
"Objects with a type with this flag set must conform with the rules "
"documented here. For convenience these objects will be referred to as "
"container objects."
msgstr ""
#: c-api/gcsupport.rst:31
msgid "Constructors for container types must conform to two rules:"
msgstr ""
#: c-api/gcsupport.rst:33
msgid ""
"The memory for the object must be allocated using :c:func:`PyObject_GC_New` "
"or :c:func:`PyObject_GC_NewVar`."
msgstr ""
#: c-api/gcsupport.rst:36
msgid ""
"Once all the fields which may contain references to other containers are "
"initialized, it must call :c:func:`PyObject_GC_Track`."
msgstr ""
#: c-api/gcsupport.rst:42
msgid ""
"Analogous to :c:func:`PyObject_New` but for container objects with the :"
"const:`Py_TPFLAGS_HAVE_GC` flag set."
msgstr ""
#: c-api/gcsupport.rst:48
msgid ""
"Analogous to :c:func:`PyObject_NewVar` but for container objects with the :"
"const:`Py_TPFLAGS_HAVE_GC` flag set."
msgstr ""
#: c-api/gcsupport.rst:58
msgid ""
"Resize an object allocated by :c:func:`PyObject_NewVar`. Returns the "
"resized object or *NULL* on failure."
msgstr ""
#: c-api/gcsupport.rst:61 c-api/string.rst:237 c-api/tuple.rst:155
msgid ""
"This function used an :c:type:`int` type for *newsize*. This might require "
"changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/gcsupport.rst:68
msgid ""
"Adds the object *op* to the set of container objects tracked by the "
"collector. The collector can run at unexpected times so objects must be "
"valid while being tracked. This should be called once all the fields "
"followed by the :c:member:`~PyTypeObject.tp_traverse` handler become valid, "
"usually near the end of the constructor."
msgstr ""
#: c-api/gcsupport.rst:77
msgid ""
"A macro version of :c:func:`PyObject_GC_Track`. It should not be used for "
"extension modules."
msgstr ""
#: c-api/gcsupport.rst:80
msgid ""
"Similarly, the deallocator for the object must conform to a similar pair of "
"rules:"
msgstr ""
#: c-api/gcsupport.rst:83
msgid ""
"Before fields which refer to other containers are invalidated, :c:func:"
"`PyObject_GC_UnTrack` must be called."
msgstr ""
#: c-api/gcsupport.rst:86
msgid ""
"The object's memory must be deallocated using :c:func:`PyObject_GC_Del`."
msgstr ""
#: c-api/gcsupport.rst:91
msgid ""
"Releases memory allocated to an object using :c:func:`PyObject_GC_New` or :c:"
"func:`PyObject_GC_NewVar`."
msgstr ""
#: c-api/gcsupport.rst:97
msgid ""
"Remove the object *op* from the set of container objects tracked by the "
"collector. Note that :c:func:`PyObject_GC_Track` can be called again on "
"this object to add it back to the set of tracked objects. The deallocator (:"
"c:member:`~PyTypeObject.tp_dealloc` handler) should call this for the object "
"before any of the fields used by the :c:member:`~PyTypeObject.tp_traverse` "
"handler become invalid."
msgstr ""
#: c-api/gcsupport.rst:106
msgid ""
"A macro version of :c:func:`PyObject_GC_UnTrack`. It should not be used for "
"extension modules."
msgstr ""
#: c-api/gcsupport.rst:109
msgid ""
"The :c:member:`~PyTypeObject.tp_traverse` handler accepts a function "
"parameter of this type:"
msgstr ""
#: c-api/gcsupport.rst:114
msgid ""
"Type of the visitor function passed to the :c:member:`~PyTypeObject."
"tp_traverse` handler. The function should be called with an object to "
"traverse as *object* and the third parameter to the :c:member:`~PyTypeObject."
"tp_traverse` handler as *arg*. The Python core uses several visitor "
"functions to implement cyclic garbage detection; it's not expected that "
"users will need to write their own visitor functions."
msgstr ""
#: c-api/gcsupport.rst:121
msgid ""
"The :c:member:`~PyTypeObject.tp_traverse` handler must have the following "
"type:"
msgstr ""
#: c-api/gcsupport.rst:126
msgid ""
"Traversal function for a container object. Implementations must call the "
"*visit* function for each object directly contained by *self*, with the "
"parameters to *visit* being the contained object and the *arg* value passed "
"to the handler. The *visit* function must not be called with a *NULL* "
"object argument. If *visit* returns a non-zero value that value should be "
"returned immediately."
msgstr ""
#: c-api/gcsupport.rst:133
msgid ""
"To simplify writing :c:member:`~PyTypeObject.tp_traverse` handlers, a :c:"
"func:`Py_VISIT` macro is provided. In order to use this macro, the :c:"
"member:`~PyTypeObject.tp_traverse` implementation must name its arguments "
"exactly *visit* and *arg*:"
msgstr ""
#: c-api/gcsupport.rst:140
msgid ""
"Call the *visit* callback, with arguments *o* and *arg*. If *visit* returns "
"a non-zero value, then return it. Using this macro, :c:member:"
"`~PyTypeObject.tp_traverse` handlers look like::"
msgstr ""
#: c-api/gcsupport.rst:154
msgid ""
"The :c:member:`~PyTypeObject.tp_clear` handler must be of the :c:type:"
"`inquiry` type, or *NULL* if the object is immutable."
msgstr ""
#: c-api/gcsupport.rst:160
msgid ""
"Drop references that may have created reference cycles. Immutable objects "
"do not have to define this method since they can never directly create "
"reference cycles. Note that the object must still be valid after calling "
"this method (don't just call :c:func:`Py_DECREF` on a reference). The "
"collector will call this method if it detects that this object is involved "
"in a reference cycle."
msgstr ""
#: c-api/gen.rst:6
msgid "Generator Objects"
msgstr ""
#: c-api/gen.rst:8
msgid ""
"Generator objects are what Python uses to implement generator iterators. "
"They are normally created by iterating over a function that yields values, "
"rather than explicitly calling :c:func:`PyGen_New`."
msgstr ""
#: c-api/gen.rst:15
msgid "The C structure used for generator objects."
msgstr ""
#: c-api/gen.rst:20
msgid "The type object corresponding to generator objects."
msgstr ""
#: c-api/gen.rst:25
msgid "Return true if *ob* is a generator object; *ob* must not be *NULL*."
msgstr ""
#: c-api/gen.rst:30
msgid ""
"Return true if *ob*'s type is *PyGen_Type* is a generator object; *ob* must "
"not be *NULL*."
msgstr ""
#: c-api/gen.rst:36
msgid ""
"Create and return a new generator object based on the *frame* object. A "
"reference to *frame* is stolen by this function. The parameter must not be "
"*NULL*."
msgstr ""
#: c-api/import.rst:6
msgid "Importing Modules"
msgstr ""
#: c-api/import.rst:16
msgid ""
"This is a simplified interface to :c:func:`PyImport_ImportModuleEx` below, "
"leaving the *globals* and *locals* arguments set to *NULL* and *level* set "
"to 0. When the *name* argument contains a dot (when it specifies a "
"submodule of a package), the *fromlist* argument is set to the list "
"``['*']`` so that the return value is the named module rather than the top-"
"level package containing it as would otherwise be the case. (Unfortunately, "
"this has an additional side effect when *name* in fact specifies a "
"subpackage instead of a submodule: the submodules specified in the package's "
"``__all__`` variable are loaded.) Return a new reference to the imported "
"module, or *NULL* with an exception set on failure. Before Python 2.4, the "
"module may still be created in the failure case --- examine ``sys.modules`` "
"to find out. Starting with Python 2.4, a failing import of a module no "
"longer leaves the module in ``sys.modules``."
msgstr ""
#: c-api/import.rst:30 c-api/import.rst:64
msgid "Failing imports remove incomplete module objects."
msgstr ""
#: c-api/import.rst:33 c-api/import.rst:97
msgid "Always uses absolute imports."
msgstr ""
#: c-api/import.rst:39
msgid ""
"This version of :c:func:`PyImport_ImportModule` does not block. It's "
"intended to be used in C functions that import other modules to execute a "
"function. The import may block if another thread holds the import lock. The "
"function :c:func:`PyImport_ImportModuleNoBlock` never blocks. It first tries "
"to fetch the module from sys.modules and falls back to :c:func:"
"`PyImport_ImportModule` unless the lock is held, in which case the function "
"will raise an :exc:`ImportError`."
msgstr ""
#: c-api/import.rst:54 c-api/import.rst:74
msgid ""
"Import a module. This is best described by referring to the built-in Python "
"function :func:`__import__`, as the standard :func:`__import__` function "
"calls this function directly."
msgstr ""
#: c-api/import.rst:58
msgid ""
"The return value is a new reference to the imported module or top-level "
"package, or *NULL* with an exception set on failure (before Python 2.4, the "
"module may still be created in this case). Like for :func:`__import__`, the "
"return value when a submodule of a package was requested is normally the top-"
"level package, unless a non-empty *fromlist* was given."
msgstr ""
#: c-api/import.rst:67
msgid ""
"The function is an alias for :c:func:`PyImport_ImportModuleLevel` with -1 as "
"level, meaning relative import."
msgstr ""
#: c-api/import.rst:78
msgid ""
"The return value is a new reference to the imported module or top-level "
"package, or *NULL* with an exception set on failure. Like for :func:"
"`__import__`, the return value when a submodule of a package was requested "
"is normally the top-level package, unless a non-empty *fromlist* was given."
msgstr ""
#: c-api/import.rst:92
msgid ""
"This is a higher-level interface that calls the current \"import hook "
"function\". It invokes the :func:`__import__` function from the "
"``__builtins__`` of the current globals. This means that the import is done "
"using whatever import hooks are installed in the current environment, e.g. "
"by :mod:`rexec` or :mod:`ihooks`."
msgstr ""
#: c-api/import.rst:105
msgid ""
"Reload a module. This is best described by referring to the built-in Python "
"function :func:`reload`, as the standard :func:`reload` function calls this "
"function directly. Return a new reference to the reloaded module, or *NULL* "
"with an exception set on failure (the module still exists in this case)."
msgstr ""
#: c-api/import.rst:113
msgid ""
"Return the module object corresponding to a module name. The *name* "
"argument may be of the form ``package.module``. First check the modules "
"dictionary if there's one there, and if not, create a new one and insert it "
"in the modules dictionary. Return *NULL* with an exception set on failure."
msgstr ""
#: c-api/import.rst:120
msgid ""
"This function does not load or import the module; if the module wasn't "
"already loaded, you will get an empty module object. Use :c:func:"
"`PyImport_ImportModule` or one of its variants to import a module. Package "
"structures implied by a dotted name for *name* are not created if not "
"already present."
msgstr ""
#: c-api/import.rst:130
msgid ""
"Given a module name (possibly of the form ``package.module``) and a code "
"object read from a Python bytecode file or obtained from the built-in "
"function :func:`compile`, load the module. Return a new reference to the "
"module object, or *NULL* with an exception set if an error occurred. Before "
"Python 2.4, the module could still be created in error cases. Starting with "
"Python 2.4, *name* is removed from :attr:`sys.modules` in error cases, and "
"even if *name* was already in :attr:`sys.modules` on entry to :c:func:"
"`PyImport_ExecCodeModule`. Leaving incompletely initialized modules in :"
"attr:`sys.modules` is dangerous, as imports of such modules have no way to "
"know that the module object is an unknown (and probably damaged with respect "
"to the module author's intents) state."
msgstr ""
#: c-api/import.rst:141
msgid ""
"The module's :attr:`__file__` attribute will be set to the code object's :c:"
"member:`co_filename`."
msgstr ""
#: c-api/import.rst:144
msgid ""
"This function will reload the module if it was already imported. See :c:"
"func:`PyImport_ReloadModule` for the intended way to reload a module."
msgstr ""
#: c-api/import.rst:147
msgid ""
"If *name* points to a dotted name of the form ``package.module``, any "
"package structures not already created will still not be created."
msgstr ""
#: c-api/import.rst:150
msgid "*name* is removed from :attr:`sys.modules` in error cases."
msgstr ""
#: c-api/import.rst:156
msgid ""
"Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute "
"of the module object is set to *pathname* if it is non-``NULL``."
msgstr ""
#: c-api/import.rst:162
msgid ""
"Return the magic number for Python bytecode files (a.k.a. :file:`.pyc` and :"
"file:`.pyo` files). The magic number should be present in the first four "
"bytes of the bytecode file, in little-endian byte order."
msgstr ""
#: c-api/import.rst:169
msgid ""
"Return the dictionary used for the module administration (a.k.a. ``sys."
"modules``). Note that this is a per-interpreter variable."
msgstr ""
#: c-api/import.rst:175
msgid ""
"Return an importer object for a :data:`sys.path`/:attr:`pkg.__path__` item "
"*path*, possibly by fetching it from the :data:`sys.path_importer_cache` "
"dict. If it wasn't yet cached, traverse :data:`sys.path_hooks` until a hook "
"is found that can handle the path item. Return ``None`` if no hook could; "
"this tells our caller it should fall back to the built-in import mechanism. "
"Cache the result in :data:`sys.path_importer_cache`. Return a new reference "
"to the importer object."
msgstr ""
#: c-api/import.rst:188
msgid "Initialize the import mechanism. For internal use only."
msgstr ""
#: c-api/import.rst:193
msgid "Empty the module table. For internal use only."
msgstr ""
#: c-api/import.rst:198
msgid "Finalize the import mechanism. For internal use only."
msgstr ""
#: c-api/import.rst:203 c-api/import.rst:208
msgid "For internal use only."
msgstr ""
#: c-api/import.rst:213
msgid ""
"Load a frozen module named *name*. Return ``1`` for success, ``0`` if the "
"module is not found, and ``-1`` with an exception set if the initialization "
"failed. To access the imported module on a successful load, use :c:func:"
"`PyImport_ImportModule`. (Note the misnomer --- this function would reload "
"the module if it was already imported.)"
msgstr ""
#: c-api/import.rst:224
msgid ""
"This is the structure type definition for frozen module descriptors, as "
"generated by the :program:`freeze` utility (see :file:`Tools/freeze/` in the "
"Python source distribution). Its definition, found in :file:`Include/import."
"h`, is::"
msgstr ""
#: c-api/import.rst:238
msgid ""
"This pointer is initialized to point to an array of :c:type:`struct _frozen` "
"records, terminated by one whose members are all *NULL* or zero. When a "
"frozen module is imported, it is searched in this table. Third-party code "
"could play tricks with this to provide a dynamically created collection of "
"frozen modules."
msgstr ""
#: c-api/import.rst:246
msgid ""
"Add a single module to the existing table of built-in modules. This is a "
"convenience wrapper around :c:func:`PyImport_ExtendInittab`, returning "
"``-1`` if the table could not be extended. The new module can be imported "
"by the name *name*, and uses the function *initfunc* as the initialization "
"function called on the first attempted import. This should be called "
"before :c:func:`Py_Initialize`."
msgstr ""
#: c-api/import.rst:256
msgid ""
"Structure describing a single entry in the list of built-in modules. Each "
"of these structures gives the name and initialization function for a module "
"built into the interpreter. Programs which embed Python may use an array of "
"these structures in conjunction with :c:func:`PyImport_ExtendInittab` to "
"provide additional built-in modules. The structure is defined in :file:"
"`Include/import.h` as::"
msgstr ""
#: c-api/import.rst:271
msgid ""
"Add a collection of modules to the table of built-in modules. The *newtab* "
"array must end with a sentinel entry which contains *NULL* for the :attr:"
"`name` field; failure to provide the sentinel value can result in a memory "
"fault. Returns ``0`` on success or ``-1`` if insufficient memory could be "
"allocated to extend the internal table. In the event of failure, no modules "
"are added to the internal table. This should be called before :c:func:"
"`Py_Initialize`."
msgstr ""
#: c-api/index.rst:5
msgid "Python/C API Reference Manual"
msgstr ""
#: c-api/index.rst:7
msgid ""
"This manual documents the API used by C and C++ programmers who want to "
"write extension modules or embed Python. It is a companion to :ref:"
"`extending-index`, which describes the general principles of extension "
"writing but does not document the API functions in detail."
msgstr ""
#: c-api/init.rst:8
msgid "Initialization, Finalization, and Threads"
msgstr ""
#: c-api/init.rst:12
msgid "Initializing and finalizing the interpreter"
msgstr ""
#: c-api/init.rst:32
msgid ""
"Initialize the Python interpreter. In an application embedding Python, "
"this should be called before using any other Python/C API functions; with "
"the exception of :c:func:`Py_SetProgramName`, :c:func:`Py_SetPythonHome`, :c:"
"func:`PyEval_InitThreads`, :c:func:`PyEval_ReleaseLock`, and :c:func:"
"`PyEval_AcquireLock`. This initializes the table of loaded modules (``sys."
"modules``), and creates the fundamental modules :mod:`__builtin__`, :mod:"
"`__main__` and :mod:`sys`. It also initializes the module search path "
"(``sys.path``). It does not set ``sys.argv``; use :c:func:`PySys_SetArgvEx` "
"for that. This is a no-op when called for a second time (without calling :c:"
"func:`Py_Finalize` first). There is no return value; it is a fatal error if "
"the initialization fails."
msgstr ""
#: c-api/init.rst:46
msgid ""
"This function works like :c:func:`Py_Initialize` if *initsigs* is 1. If "
"*initsigs* is 0, it skips initialization registration of signal handlers, "
"which might be useful when Python is embedded."
msgstr ""
#: c-api/init.rst:55
msgid ""
"Return true (nonzero) when the Python interpreter has been initialized, "
"false (zero) if not. After :c:func:`Py_Finalize` is called, this returns "
"false until :c:func:`Py_Initialize` is called again."
msgstr ""
#: c-api/init.rst:62
msgid ""
"Undo all initializations made by :c:func:`Py_Initialize` and subsequent use "
"of Python/C API functions, and destroy all sub-interpreters (see :c:func:"
"`Py_NewInterpreter` below) that were created and not yet destroyed since the "
"last call to :c:func:`Py_Initialize`. Ideally, this frees all memory "
"allocated by the Python interpreter. This is a no-op when called for a "
"second time (without calling :c:func:`Py_Initialize` again first). There is "
"no return value; errors during finalization are ignored."
msgstr ""
#: c-api/init.rst:70
msgid ""
"This function is provided for a number of reasons. An embedding application "
"might want to restart Python without having to restart the application "
"itself. An application that has loaded the Python interpreter from a "
"dynamically loadable library (or DLL) might want to free all memory "
"allocated by Python before unloading the DLL. During a hunt for memory leaks "
"in an application a developer might want to free all memory allocated by "
"Python before exiting from the application."
msgstr ""
#: c-api/init.rst:78
msgid ""
"**Bugs and caveats:** The destruction of modules and objects in modules is "
"done in random order; this may cause destructors (:meth:`__del__` methods) "
"to fail when they depend on other objects (even functions) or modules. "
"Dynamically loaded extension modules loaded by Python are not unloaded. "
"Small amounts of memory allocated by the Python interpreter may not be freed "
"(if you find a leak, please report it). Memory tied up in circular "
"references between objects is not freed. Some memory allocated by extension "
"modules may not be freed. Some extensions may not work properly if their "
"initialization routine is called more than once; this can happen if an "
"application calls :c:func:`Py_Initialize` and :c:func:`Py_Finalize` more "
"than once."
msgstr ""
#: c-api/init.rst:91
msgid "Process-wide parameters"
msgstr ""
#: c-api/init.rst:101
msgid ""
"This function should be called before :c:func:`Py_Initialize` is called for "
"the first time, if it is called at all. It tells the interpreter the value "
"of the ``argv[0]`` argument to the :c:func:`main` function of the program. "
"This is used by :c:func:`Py_GetPath` and some other functions below to find "
"the Python run-time libraries relative to the interpreter executable. The "
"default value is ``'python'``. The argument should point to a zero-"
"terminated character string in static storage whose contents will not change "
"for the duration of the program's execution. No code in the Python "
"interpreter will change the contents of this storage."
msgstr ""
#: c-api/init.rst:116
msgid ""
"Return the program name set with :c:func:`Py_SetProgramName`, or the "
"default. The returned string points into static storage; the caller should "
"not modify its value."
msgstr ""
#: c-api/init.rst:123
msgid ""
"Return the *prefix* for installed platform-independent files. This is "
"derived through a number of complicated rules from the program name set "
"with :c:func:`Py_SetProgramName` and some environment variables; for "
"example, if the program name is ``'/usr/local/bin/python'``, the prefix is "
"``'/usr/local'``. The returned string points into static storage; the caller "
"should not modify its value. This corresponds to the :makevar:`prefix` "
"variable in the top-level :file:`Makefile` and the ``--prefix`` argument to "
"the :program:`configure` script at build time. The value is available to "
"Python code as ``sys.prefix``. It is only useful on Unix. See also the next "
"function."
msgstr ""
#: c-api/init.rst:136
msgid ""
"Return the *exec-prefix* for installed platform-*dependent* files. This is "
"derived through a number of complicated rules from the program name set "
"with :c:func:`Py_SetProgramName` and some environment variables; for "
"example, if the program name is ``'/usr/local/bin/python'``, the exec-prefix "
"is ``'/usr/local'``. The returned string points into static storage; the "
"caller should not modify its value. This corresponds to the :makevar:"
"`exec_prefix` variable in the top-level :file:`Makefile` and the ``--exec-"
"prefix`` argument to the :program:`configure` script at build time. The "
"value is available to Python code as ``sys.exec_prefix``. It is only useful "
"on Unix."
msgstr ""
#: c-api/init.rst:146
msgid ""
"Background: The exec-prefix differs from the prefix when platform dependent "
"files (such as executables and shared libraries) are installed in a "
"different directory tree. In a typical installation, platform dependent "
"files may be installed in the :file:`/usr/local/plat` subtree while platform "
"independent may be installed in :file:`/usr/local`."
msgstr ""
#: c-api/init.rst:152
msgid ""
"Generally speaking, a platform is a combination of hardware and software "
"families, e.g. Sparc machines running the Solaris 2.x operating system are "
"considered the same platform, but Intel machines running Solaris 2.x are "
"another platform, and Intel machines running Linux are yet another "
"platform. Different major revisions of the same operating system generally "
"also form different platforms. Non-Unix operating systems are a different "
"story; the installation strategies on those systems are so different that "
"the prefix and exec-prefix are meaningless, and set to the empty string. "
"Note that compiled Python bytecode files are platform independent (but not "
"independent from the Python version by which they were compiled!)."
msgstr ""
#: c-api/init.rst:163
msgid ""
"System administrators will know how to configure the :program:`mount` or :"
"program:`automount` programs to share :file:`/usr/local` between platforms "
"while having :file:`/usr/local/plat` be a different filesystem for each "
"platform."
msgstr ""
#: c-api/init.rst:175
msgid ""
"Return the full program name of the Python executable; this is computed as "
"a side-effect of deriving the default module search path from the program "
"name (set by :c:func:`Py_SetProgramName` above). The returned string points "
"into static storage; the caller should not modify its value. The value is "
"available to Python code as ``sys.executable``."
msgstr ""
#: c-api/init.rst:188
msgid ""
"Return the default module search path; this is computed from the program "
"name (set by :c:func:`Py_SetProgramName` above) and some environment "
"variables. The returned string consists of a series of directory names "
"separated by a platform dependent delimiter character. The delimiter "
"character is ``':'`` on Unix and Mac OS X, ``';'`` on Windows. The returned "
"string points into static storage; the caller should not modify its value. "
"The list :data:`sys.path` is initialized with this value on interpreter "
"startup; it can be (and usually is) modified later to change the search path "
"for loading modules."
msgstr ""
#: c-api/init.rst:203
msgid ""
"Return the version of this Python interpreter. This is a string that looks "
"something like ::"
msgstr ""
#: c-api/init.rst:210
msgid ""
"The first word (up to the first space character) is the current Python "
"version; the first three characters are the major and minor version "
"separated by a period. The returned string points into static storage; the "
"caller should not modify its value. The value is available to Python code "
"as ``sys.version``."
msgstr ""
#: c-api/init.rst:220
msgid ""
"Return the platform identifier for the current platform. On Unix, this is "
"formed from the \"official\" name of the operating system, converted to "
"lower case, followed by the major revision number; e.g., for Solaris 2.x, "
"which is also known as SunOS 5.x, the value is ``'sunos5'``. On Mac OS X, "
"it is ``'darwin'``. On Windows, it is ``'win'``. The returned string "
"points into static storage; the caller should not modify its value. The "
"value is available to Python code as ``sys.platform``."
msgstr ""
#: c-api/init.rst:231
msgid ""
"Return the official copyright string for the current Python version, for "
"example"
msgstr ""
#: c-api/init.rst:233
msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``"
msgstr ""
#: c-api/init.rst:237
msgid ""
"The returned string points into static storage; the caller should not modify "
"its value. The value is available to Python code as ``sys.copyright``."
msgstr ""
#: c-api/init.rst:243
msgid ""
"Return an indication of the compiler used to build the current Python "
"version, in square brackets, for example::"
msgstr ""
#: c-api/init.rst:250 c-api/init.rst:264
msgid ""
"The returned string points into static storage; the caller should not modify "
"its value. The value is available to Python code as part of the variable "
"``sys.version``."
msgstr ""
#: c-api/init.rst:257
msgid ""
"Return information about the sequence number and build date and time of the "
"current Python interpreter instance, for example ::"
msgstr ""
#: c-api/init.rst:276
msgid ""
"Set :data:`sys.argv` based on *argc* and *argv*. These parameters are "
"similar to those passed to the program's :c:func:`main` function with the "
"difference that the first entry should refer to the script file to be "
"executed rather than the executable hosting the Python interpreter. If "
"there isn't a script that will be run, the first entry in *argv* can be an "
"empty string. If this function fails to initialize :data:`sys.argv`, a "
"fatal condition is signalled using :c:func:`Py_FatalError`."
msgstr ""
#: c-api/init.rst:284
msgid ""
"If *updatepath* is zero, this is all the function does. If *updatepath* is "
"non-zero, the function also modifies :data:`sys.path` according to the "
"following algorithm:"
msgstr ""
#: c-api/init.rst:288
msgid ""
"If the name of an existing script is passed in ``argv[0]``, the absolute "
"path of the directory where the script is located is prepended to :data:`sys."
"path`."
msgstr ""
#: c-api/init.rst:291
msgid ""
"Otherwise (that is, if *argc* is 0 or ``argv[0]`` doesn't point to an "
"existing file name), an empty string is prepended to :data:`sys.path`, which "
"is the same as prepending the current working directory (``\".\"``)."
msgstr ""
#: c-api/init.rst:297
msgid ""
"It is recommended that applications embedding the Python interpreter for "
"purposes other than executing a single script pass 0 as *updatepath*, and "
"update :data:`sys.path` themselves if desired. See `CVE-2008-5983 <http://"
"cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983>`_."
msgstr ""
#: c-api/init.rst:302
msgid ""
"On versions before 2.6.6, you can achieve the same effect by manually "
"popping the first :data:`sys.path` element after having called :c:func:"
"`PySys_SetArgv`, for example using::"
msgstr ""
#: c-api/init.rst:316
msgid ""
"This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to "
"1."
msgstr ""
#: c-api/init.rst:321
msgid ""
"Set the default \"home\" directory, that is, the location of the standard "
"Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument "
"string."
msgstr ""
#: c-api/init.rst:325
msgid ""
"The argument should point to a zero-terminated character string in static "
"storage whose contents will not change for the duration of the program's "
"execution. No code in the Python interpreter will change the contents of "
"this storage."
msgstr ""
#: c-api/init.rst:333
msgid ""
"Return the default \"home\", that is, the value set by a previous call to :c:"
"func:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME` "
"environment variable if it is set."
msgstr ""
#: c-api/init.rst:341
msgid "Thread State and the Global Interpreter Lock"
msgstr ""
#: c-api/init.rst:349
msgid ""
"The Python interpreter is not fully thread-safe. In order to support multi-"
"threaded Python programs, there's a global lock, called the :term:`global "
"interpreter lock` or :term:`GIL`, that must be held by the current thread "
"before it can safely access Python objects. Without the lock, even the "
"simplest operations could cause problems in a multi-threaded program: for "
"example, when two threads simultaneously increment the reference count of "
"the same object, the reference count could end up being incremented only "
"once instead of twice."
msgstr ""
#: c-api/init.rst:359
msgid ""
"Therefore, the rule exists that only the thread that has acquired the :term:"
"`GIL` may operate on Python objects or call Python/C API functions. In order "
"to emulate concurrency of execution, the interpreter regularly tries to "
"switch threads (see :func:`sys.setcheckinterval`). The lock is also "
"released around potentially blocking I/O operations like reading or writing "
"a file, so that other Python threads can run in the meantime."
msgstr ""
#: c-api/init.rst:370
msgid ""
"The Python interpreter keeps some thread-specific bookkeeping information "
"inside a data structure called :c:type:`PyThreadState`. There's also one "
"global variable pointing to the current :c:type:`PyThreadState`: it can be "
"retrieved using :c:func:`PyThreadState_Get`."
msgstr ""
#: c-api/init.rst:376
msgid "Releasing the GIL from extension code"
msgstr ""
#: c-api/init.rst:378
msgid ""
"Most extension code manipulating the :term:`GIL` has the following simple "
"structure::"
msgstr ""
#: c-api/init.rst:387
msgid "This is so common that a pair of macros exists to simplify it::"
msgstr ""
#: c-api/init.rst:397
msgid ""
"The :c:macro:`Py_BEGIN_ALLOW_THREADS` macro opens a new block and declares a "
"hidden local variable; the :c:macro:`Py_END_ALLOW_THREADS` macro closes the "
"block. These two macros are still available when Python is compiled without "
"thread support (they simply have an empty expansion)."
msgstr ""
#: c-api/init.rst:402
msgid ""
"When thread support is enabled, the block above expands to the following "
"code::"
msgstr ""
#: c-api/init.rst:414
msgid ""
"Here is how these functions work: the global interpreter lock is used to "
"protect the pointer to the current thread state. When releasing the lock "
"and saving the thread state, the current thread state pointer must be "
"retrieved before the lock is released (since another thread could "
"immediately acquire the lock and store its own thread state in the global "
"variable). Conversely, when acquiring the lock and restoring the thread "
"state, the lock must be acquired before storing the thread state pointer."
msgstr ""
#: c-api/init.rst:423
msgid ""
"Calling system I/O functions is the most common use case for releasing the "
"GIL, but it can also be useful before calling long-running computations "
"which don't need access to Python objects, such as compression or "
"cryptographic functions operating over memory buffers. For example, the "
"standard :mod:`zlib` and :mod:`hashlib` modules release the GIL when "
"compressing or hashing data."
msgstr ""
#: c-api/init.rst:434
msgid "Non-Python created threads"
msgstr ""
#: c-api/init.rst:436
msgid ""
"When threads are created using the dedicated Python APIs (such as the :mod:"
"`threading` module), a thread state is automatically associated to them and "
"the code showed above is therefore correct. However, when threads are "
"created from C (for example by a third-party library with its own thread "
"management), they don't hold the GIL, nor is there a thread state structure "
"for them."
msgstr ""
#: c-api/init.rst:443
msgid ""
"If you need to call Python code from these threads (often this will be part "
"of a callback API provided by the aforementioned third-party library), you "
"must first register these threads with the interpreter by creating a thread "
"state data structure, then acquiring the GIL, and finally storing their "
"thread state pointer, before you can start using the Python/C API. When you "
"are done, you should reset the thread state pointer, release the GIL, and "
"finally free the thread state data structure."
msgstr ""
#: c-api/init.rst:451
msgid ""
"The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions "
"do all of the above automatically. The typical idiom for calling into "
"Python from a C thread is::"
msgstr ""
#: c-api/init.rst:465
msgid ""
"Note that the :c:func:`PyGILState_\\*` functions assume there is only one "
"global interpreter (created automatically by :c:func:`Py_Initialize`). "
"Python supports the creation of additional interpreters (using :c:func:"
"`Py_NewInterpreter`), but mixing multiple interpreters and the :c:func:"
"`PyGILState_\\*` API is unsupported."
msgstr ""
#: c-api/init.rst:471
msgid ""
"Another important thing to note about threads is their behaviour in the face "
"of the C :c:func:`fork` call. On most systems with :c:func:`fork`, after a "
"process forks only the thread that issued the fork will exist. That also "
"means any locks held by other threads will never be released. Python solves "
"this for :func:`os.fork` by acquiring the locks it uses internally before "
"the fork, and releasing them afterwards. In addition, it resets any :ref:"
"`lock-objects` in the child. When extending or embedding Python, there is no "
"way to inform Python of additional (non-Python) locks that need to be "
"acquired before or reset after a fork. OS facilities such as :c:func:"
"`pthread_atfork` would need to be used to accomplish the same thing. "
"Additionally, when extending or embedding Python, calling :c:func:`fork` "
"directly rather than through :func:`os.fork` (and returning to or calling "
"into Python) may result in a deadlock by one of Python's internal locks "
"being held by a thread that is defunct after the fork. :c:func:"
"`PyOS_AfterFork` tries to reset the necessary locks, but is not always able "
"to."
msgstr ""
#: c-api/init.rst:490
msgid "High-level API"
msgstr ""
#: c-api/init.rst:492
msgid ""
"These are the most commonly used types and functions when writing C "
"extension code, or when embedding the Python interpreter:"
msgstr ""
#: c-api/init.rst:497
msgid ""
"This data structure represents the state shared by a number of cooperating "
"threads. Threads belonging to the same interpreter share their module "
"administration and a few other internal items. There are no public members "
"in this structure."
msgstr ""
#: c-api/init.rst:502
msgid ""
"Threads belonging to different interpreters initially share nothing, except "
"process state like available memory, open file descriptors and such. The "
"global interpreter lock is also shared by all threads, regardless of to "
"which interpreter they belong."
msgstr ""
#: c-api/init.rst:510
msgid ""
"This data structure represents the state of a single thread. The only "
"public data member is :c:type:`PyInterpreterState \\*`:attr:`interp`, which "
"points to this thread's interpreter state."
msgstr ""
#: c-api/init.rst:523
msgid ""
"Initialize and acquire the global interpreter lock. It should be called in "
"the main thread before creating a second thread or engaging in any other "
"thread operations such as :c:func:`PyEval_ReleaseLock` or "
"``PyEval_ReleaseThread(tstate)``. It is not needed before calling :c:func:"
"`PyEval_SaveThread` or :c:func:`PyEval_RestoreThread`."
msgstr ""
#: c-api/init.rst:531
msgid ""
"This is a no-op when called for a second time. It is safe to call this "
"function before calling :c:func:`Py_Initialize`."
msgstr ""
#: c-api/init.rst:538
msgid ""
"When only the main thread exists, no GIL operations are needed. This is a "
"common situation (most Python programs do not use threads), and the lock "
"operations slow the interpreter down a bit. Therefore, the lock is not "
"created initially. This situation is equivalent to having acquired the "
"lock: when there is only a single thread, all object accesses are safe. "
"Therefore, when this function initializes the global interpreter lock, it "
"also acquires it. Before the Python :mod:`_thread` module creates a new "
"thread, knowing that either it has the lock or the lock hasn't been created "
"yet, it calls :c:func:`PyEval_InitThreads`. When this call returns, it is "
"guaranteed that the lock has been created and that the calling thread has "
"acquired it."
msgstr ""
#: c-api/init.rst:549
msgid ""
"It is **not** safe to call this function when it is unknown which thread (if "
"any) currently has the global interpreter lock."
msgstr ""
#: c-api/init.rst:552
msgid ""
"This function is not available when thread support is disabled at compile "
"time."
msgstr ""
#: c-api/init.rst:557
msgid ""
"Returns a non-zero value if :c:func:`PyEval_InitThreads` has been called. "
"This function can be called without holding the GIL, and therefore can be "
"used to avoid calls to the locking API when running single-threaded. This "
"function is not available when thread support is disabled at compile time."
msgstr ""
#: c-api/init.rst:567
msgid ""
"Release the global interpreter lock (if it has been created and thread "
"support is enabled) and reset the thread state to *NULL*, returning the "
"previous thread state (which is not *NULL*). If the lock has been created, "
"the current thread must have acquired it. (This function is available even "
"when thread support is disabled at compile time.)"
msgstr ""
#: c-api/init.rst:576
msgid ""
"Acquire the global interpreter lock (if it has been created and thread "
"support is enabled) and set the thread state to *tstate*, which must not be "
"*NULL*. If the lock has been created, the current thread must not have "
"acquired it, otherwise deadlock ensues. (This function is available even "
"when thread support is disabled at compile time.)"
msgstr ""
#: c-api/init.rst:585
msgid ""
"Return the current thread state. The global interpreter lock must be held. "
"When the current thread state is *NULL*, this issues a fatal error (so that "
"the caller needn't check for *NULL*)."
msgstr ""
#: c-api/init.rst:592
msgid ""
"Swap the current thread state with the thread state given by the argument "
"*tstate*, which may be *NULL*. The global interpreter lock must be held and "
"is not released."
msgstr ""
#: c-api/init.rst:599
msgid ""
"This function is called from :c:func:`PyOS_AfterFork` to ensure that newly "
"created child processes don't hold locks referring to threads which are not "
"running in the child process."
msgstr ""
#: c-api/init.rst:604
msgid ""
"The following functions use thread-local storage, and are not compatible "
"with sub-interpreters:"
msgstr ""
#: c-api/init.rst:609
msgid ""
"Ensure that the current thread is ready to call the Python C API regardless "
"of the current state of Python, or of the global interpreter lock. This may "
"be called as many times as desired by a thread as long as each call is "
"matched with a call to :c:func:`PyGILState_Release`. In general, other "
"thread-related APIs may be used between :c:func:`PyGILState_Ensure` and :c:"
"func:`PyGILState_Release` calls as long as the thread state is restored to "
"its previous state before the Release(). For example, normal usage of the :"
"c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS` macros "
"is acceptable."
msgstr ""
#: c-api/init.rst:619
msgid ""
"The return value is an opaque \"handle\" to the thread state when :c:func:"
"`PyGILState_Ensure` was called, and must be passed to :c:func:"
"`PyGILState_Release` to ensure Python is left in the same state. Even though "
"recursive calls are allowed, these handles *cannot* be shared - each unique "
"call to :c:func:`PyGILState_Ensure` must save the handle for its call to :c:"
"func:`PyGILState_Release`."
msgstr ""
#: c-api/init.rst:626
msgid ""
"When the function returns, the current thread will hold the GIL and be able "
"to call arbitrary Python code. Failure is a fatal error."
msgstr ""
#: c-api/init.rst:634
msgid ""
"Release any resources previously acquired. After this call, Python's state "
"will be the same as it was prior to the corresponding :c:func:"
"`PyGILState_Ensure` call (but generally this state will be unknown to the "
"caller, hence the use of the GILState API)."
msgstr ""
#: c-api/init.rst:639
msgid ""
"Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:"
"func:`PyGILState_Release` on the same thread."
msgstr ""
#: c-api/init.rst:647
msgid ""
"Get the current thread state for this thread. May return ``NULL`` if no "
"GILState API has been used on the current thread. Note that the main thread "
"always has such a thread-state, even if no auto-thread-state call has been "
"made on the main thread. This is mainly a helper/diagnostic function."
msgstr ""
#: c-api/init.rst:655
msgid ""
"The following macros are normally used without a trailing semicolon; look "
"for example usage in the Python source distribution."
msgstr ""
#: c-api/init.rst:661
msgid ""
"This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();"
"``. Note that it contains an opening brace; it must be matched with a "
"following :c:macro:`Py_END_ALLOW_THREADS` macro. See above for further "
"discussion of this macro. It is a no-op when thread support is disabled at "
"compile time."
msgstr ""
#: c-api/init.rst:669
msgid ""
"This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it "
"contains a closing brace; it must be matched with an earlier :c:macro:"
"`Py_BEGIN_ALLOW_THREADS` macro. See above for further discussion of this "
"macro. It is a no-op when thread support is disabled at compile time."
msgstr ""
#: c-api/init.rst:677
msgid ""
"This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :"
"c:macro:`Py_END_ALLOW_THREADS` without the closing brace. It is a no-op "
"when thread support is disabled at compile time."
msgstr ""
#: c-api/init.rst:684
msgid ""
"This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :"
"c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable "
"declaration. It is a no-op when thread support is disabled at compile time."
msgstr ""
#: c-api/init.rst:690
msgid "Low-level API"
msgstr ""
#: c-api/init.rst:692
msgid ""
"All of the following functions are only available when thread support is "
"enabled at compile time, and must be called only when the global interpreter "
"lock has been created."
msgstr ""
#: c-api/init.rst:699
msgid ""
"Create a new interpreter state object. The global interpreter lock need not "
"be held, but may be held if it is necessary to serialize calls to this "
"function."
msgstr ""
#: c-api/init.rst:706
msgid ""
"Reset all information in an interpreter state object. The global "
"interpreter lock must be held."
msgstr ""
#: c-api/init.rst:712
msgid ""
"Destroy an interpreter state object. The global interpreter lock need not "
"be held. The interpreter state must have been reset with a previous call "
"to :c:func:`PyInterpreterState_Clear`."
msgstr ""
#: c-api/init.rst:719
msgid ""
"Create a new thread state object belonging to the given interpreter object. "
"The global interpreter lock need not be held, but may be held if it is "
"necessary to serialize calls to this function."
msgstr ""
#: c-api/init.rst:726
msgid ""
"Reset all information in a thread state object. The global interpreter lock "
"must be held."
msgstr ""
#: c-api/init.rst:732
msgid ""
"Destroy a thread state object. The global interpreter lock need not be "
"held. The thread state must have been reset with a previous call to :c:func:"
"`PyThreadState_Clear`."
msgstr ""
#: c-api/init.rst:739
msgid ""
"Return a dictionary in which extensions can store thread-specific state "
"information. Each extension should use a unique key to use to store state "
"in the dictionary. It is okay to call this function when no current thread "
"state is available. If this function returns *NULL*, no exception has been "
"raised and the caller should assume no current thread state is available."
msgstr ""
#: c-api/init.rst:745
msgid ""
"Previously this could only be called when a current thread is active, and "
"*NULL* meant that an exception was raised."
msgstr ""
#: c-api/init.rst:752
msgid ""
"Asynchronously raise an exception in a thread. The *id* argument is the "
"thread id of the target thread; *exc* is the exception object to be raised. "
"This function does not steal any references to *exc*. To prevent naive "
"misuse, you must write your own C extension to call this. Must be called "
"with the GIL held. Returns the number of thread states modified; this is "
"normally one, but will be zero if the thread id isn't found. If *exc* is :"
"const:`NULL`, the pending exception (if any) for the thread is cleared. This "
"raises no exceptions."
msgstr ""
#: c-api/init.rst:765
msgid ""
"Acquire the global interpreter lock and set the current thread state to "
"*tstate*, which should not be *NULL*. The lock must have been created "
"earlier. If this thread already has the lock, deadlock ensues."
msgstr ""
#: c-api/init.rst:769
msgid ""
":c:func:`PyEval_RestoreThread` is a higher-level function which is always "
"available (even when thread support isn't enabled or when threads have not "
"been initialized)."
msgstr ""
#: c-api/init.rst:776
msgid ""
"Reset the current thread state to *NULL* and release the global interpreter "
"lock. The lock must have been created earlier and must be held by the "
"current thread. The *tstate* argument, which must not be *NULL*, is only "
"used to check that it represents the current thread state --- if it isn't, a "
"fatal error is reported."
msgstr ""
#: c-api/init.rst:782
msgid ""
":c:func:`PyEval_SaveThread` is a higher-level function which is always "
"available (even when thread support isn't enabled or when threads have not "
"been initialized)."
msgstr ""
#: c-api/init.rst:789
msgid ""
"Acquire the global interpreter lock. The lock must have been created "
"earlier. If this thread already has the lock, a deadlock ensues."
msgstr ""
#: c-api/init.rst:793
msgid ""
"This function does not change the current thread state. Please use :c:func:"
"`PyEval_RestoreThread` or :c:func:`PyEval_AcquireThread` instead."
msgstr ""
#: c-api/init.rst:800
msgid ""
"Release the global interpreter lock. The lock must have been created "
"earlier."
msgstr ""
#: c-api/init.rst:803
msgid ""
"This function does not change the current thread state. Please use :c:func:"
"`PyEval_SaveThread` or :c:func:`PyEval_ReleaseThread` instead."
msgstr ""
#: c-api/init.rst:809
msgid "Sub-interpreter support"
msgstr ""
#: c-api/init.rst:811
msgid ""
"While in most uses, you will only embed a single Python interpreter, there "
"are cases where you need to create several independent interpreters in the "
"same process and perhaps even in the same thread. Sub-interpreters allow "
"you to do that. You can switch between sub-interpreters using the :c:func:"
"`PyThreadState_Swap` function. You can create and destroy them using the "
"following functions:"
msgstr ""
#: c-api/init.rst:829
msgid ""
"Create a new sub-interpreter. This is an (almost) totally separate "
"environment for the execution of Python code. In particular, the new "
"interpreter has separate, independent versions of all imported modules, "
"including the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:"
"`sys`. The table of loaded modules (``sys.modules``) and the module search "
"path (``sys.path``) are also separate. The new environment has no ``sys."
"argv`` variable. It has new standard I/O stream file objects ``sys.stdin``, "
"``sys.stdout`` and ``sys.stderr`` (however these refer to the same "
"underlying file descriptors)."
msgstr ""
#: c-api/init.rst:839
msgid ""
"The return value points to the first thread state created in the new sub-"
"interpreter. This thread state is made in the current thread state. Note "
"that no actual thread is created; see the discussion of thread states "
"below. If creation of the new interpreter is unsuccessful, *NULL* is "
"returned; no exception is set since the exception state is stored in the "
"current thread state and there may not be a current thread state. (Like all "
"other Python/C API functions, the global interpreter lock must be held "
"before calling this function and is still held when it returns; however, "
"unlike most other Python/C API functions, there needn't be a current thread "
"state on entry.)"
msgstr ""
#: c-api/init.rst:854
msgid ""
"Extension modules are shared between (sub-)interpreters as follows: the "
"first time a particular extension is imported, it is initialized normally, "
"and a (shallow) copy of its module's dictionary is squirreled away. When "
"the same extension is imported by another (sub-)interpreter, a new module is "
"initialized and filled with the contents of this copy; the extension's "
"``init`` function is not called. Note that this is different from what "
"happens when an extension is imported after the interpreter has been "
"completely re-initialized by calling :c:func:`Py_Finalize` and :c:func:"
"`Py_Initialize`; in that case, the extension's ``initmodule`` function *is* "
"called again."
msgstr ""
#: c-api/init.rst:871
msgid ""
"Destroy the (sub-)interpreter represented by the given thread state. The "
"given thread state must be the current thread state. See the discussion of "
"thread states below. When the call returns, the current thread state is "
"*NULL*. All thread states associated with this interpreter are destroyed. "
"(The global interpreter lock must be held before calling this function and "
"is still held when it returns.) :c:func:`Py_Finalize` will destroy all sub-"
"interpreters that haven't been explicitly destroyed at that point."
msgstr ""
#: c-api/init.rst:881
msgid "Bugs and caveats"
msgstr ""
#: c-api/init.rst:883
msgid ""
"Because sub-interpreters (and the main interpreter) are part of the same "
"process, the insulation between them isn't perfect --- for example, using "
"low-level file operations like :func:`os.close` they can (accidentally or "
"maliciously) affect each other's open files. Because of the way extensions "
"are shared between (sub-)interpreters, some extensions may not work "
"properly; this is especially likely when the extension makes use of (static) "
"global variables, or when the extension manipulates its module's dictionary "
"after its initialization. It is possible to insert objects created in one "
"sub-interpreter into a namespace of another sub-interpreter; this should be "
"done with great care to avoid sharing user-defined functions, methods, "
"instances or classes between sub-interpreters, since import operations "
"executed by such objects may affect the wrong (sub-)interpreter's dictionary "
"of loaded modules."
msgstr ""
#: c-api/init.rst:897
msgid ""
"Also note that combining this functionality with :c:func:`PyGILState_\\*` "
"APIs is delicate, because these APIs assume a bijection between Python "
"thread states and OS-level threads, an assumption broken by the presence of "
"sub-interpreters. It is highly recommended that you don't switch sub-"
"interpreters between a pair of matching :c:func:`PyGILState_Ensure` and :c:"
"func:`PyGILState_Release` calls. Furthermore, extensions (such as :mod:"
"`ctypes`) using these APIs to allow calling of Python code from non-Python "
"created threads will probably be broken when using sub-interpreters."
msgstr ""
#: c-api/init.rst:908
msgid "Asynchronous Notifications"
msgstr ""
#: c-api/init.rst:910
msgid ""
"A mechanism is provided to make asynchronous notifications to the main "
"interpreter thread. These notifications take the form of a function pointer "
"and a void pointer argument."
msgstr ""
#: c-api/init.rst:919
msgid ""
"Schedule a function to be called from the main interpreter thread. On "
"success, 0 is returned and *func* is queued for being called in the main "
"thread. On failure, -1 is returned without setting any exception."
msgstr ""
#: c-api/init.rst:923
msgid ""
"When successfully queued, *func* will be *eventually* called from the main "
"interpreter thread with the argument *arg*. It will be called "
"asynchronously with respect to normally running Python code, but with both "
"these conditions met:"
msgstr ""
#: c-api/init.rst:928
msgid "on a :term:`bytecode` boundary;"
msgstr ""
#: c-api/init.rst:929
msgid ""
"with the main thread holding the :term:`global interpreter lock` (*func* can "
"therefore use the full C API)."
msgstr ""
#: c-api/init.rst:932
msgid ""
"*func* must return 0 on success, or -1 on failure with an exception set. "
"*func* won't be interrupted to perform another asynchronous notification "
"recursively, but it can still be interrupted to switch threads if the global "
"interpreter lock is released."
msgstr ""
#: c-api/init.rst:937
msgid ""
"This function doesn't need a current thread state to run, and it doesn't "
"need the global interpreter lock."
msgstr ""
#: c-api/init.rst:941
msgid ""
"This is a low-level function, only useful for very special cases. There is "
"no guarantee that *func* will be called as quick as possible. If the main "
"thread is busy executing a system call, *func* won't be called before the "
"system call returns. This function is generally **not** suitable for "
"calling Python code from arbitrary C threads. Instead, use the :ref:"
"`PyGILState API<gilstate>`."
msgstr ""
#: c-api/init.rst:954
msgid "Profiling and Tracing"
msgstr ""
#: c-api/init.rst:959
msgid ""
"The Python interpreter provides some low-level support for attaching "
"profiling and execution tracing facilities. These are used for profiling, "
"debugging, and coverage analysis tools."
msgstr ""
#: c-api/init.rst:963
msgid ""
"Starting with Python 2.2, the implementation of this facility was "
"substantially revised, and an interface from C was added. This C interface "
"allows the profiling or tracing code to avoid the overhead of calling "
"through Python-level callable objects, making a direct C function call "
"instead. The essential attributes of the facility have not changed; the "
"interface allows trace functions to be installed per-thread, and the basic "
"events reported to the trace function are the same as had been reported to "
"the Python-level trace functions in previous versions."
msgstr ""
#: c-api/init.rst:975
msgid ""
"The type of the trace function registered using :c:func:`PyEval_SetProfile` "
"and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to "
"the registration function as *obj*, *frame* is the frame object to which the "
"event pertains, *what* is one of the constants :const:`PyTrace_CALL`, :const:"
"`PyTrace_EXCEPTION`, :const:`PyTrace_LINE`, :const:`PyTrace_RETURN`, :const:"
"`PyTrace_C_CALL`, :const:`PyTrace_C_EXCEPTION`, or :const:"
"`PyTrace_C_RETURN`, and *arg* depends on the value of *what*:"
msgstr ""
#: c-api/init.rst:984
msgid "Value of *what*"
msgstr ""
#: c-api/init.rst:984
msgid "Meaning of *arg*"
msgstr ""
#: c-api/init.rst:986
msgid ":const:`PyTrace_CALL`"
msgstr ""
#: c-api/init.rst:986 c-api/init.rst:991
msgid "Always *NULL*."
msgstr ""
#: c-api/init.rst:988
msgid ":const:`PyTrace_EXCEPTION`"
msgstr ""
#: c-api/init.rst:988
msgid "Exception information as returned by :func:`sys.exc_info`."
msgstr ""
#: c-api/init.rst:991
msgid ":const:`PyTrace_LINE`"
msgstr ""
#: c-api/init.rst:993
msgid ":const:`PyTrace_RETURN`"
msgstr ""
#: c-api/init.rst:993
msgid ""
"Value being returned to the caller, or *NULL* if caused by an exception."
msgstr ""
#: c-api/init.rst:996
msgid ":const:`PyTrace_C_CALL`"
msgstr ""
#: c-api/init.rst:996 c-api/init.rst:998 c-api/init.rst:1000
msgid "Function object being called."
msgstr ""
#: c-api/init.rst:998
msgid ":const:`PyTrace_C_EXCEPTION`"
msgstr ""
#: c-api/init.rst:1000
msgid ":const:`PyTrace_C_RETURN`"
msgstr ""
#: c-api/init.rst:1006
msgid ""
"The value of the *what* parameter to a :c:type:`Py_tracefunc` function when "
"a new call to a function or method is being reported, or a new entry into a "
"generator. Note that the creation of the iterator for a generator function "
"is not reported as there is no control transfer to the Python bytecode in "
"the corresponding frame."
msgstr ""
#: c-api/init.rst:1015
msgid ""
"The value of the *what* parameter to a :c:type:`Py_tracefunc` function when "
"an exception has been raised. The callback function is called with this "
"value for *what* when after any bytecode is processed after which the "
"exception becomes set within the frame being executed. The effect of this "
"is that as exception propagation causes the Python stack to unwind, the "
"callback is called upon return to each frame as the exception propagates. "
"Only trace functions receives these events; they are not needed by the "
"profiler."
msgstr ""
#: c-api/init.rst:1026
msgid ""
"The value passed as the *what* parameter to a trace function (but not a "
"profiling function) when a line-number event is being reported."
msgstr ""
#: c-api/init.rst:1032
msgid ""
"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when "
"a call is returning without propagating an exception."
msgstr ""
#: c-api/init.rst:1038
msgid ""
"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when "
"a C function is about to be called."
msgstr ""
#: c-api/init.rst:1044
msgid ""
"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when "
"a C function has raised an exception."
msgstr ""
#: c-api/init.rst:1050
msgid ""
"The value for the *what* parameter to :c:type:`Py_tracefunc` functions when "
"a C function has returned."
msgstr ""
#: c-api/init.rst:1056
msgid ""
"Set the profiler function to *func*. The *obj* parameter is passed to the "
"function as its first parameter, and may be any Python object, or *NULL*. "
"If the profile function needs to maintain state, using a different value for "
"*obj* for each thread provides a convenient and thread-safe place to store "
"it. The profile function is called for all monitored events except the line-"
"number events."
msgstr ""
#: c-api/init.rst:1066
msgid ""
"Set the tracing function to *func*. This is similar to :c:func:"
"`PyEval_SetProfile`, except the tracing function does receive line-number "
"events."
msgstr ""
#: c-api/init.rst:1072
msgid ""
"Return a tuple of function call counts. There are constants defined for the "
"positions within the tuple:"
msgstr ""
#: c-api/init.rst:1076
msgid "Name"
msgstr "Nom"
#: c-api/init.rst:1076
msgid "Value"
msgstr "Valeur"
#: c-api/init.rst:1078
msgid ":const:`PCALL_ALL`"
msgstr ""
#: c-api/init.rst:1078
msgid "0"
msgstr "0"
#: c-api/init.rst:1080
msgid ":const:`PCALL_FUNCTION`"
msgstr ""
#: c-api/init.rst:1080
msgid "1"
msgstr "1"
#: c-api/init.rst:1082
msgid ":const:`PCALL_FAST_FUNCTION`"
msgstr ""
#: c-api/init.rst:1082
msgid "2"
msgstr "2"
#: c-api/init.rst:1084
msgid ":const:`PCALL_FASTER_FUNCTION`"
msgstr ""
#: c-api/init.rst:1084
msgid "3"
msgstr "3"
#: c-api/init.rst:1086
msgid ":const:`PCALL_METHOD`"
msgstr ""
#: c-api/init.rst:1086
msgid "4"
msgstr "4"
#: c-api/init.rst:1088
msgid ":const:`PCALL_BOUND_METHOD`"
msgstr ""
#: c-api/init.rst:1088
msgid "5"
msgstr "5"
#: c-api/init.rst:1090
msgid ":const:`PCALL_CFUNCTION`"
msgstr ""
#: c-api/init.rst:1090
msgid "6"
msgstr "6"
#: c-api/init.rst:1092
msgid ":const:`PCALL_TYPE`"
msgstr ""
#: c-api/init.rst:1092
msgid "7"
msgstr "7"
#: c-api/init.rst:1094
msgid ":const:`PCALL_GENERATOR`"
msgstr ""
#: c-api/init.rst:1094
msgid "8"
msgstr "8"
#: c-api/init.rst:1096
msgid ":const:`PCALL_OTHER`"
msgstr ""
#: c-api/init.rst:1096
msgid "9"
msgstr ""
#: c-api/init.rst:1098
msgid ":const:`PCALL_POP`"
msgstr ""
#: c-api/init.rst:1098
msgid "10"
msgstr "10"
#: c-api/init.rst:1101
msgid ""
":const:`PCALL_FAST_FUNCTION` means no argument tuple needs to be created. :"
"const:`PCALL_FASTER_FUNCTION` means that the fast-path frame setup code is "
"used."
msgstr ""
#: c-api/init.rst:1104
msgid ""
"If there is a method call where the call can be optimized by changing the "
"argument tuple and calling the function directly, it gets recorded twice."
msgstr ""
#: c-api/init.rst:1108
msgid ""
"This function is only present if Python is compiled with :const:"
"`CALL_PROFILE` defined."
msgstr ""
#: c-api/init.rst:1114
msgid "Advanced Debugger Support"
msgstr "Support avancé du debugger"
#: c-api/init.rst:1119
msgid ""
"These functions are only intended to be used by advanced debugging tools."
msgstr ""
#: c-api/init.rst:1124
msgid ""
"Return the interpreter state object at the head of the list of all such "
"objects."
msgstr ""
#: c-api/init.rst:1131
msgid ""
"Return the next interpreter state object after *interp* from the list of all "
"such objects."
msgstr ""
#: c-api/init.rst:1139
msgid ""
"Return the pointer to the first :c:type:`PyThreadState` object in the list "
"of threads associated with the interpreter *interp*."
msgstr ""
#: c-api/init.rst:1147
msgid ""
"Return the next thread state object after *tstate* from the list of all such "
"objects belonging to the same :c:type:`PyInterpreterState` object."
msgstr ""
#: c-api/int.rst:6
#, fuzzy
msgid "Plain Integer Objects"
msgstr "Objets association"
#: c-api/int.rst:13
msgid "This subtype of :c:type:`PyObject` represents a Python integer object."
msgstr ""
#: c-api/int.rst:20
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python plain integer "
"type. This is the same object as ``int`` and ``types.IntType``."
msgstr ""
#: c-api/int.rst:26
msgid ""
"Return true if *o* is of type :c:data:`PyInt_Type` or a subtype of :c:data:"
"`PyInt_Type`."
msgstr ""
#: c-api/int.rst:35
msgid ""
"Return true if *o* is of type :c:data:`PyInt_Type`, but not a subtype of :c:"
"data:`PyInt_Type`."
msgstr ""
#: c-api/int.rst:43
msgid ""
"Return a new :c:type:`PyIntObject` or :c:type:`PyLongObject` based on the "
"string value in *str*, which is interpreted according to the radix in "
"*base*. If *pend* is non-*NULL*, ``*pend`` will point to the first "
"character in *str* which follows the representation of the number. If "
"*base* is ``0``, the radix will be determined based on the leading "
"characters of *str*: if *str* starts with ``'0x'`` or ``'0X'``, radix 16 "
"will be used; if *str* starts with ``'0'``, radix 8 will be used; otherwise "
"radix 10 will be used. If *base* is not ``0``, it must be between ``2`` and "
"``36``, inclusive. Leading spaces are ignored. If there are no digits, :"
"exc:`ValueError` will be raised. If the string represents a number too "
"large to be contained within the machine's :c:type:`long int` type and "
"overflow warnings are being suppressed, a :c:type:`PyLongObject` will be "
"returned. If overflow warnings are not being suppressed, *NULL* will be "
"returned in this case."
msgstr ""
#: c-api/int.rst:60
msgid "Create a new integer object with a value of *ival*."
msgstr ""
#: c-api/int.rst:62
msgid ""
"The current implementation keeps an array of integer objects for all "
"integers between ``-5`` and ``256``, when you create an int in that range "
"you actually just get back a reference to the existing object. So it should "
"be possible to change the value of ``1``. I suspect the behaviour of Python "
"in this case is undefined. :-)"
msgstr ""
#: c-api/int.rst:71
msgid ""
"Create a new integer object with a value of *ival*. If the value is larger "
"than ``LONG_MAX`` or smaller than ``LONG_MIN``, a long integer object is "
"returned."
msgstr ""
#: c-api/int.rst:80
msgid ""
"Create a new integer object with a value of *ival*. If the value exceeds "
"``LONG_MAX``, a long integer object is returned."
msgstr ""
#: c-api/int.rst:88
msgid ""
"Will first attempt to cast the object to a :c:type:`PyIntObject`, if it is "
"not already one, and then return its value. If there is an error, ``-1`` is "
"returned, and the caller should check ``PyErr_Occurred()`` to find out "
"whether there was an error, or whether the value just happened to be -1."
msgstr ""
#: c-api/int.rst:96
msgid "Return the value of the object *io*. No error checking is performed."
msgstr ""
#: c-api/int.rst:101
msgid ""
"Will first attempt to cast the object to a :c:type:`PyIntObject` or :c:type:"
"`PyLongObject`, if it is not already one, and then return its value as "
"unsigned long. This function does not check for overflow."
msgstr ""
#: c-api/int.rst:110
msgid ""
"Will first attempt to cast the object to a :c:type:`PyIntObject` or :c:type:"
"`PyLongObject`, if it is not already one, and then return its value as "
"unsigned long long, without checking for overflow."
msgstr ""
#: c-api/int.rst:119
msgid ""
"Will first attempt to cast the object to a :c:type:`PyIntObject` or :c:type:"
"`PyLongObject`, if it is not already one, and then return its value as :c:"
"type:`Py_ssize_t`."
msgstr ""
#: c-api/int.rst:130
msgid ""
"Return the system's idea of the largest integer it can handle (:const:"
"`LONG_MAX`, as defined in the system header files)."
msgstr ""
#: c-api/int.rst:136
msgid ""
"Clear the integer free list. Return the number of items that could not be "
"freed."
msgstr ""
#: c-api/intro.rst:8
msgid "Introduction"
msgstr "Introduction"
#: c-api/intro.rst:10
msgid ""
"The Application Programmer's Interface to Python gives C and C++ programmers "
"access to the Python interpreter at a variety of levels. The API is equally "
"usable from C++, but for brevity it is generally referred to as the Python/C "
"API. There are two fundamentally different reasons for using the Python/C "
"API. The first reason is to write *extension modules* for specific purposes; "
"these are C modules that extend the Python interpreter. This is probably "
"the most common use. The second reason is to use Python as a component in a "
"larger application; this technique is generally referred to as :dfn:"
"`embedding` Python in an application."
msgstr ""
#: c-api/intro.rst:20
msgid ""
"Writing an extension module is a relatively well-understood process, where "
"a \"cookbook\" approach works well. There are several tools that automate "
"the process to some extent. While people have embedded Python in other "
"applications since its early existence, the process of embedding Python is "
"less straightforward than writing an extension."
msgstr ""
#: c-api/intro.rst:26
msgid ""
"Many API functions are useful independent of whether you're embedding or "
"extending Python; moreover, most applications that embed Python will need "
"to provide a custom extension as well, so it's probably a good idea to "
"become familiar with writing an extension before attempting to embed Python "
"in a real application."
msgstr ""
#: c-api/intro.rst:36
msgid "Include Files"
msgstr ""
#: c-api/intro.rst:38
msgid ""
"All function, type and macro definitions needed to use the Python/C API are "
"included in your code by the following line::"
msgstr ""
#: c-api/intro.rst:43
msgid ""
"This implies inclusion of the following standard headers: ``<stdio.h>``, "
"``<string.h>``, ``<errno.h>``, ``<limits.h>``, ``<assert.h>`` and ``<stdlib."
"h>`` (if available)."
msgstr ""
#: c-api/intro.rst:49
msgid ""
"Since Python may define some pre-processor definitions which affect the "
"standard headers on some systems, you *must* include :file:`Python.h` before "
"any standard headers are included."
msgstr ""
"Python pouvant définir certaines définitions pré-processeur qui affectent "
"les têtes standard sur certains systèmes, vous *devez* inclure :file:`Python."
"h` avant les en-têtes standards."
#: c-api/intro.rst:53
msgid ""
"All user visible names defined by Python.h (except those defined by the "
"included standard headers) have one of the prefixes ``Py`` or ``_Py``. "
"Names beginning with ``_Py`` are for internal use by the Python "
"implementation and should not be used by extension writers. Structure member "
"names do not have a reserved prefix."
msgstr ""
#: c-api/intro.rst:58
msgid ""
"**Important:** user code should never define names that begin with ``Py`` or "
"``_Py``. This confuses the reader, and jeopardizes the portability of the "
"user code to future Python versions, which may define additional names "
"beginning with one of these prefixes."
msgstr ""
#: c-api/intro.rst:63
msgid ""
"The header files are typically installed with Python. On Unix, these are "
"located in the directories :file:`{prefix}/include/pythonversion/` and :file:"
"`{exec_prefix}/include/pythonversion/`, where :envvar:`prefix` and :envvar:"
"`exec_prefix` are defined by the corresponding parameters to Python's :"
"program:`configure` script and *version* is ``sys.version[:3]``. On "
"Windows, the headers are installed in :file:`{prefix}/include`, where :"
"envvar:`prefix` is the installation directory specified to the installer."
msgstr ""
#: c-api/intro.rst:71
msgid ""
"To include the headers, place both directories (if different) on your "
"compiler's search path for includes. Do *not* place the parent directories "
"on the search path and then use ``#include <pythonX.Y/Python.h>``; this will "
"break on multi-platform builds since the platform independent headers under :"
"envvar:`prefix` include the platform specific headers from :envvar:"
"`exec_prefix`."
msgstr ""
#: c-api/intro.rst:78
msgid ""
"C++ users should note that though the API is defined entirely using C, the "
"header files do properly declare the entry points to be ``extern \"C\"``, so "
"there is no need to do anything special to use the API from C++."
msgstr ""
#: c-api/intro.rst:86
msgid "Objects, Types and Reference Counts"
msgstr ""
#: c-api/intro.rst:90
msgid ""
"Most Python/C API functions have one or more arguments as well as a return "
"value of type :c:type:`PyObject\\*`. This type is a pointer to an opaque "
"data type representing an arbitrary Python object. Since all Python object "
"types are treated the same way by the Python language in most situations (e."
"g., assignments, scope rules, and argument passing), it is only fitting that "
"they should be represented by a single C type. Almost all Python objects "
"live on the heap: you never declare an automatic or static variable of type :"
"c:type:`PyObject`, only pointer variables of type :c:type:`PyObject\\*` can "
"be declared. The sole exception are the type objects; since these must "
"never be deallocated, they are typically static :c:type:`PyTypeObject` "
"objects."
msgstr ""
#: c-api/intro.rst:101
msgid ""
"All Python objects (even Python integers) have a :dfn:`type` and a :dfn:"
"`reference count`. An object's type determines what kind of object it is (e."
"g., an integer, a list, or a user-defined function; there are many more as "
"explained in :ref:`types`). For each of the well-known types there is a "
"macro to check whether an object is of that type; for instance, "
"``PyList_Check(a)`` is true if (and only if) the object pointed to by *a* is "
"a Python list."
msgstr ""
#: c-api/intro.rst:112
msgid "Reference Counts"
msgstr ""
#: c-api/intro.rst:114
msgid ""
"The reference count is important because today's computers have a finite "
"(and often severely limited) memory size; it counts how many different "
"places there are that have a reference to an object. Such a place could be "
"another object, or a global (or static) C variable, or a local variable in "
"some C function. When an object's reference count becomes zero, the object "
"is deallocated. If it contains references to other objects, their "
"reference count is decremented. Those other objects may be deallocated in "
"turn, if this decrement makes their reference count become zero, and so on. "
"(There's an obvious problem with objects that reference each other here; "
"for now, the solution is \"don't do that.\")"
msgstr ""
#: c-api/intro.rst:129
msgid ""
"Reference counts are always manipulated explicitly. The normal way is to "
"use the macro :c:func:`Py_INCREF` to increment an object's reference count "
"by one, and :c:func:`Py_DECREF` to decrement it by one. The :c:func:"
"`Py_DECREF` macro is considerably more complex than the incref one, since it "
"must check whether the reference count becomes zero and then cause the "
"object's deallocator to be called. The deallocator is a function pointer "
"contained in the object's type structure. The type-specific deallocator "
"takes care of decrementing the reference counts for other objects contained "
"in the object if this is a compound object type, such as a list, as well as "
"performing any additional finalization that's needed. There's no chance "
"that the reference count can overflow; at least as many bits are used to "
"hold the reference count as there are distinct memory locations in virtual "
"memory (assuming ``sizeof(Py_ssize_t) >= sizeof(void*)``). Thus, the "
"reference count increment is a simple operation."
msgstr ""
#: c-api/intro.rst:143
msgid ""
"It is not necessary to increment an object's reference count for every "
"local variable that contains a pointer to an object. In theory, the "
"object's reference count goes up by one when the variable is made to point "
"to it and it goes down by one when the variable goes out of scope. "
"However, these two cancel each other out, so at the end the reference count "
"hasn't changed. The only real reason to use the reference count is to "
"prevent the object from being deallocated as long as our variable is "
"pointing to it. If we know that there is at least one other reference to "
"the object that lives at least as long as our variable, there is no need to "
"increment the reference count temporarily. An important situation where "
"this arises is in objects that are passed as arguments to C functions in an "
"extension module that are called from Python; the call mechanism guarantees "
"to hold a reference to every argument for the duration of the call."
msgstr ""
#: c-api/intro.rst:157
msgid ""
"However, a common pitfall is to extract an object from a list and hold on to "
"it for a while without incrementing its reference count. Some other "
"operation might conceivably remove the object from the list, decrementing "
"its reference count and possible deallocating it. The real danger is that "
"innocent-looking operations may invoke arbitrary Python code which could do "
"this; there is a code path which allows control to flow back to the user "
"from a :c:func:`Py_DECREF`, so almost any operation is potentially dangerous."
msgstr ""
#: c-api/intro.rst:165
msgid ""
"A safe approach is to always use the generic operations (functions whose "
"name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or "
"``PyMapping_``). These operations always increment the reference count of "
"the object they return. This leaves the caller with the responsibility to "
"call :c:func:`Py_DECREF` when they are done with the result; this soon "
"becomes second nature."
msgstr ""
#: c-api/intro.rst:175
msgid "Reference Count Details"
msgstr ""
#: c-api/intro.rst:177
msgid ""
"The reference count behavior of functions in the Python/C API is best "
"explained in terms of *ownership of references*. Ownership pertains to "
"references, never to objects (objects are not owned: they are always "
"shared). \"Owning a reference\" means being responsible for calling "
"Py_DECREF on it when the reference is no longer needed. Ownership can also "
"be transferred, meaning that the code that receives ownership of the "
"reference then becomes responsible for eventually decref'ing it by calling :"
"c:func:`Py_DECREF` or :c:func:`Py_XDECREF` when it's no longer needed---or "
"passing on this responsibility (usually to its caller). When a function "
"passes ownership of a reference on to its caller, the caller is said to "
"receive a *new* reference. When no ownership is transferred, the caller is "
"said to *borrow* the reference. Nothing needs to be done for a borrowed "
"reference."
msgstr ""
#: c-api/intro.rst:190
msgid ""
"Conversely, when a calling function passes in a reference to an object, "
"there are two possibilities: the function *steals* a reference to the "
"object, or it does not. *Stealing a reference* means that when you pass a "
"reference to a function, that function assumes that it now owns that "
"reference, and you are not responsible for it any longer."
msgstr ""
#: c-api/intro.rst:200
msgid ""
"Few functions steal references; the two notable exceptions are :c:func:"
"`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to "
"the item (but not to the tuple or list into which the item is put!). These "
"functions were designed to steal a reference because of a common idiom for "
"populating a tuple or list with newly created objects; for example, the code "
"to create the tuple ``(1, 2, \"three\")`` could look like this (forgetting "
"about error handling for the moment; a better way to code this is shown "
"below)::"
msgstr ""
#: c-api/intro.rst:215
msgid ""
"Here, :c:func:`PyInt_FromLong` returns a new reference which is immediately "
"stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object "
"although the reference to it will be stolen, use :c:func:`Py_INCREF` to grab "
"another reference before calling the reference-stealing function."
msgstr ""
#: c-api/intro.rst:220
msgid ""
"Incidentally, :c:func:`PyTuple_SetItem` is the *only* way to set tuple "
"items; :c:func:`PySequence_SetItem` and :c:func:`PyObject_SetItem` refuse to "
"do this since tuples are an immutable data type. You should only use :c:"
"func:`PyTuple_SetItem` for tuples that you are creating yourself."
msgstr ""
#: c-api/intro.rst:225
msgid ""
"Equivalent code for populating a list can be written using :c:func:"
"`PyList_New` and :c:func:`PyList_SetItem`."
msgstr ""
#: c-api/intro.rst:228
msgid ""
"However, in practice, you will rarely use these ways of creating and "
"populating a tuple or list. There's a generic function, :c:func:"
"`Py_BuildValue`, that can create most common objects from C values, directed "
"by a :dfn:`format string`. For example, the above two blocks of code could "
"be replaced by the following (which also takes care of the error checking)::"
msgstr ""
#: c-api/intro.rst:239
msgid ""
"It is much more common to use :c:func:`PyObject_SetItem` and friends with "
"items whose references you are only borrowing, like arguments that were "
"passed in to the function you are writing. In that case, their behaviour "
"regarding reference counts is much saner, since you don't have to increment "
"a reference count so you can give a reference away (\"have it be stolen\"). "
"For example, this function sets all items of a list (actually, any mutable "
"sequence) to a given item::"
msgstr ""
#: c-api/intro.rst:269
msgid ""
"The situation is slightly different for function return values. While "
"passing a reference to most functions does not change your ownership "
"responsibilities for that reference, many functions that return a reference "
"to an object give you ownership of the reference. The reason is simple: in "
"many cases, the returned object is created on the fly, and the reference "
"you get is the only reference to the object. Therefore, the generic "
"functions that return object references, like :c:func:`PyObject_GetItem` "
"and :c:func:`PySequence_GetItem`, always return a new reference (the caller "
"becomes the owner of the reference)."
msgstr ""
#: c-api/intro.rst:278
msgid ""
"It is important to realize that whether you own a reference returned by a "
"function depends on which function you call only --- *the plumage* (the type "
"of the object passed as an argument to the function) *doesn't enter into it!"
"* Thus, if you extract an item from a list using :c:func:`PyList_GetItem`, "
"you don't own the reference --- but if you obtain the same item from the "
"same list using :c:func:`PySequence_GetItem` (which happens to take exactly "
"the same arguments), you do own a reference to the returned object."
msgstr ""
#: c-api/intro.rst:290
msgid ""
"Here is an example of how you could write a function that computes the sum "
"of the items in a list of integers; once using :c:func:`PyList_GetItem`, "
"and once using :c:func:`PySequence_GetItem`. ::"
msgstr ""
#: c-api/intro.rst:342
msgid "Types"
msgstr ""
#: c-api/intro.rst:344
msgid ""
"There are few other data types that play a significant role in the Python/C "
"API; most are simple C types such as :c:type:`int`, :c:type:`long`, :c:type:"
"`double` and :c:type:`char\\*`. A few structure types are used to describe "
"static tables used to list the functions exported by a module or the data "
"attributes of a new object type, and another is used to describe the value "
"of a complex number. These will be discussed together with the functions "
"that use them."
msgstr ""
#: c-api/intro.rst:356
msgid "Exceptions"
msgstr "Exceptions"
#: c-api/intro.rst:358
msgid ""
"The Python programmer only needs to deal with exceptions if specific error "
"handling is required; unhandled exceptions are automatically propagated to "
"the caller, then to the caller's caller, and so on, until they reach the top-"
"level interpreter, where they are reported to the user accompanied by a "
"stack traceback."
msgstr ""
#: c-api/intro.rst:366
msgid ""
"For C programmers, however, error checking always has to be explicit. All "
"functions in the Python/C API can raise exceptions, unless an explicit claim "
"is made otherwise in a function's documentation. In general, when a "
"function encounters an error, it sets an exception, discards any object "
"references that it owns, and returns an error indicator. If not documented "
"otherwise, this indicator is either *NULL* or ``-1``, depending on the "
"function's return type. A few functions return a Boolean true/false result, "
"with false indicating an error. Very few functions return no explicit error "
"indicator or have an ambiguous return value, and require explicit testing "
"for errors with :c:func:`PyErr_Occurred`. These exceptions are always "
"explicitly documented."
msgstr ""
#: c-api/intro.rst:381
msgid ""
"Exception state is maintained in per-thread storage (this is equivalent to "
"using global storage in an unthreaded application). A thread can be in one "
"of two states: an exception has occurred, or not. The function :c:func:"
"`PyErr_Occurred` can be used to check for this: it returns a borrowed "
"reference to the exception type object when an exception has occurred, and "
"*NULL* otherwise. There are a number of functions to set the exception "
"state: :c:func:`PyErr_SetString` is the most common (though not the most "
"general) function to set the exception state, and :c:func:`PyErr_Clear` "
"clears the exception state."
msgstr ""
#: c-api/intro.rst:396
msgid ""
"The full exception state consists of three objects (all of which can be "
"*NULL*): the exception type, the corresponding exception value, and the "
"traceback. These have the same meanings as the Python objects ``sys."
"exc_type``, ``sys.exc_value``, and ``sys.exc_traceback``; however, they are "
"not the same: the Python objects represent the last exception being handled "
"by a Python :keyword:`try` ... :keyword:`except` statement, while the C "
"level exception state only exists while an exception is being passed on "
"between C functions until it reaches the Python bytecode interpreter's main "
"loop, which takes care of transferring it to ``sys.exc_type`` and friends."
msgstr ""
#: c-api/intro.rst:408
msgid ""
"Note that starting with Python 1.5, the preferred, thread-safe way to access "
"the exception state from Python code is to call the function :func:`sys."
"exc_info`, which returns the per-thread exception state for Python code. "
"Also, the semantics of both ways to access the exception state have changed "
"so that a function which catches an exception will save and restore its "
"thread's exception state so as to preserve the exception state of its "
"caller. This prevents common bugs in exception handling code caused by an "
"innocent-looking function overwriting the exception being handled; it also "
"reduces the often unwanted lifetime extension for objects that are "
"referenced by the stack frames in the traceback."
msgstr ""
#: c-api/intro.rst:419
msgid ""
"As a general principle, a function that calls another function to perform "
"some task should check whether the called function raised an exception, and "
"if so, pass the exception state on to its caller. It should discard any "
"object references that it owns, and return an error indicator, but it "
"should *not* set another exception --- that would overwrite the exception "
"that was just raised, and lose important information about the exact cause "
"of the error."
msgstr ""
#: c-api/intro.rst:428
msgid ""
"A simple example of detecting exceptions and passing them on is shown in "
"the :c:func:`sum_sequence` example above. It so happens that this example "
"doesn't need to clean up any owned references when it detects an error. The "
"following example function shows some error cleanup. First, to remind you "
"why you like Python, we show the equivalent Python code::"
msgstr ""
#: c-api/intro.rst:443
msgid "Here is the corresponding C code, in all its glory::"
msgstr ""
#: c-api/intro.rst:495
msgid ""
"This example represents an endorsed use of the ``goto`` statement in C! It "
"illustrates the use of :c:func:`PyErr_ExceptionMatches` and :c:func:"
"`PyErr_Clear` to handle specific exceptions, and the use of :c:func:"
"`Py_XDECREF` to dispose of owned references that may be *NULL* (note the "
"``'X'`` in the name; :c:func:`Py_DECREF` would crash when confronted with a "
"*NULL* reference). It is important that the variables used to hold owned "
"references are initialized to *NULL* for this to work; likewise, the "
"proposed return value is initialized to ``-1`` (failure) and only set to "
"success after the final call made is successful."
msgstr ""
#: c-api/intro.rst:509
msgid "Embedding Python"
msgstr ""
#: c-api/intro.rst:511
msgid ""
"The one important task that only embedders (as opposed to extension writers) "
"of the Python interpreter have to worry about is the initialization, and "
"possibly the finalization, of the Python interpreter. Most functionality of "
"the interpreter can only be used after the interpreter has been initialized."
msgstr ""
#: c-api/intro.rst:525
msgid ""
"The basic initialization function is :c:func:`Py_Initialize`. This "
"initializes the table of loaded modules, and creates the fundamental "
"modules :mod:`__builtin__`, :mod:`__main__`, :mod:`sys`, and :mod:"
"`exceptions`. It also initializes the module search path (``sys.path``)."
msgstr ""
#: c-api/intro.rst:532
msgid ""
":c:func:`Py_Initialize` does not set the \"script argument list\" (``sys."
"argv``). If this variable is needed by Python code that will be executed "
"later, it must be set explicitly with a call to ``PySys_SetArgvEx(argc, "
"argv, updatepath)`` after the call to :c:func:`Py_Initialize`."
msgstr ""
#: c-api/intro.rst:537
msgid ""
"On most systems (in particular, on Unix and Windows, although the details "
"are slightly different), :c:func:`Py_Initialize` calculates the module "
"search path based upon its best guess for the location of the standard "
"Python interpreter executable, assuming that the Python library is found in "
"a fixed location relative to the Python interpreter executable. In "
"particular, it looks for a directory named :file:`lib/python{X.Y}` relative "
"to the parent directory where the executable named :file:`python` is found "
"on the shell command search path (the environment variable :envvar:`PATH`)."
msgstr ""
#: c-api/intro.rst:546
msgid ""
"For instance, if the Python executable is found in :file:`/usr/local/bin/"
"python`, it will assume that the libraries are in :file:`/usr/local/lib/"
"python{X.Y}`. (In fact, this particular path is also the \"fallback\" "
"location, used when no executable file named :file:`python` is found along :"
"envvar:`PATH`.) The user can override this behavior by setting the "
"environment variable :envvar:`PYTHONHOME`, or insert additional directories "
"in front of the standard path by setting :envvar:`PYTHONPATH`."
msgstr ""
#: c-api/intro.rst:561
msgid ""
"The embedding application can steer the search by calling "
"``Py_SetProgramName(file)`` *before* calling :c:func:`Py_Initialize`. Note "
"that :envvar:`PYTHONHOME` still overrides this and :envvar:`PYTHONPATH` is "
"still inserted in front of the standard path. An application that requires "
"total control has to provide its own implementation of :c:func:"
"`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, and :c:"
"func:`Py_GetProgramFullPath` (all defined in :file:`Modules/getpath.c`)."
msgstr ""
#: c-api/intro.rst:571
msgid ""
"Sometimes, it is desirable to \"uninitialize\" Python. For instance, the "
"application may want to start over (make another call to :c:func:"
"`Py_Initialize`) or the application is simply done with its use of Python "
"and wants to free memory allocated by Python. This can be accomplished by "
"calling :c:func:`Py_Finalize`. The function :c:func:`Py_IsInitialized` "
"returns true if Python is currently in the initialized state. More "
"information about these functions is given in a later chapter. Notice that :"
"c:func:`Py_Finalize` does *not* free all memory allocated by the Python "
"interpreter, e.g. memory allocated by extension modules currently cannot be "
"released."
msgstr ""
#: c-api/intro.rst:585
msgid "Debugging Builds"
msgstr ""
#: c-api/intro.rst:587
msgid ""
"Python can be built with several macros to enable extra checks of the "
"interpreter and extension modules. These checks tend to add a large amount "
"of overhead to the runtime so they are not enabled by default."
msgstr ""
#: c-api/intro.rst:591
msgid ""
"A full list of the various types of debugging builds is in the file :file:"
"`Misc/SpecialBuilds.txt` in the Python source distribution. Builds are "
"available that support tracing of reference counts, debugging the memory "
"allocator, or low-level profiling of the main interpreter loop. Only the "
"most frequently-used builds will be described in the remainder of this "
"section."
msgstr ""
#: c-api/intro.rst:597
msgid ""
"Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined "
"produces what is generally meant by \"a debug build\" of Python. :c:macro:"
"`Py_DEBUG` is enabled in the Unix build by adding ``--with-pydebug`` to the :"
"file:`./configure` command. It is also implied by the presence of the not-"
"Python-specific :c:macro:`_DEBUG` macro. When :c:macro:`Py_DEBUG` is "
"enabled in the Unix build, compiler optimization is disabled."
msgstr ""
#: c-api/intro.rst:604
msgid ""
"In addition to the reference count debugging described below, the following "
"extra checks are performed:"
msgstr ""
#: c-api/intro.rst:607
msgid "Extra checks are added to the object allocator."
msgstr ""
#: c-api/intro.rst:609
msgid "Extra checks are added to the parser and compiler."
msgstr ""
#: c-api/intro.rst:611
msgid ""
"Downcasts from wide types to narrow types are checked for loss of "
"information."
msgstr ""
#: c-api/intro.rst:613
msgid ""
"A number of assertions are added to the dictionary and set implementations. "
"In addition, the set object acquires a :meth:`test_c_api` method."
msgstr ""
#: c-api/intro.rst:616
msgid "Sanity checks of the input arguments are added to frame creation."
msgstr ""
#: c-api/intro.rst:618
msgid ""
"The storage for long ints is initialized with a known invalid pattern to "
"catch reference to uninitialized digits."
msgstr ""
#: c-api/intro.rst:621
msgid ""
"Low-level tracing and extra exception checking are added to the runtime "
"virtual machine."
msgstr ""
#: c-api/intro.rst:624
msgid "Extra checks are added to the memory arena implementation."
msgstr ""
#: c-api/intro.rst:626
msgid "Extra debugging is added to the thread module."
msgstr ""
#: c-api/intro.rst:628
msgid "There may be additional checks not mentioned here."
msgstr ""
#: c-api/intro.rst:630
msgid ""
"Defining :c:macro:`Py_TRACE_REFS` enables reference tracing. When defined, "
"a circular doubly linked list of active objects is maintained by adding two "
"extra fields to every :c:type:`PyObject`. Total allocations are tracked as "
"well. Upon exit, all existing references are printed. (In interactive mode "
"this happens after every statement run by the interpreter.) Implied by :c:"
"macro:`Py_DEBUG`."
msgstr ""
#: c-api/intro.rst:636
msgid ""
"Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source "
"distribution for more detailed information."
msgstr ""
#: c-api/iter.rst:6
msgid "Iterator Protocol"
msgstr ""
#: c-api/iter.rst:10
msgid "There are two functions specifically for working with iterators."
msgstr ""
#: c-api/iter.rst:15
msgid "Return true if the object *o* supports the iterator protocol."
msgstr ""
#: c-api/iter.rst:17
msgid ""
"This function can return a false positive in the case of old-style classes "
"because those classes always define a :c:member:`tp_iternext` slot with "
"logic that either invokes a :meth:`next` method or raises a :exc:`TypeError`."
msgstr ""
#: c-api/iter.rst:24
msgid ""
"Return the next value from the iteration *o*. The object must be an "
"iterator (it is up to the caller to check this). If there are no remaining "
"values, returns *NULL* with no exception set. If an error occurs while "
"retrieving the item, returns *NULL* and passes along the exception."
msgstr ""
#: c-api/iter.rst:29
msgid ""
"To write a loop which iterates over an iterator, the C code should look "
"something like this::"
msgstr ""
#: c-api/iterator.rst:6
msgid "Iterator Objects"
msgstr ""
#: c-api/iterator.rst:8
msgid ""
"Python provides two general-purpose iterator objects. The first, a sequence "
"iterator, works with an arbitrary sequence supporting the :meth:"
"`__getitem__` method. The second works with a callable object and a "
"sentinel value, calling the callable for each item in the sequence, and "
"ending the iteration when the sentinel value is returned."
msgstr ""
#: c-api/iterator.rst:17
msgid ""
"Type object for iterator objects returned by :c:func:`PySeqIter_New` and the "
"one-argument form of the :func:`iter` built-in function for built-in "
"sequence types."
msgstr ""
#: c-api/iterator.rst:26
msgid "Return true if the type of *op* is :c:data:`PySeqIter_Type`."
msgstr ""
#: c-api/iterator.rst:33
msgid ""
"Return an iterator that works with a general sequence object, *seq*. The "
"iteration ends when the sequence raises :exc:`IndexError` for the "
"subscripting operation."
msgstr ""
#: c-api/iterator.rst:42
msgid ""
"Type object for iterator objects returned by :c:func:`PyCallIter_New` and "
"the two-argument form of the :func:`iter` built-in function."
msgstr ""
#: c-api/iterator.rst:50
msgid "Return true if the type of *op* is :c:data:`PyCallIter_Type`."
msgstr ""
#: c-api/iterator.rst:57
msgid ""
"Return a new iterator. The first parameter, *callable*, can be any Python "
"callable object that can be called with no parameters; each call to it "
"should return the next item in the iteration. When *callable* returns a "
"value equal to *sentinel*, the iteration will be terminated."
msgstr ""
#: c-api/list.rst:6
msgid "List Objects"
msgstr ""
#: c-api/list.rst:13
msgid "This subtype of :c:type:`PyObject` represents a Python list object."
msgstr ""
#: c-api/list.rst:18
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python list type. "
"This is the same object as ``list`` in the Python layer."
msgstr ""
#: c-api/list.rst:24
msgid ""
"Return true if *p* is a list object or an instance of a subtype of the list "
"type."
msgstr ""
#: c-api/list.rst:33
msgid ""
"Return true if *p* is a list object, but not an instance of a subtype of the "
"list type."
msgstr ""
#: c-api/list.rst:41
msgid "Return a new list of length *len* on success, or *NULL* on failure."
msgstr ""
#: c-api/list.rst:45
msgid ""
"If *len* is greater than zero, the returned list object's items are set to "
"``NULL``. Thus you cannot use abstract API functions such as :c:func:"
"`PySequence_SetItem` or expose the object to Python code before setting all "
"items to a real object with :c:func:`PyList_SetItem`."
msgstr ""
#: c-api/list.rst:50
msgid ""
"This function used an :c:type:`int` for *size*. This might require changes "
"in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/list.rst:59
msgid ""
"Return the length of the list object in *list*; this is equivalent to "
"``len(list)`` on a list object."
msgstr ""
#: c-api/list.rst:62 c-api/set.rst:119
msgid ""
"This function returned an :c:type:`int`. This might require changes in your "
"code for properly supporting 64-bit systems."
msgstr ""
#: c-api/list.rst:69
msgid "Macro form of :c:func:`PyList_Size` without error checking."
msgstr ""
#: c-api/list.rst:71
msgid ""
"This macro returned an :c:type:`int`. This might require changes in your "
"code for properly supporting 64-bit systems."
msgstr ""
#: c-api/list.rst:78
msgid ""
"Return the object at position *index* in the list pointed to by *list*. The "
"position must be positive, indexing from the end of the list is not "
"supported. If *index* is out of bounds, return *NULL* and set an :exc:"
"`IndexError` exception."
msgstr ""
#: c-api/list.rst:83 c-api/list.rst:107 c-api/list.rst:135
msgid ""
"This function used an :c:type:`int` for *index*. This might require changes "
"in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/list.rst:90
msgid "Macro form of :c:func:`PyList_GetItem` without error checking."
msgstr ""
#: c-api/list.rst:92 c-api/list.rst:124
msgid ""
"This macro used an :c:type:`int` for *i*. This might require changes in your "
"code for properly supporting 64-bit systems."
msgstr ""
#: c-api/list.rst:99
msgid ""
"Set the item at index *index* in list to *item*. Return ``0`` on success or "
"``-1`` on failure."
msgstr ""
#: c-api/list.rst:104
msgid ""
"This function \"steals\" a reference to *item* and discards a reference to "
"an item already in the list at the affected position."
msgstr ""
#: c-api/list.rst:114
msgid ""
"Macro form of :c:func:`PyList_SetItem` without error checking. This is "
"normally only used to fill in new lists where there is no previous content."
msgstr ""
#: c-api/list.rst:119
msgid ""
"This macro \"steals\" a reference to *item*, and, unlike :c:func:"
"`PyList_SetItem`, does *not* discard a reference to any item that it being "
"replaced; any reference in *list* at position *i* will be leaked."
msgstr ""
#: c-api/list.rst:131
msgid ""
"Insert the item *item* into list *list* in front of index *index*. Return "
"``0`` if successful; return ``-1`` and set an exception if unsuccessful. "
"Analogous to ``list.insert(index, item)``."
msgstr ""
#: c-api/list.rst:142
msgid ""
"Append the object *item* at the end of list *list*. Return ``0`` if "
"successful; return ``-1`` and set an exception if unsuccessful. Analogous "
"to ``list.append(item)``."
msgstr ""
#: c-api/list.rst:149
msgid ""
"Return a list of the objects in *list* containing the objects *between* "
"*low* and *high*. Return *NULL* and set an exception if unsuccessful. "
"Analogous to ``list[low:high]``. Negative indices, as when slicing from "
"Python, are not supported."
msgstr ""
#: c-api/list.rst:154 c-api/list.rst:167
msgid ""
"This function used an :c:type:`int` for *low* and *high*. This might require "
"changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/list.rst:161
msgid ""
"Set the slice of *list* between *low* and *high* to the contents of "
"*itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may "
"be *NULL*, indicating the assignment of an empty list (slice deletion). "
"Return ``0`` on success, ``-1`` on failure. Negative indices, as when "
"slicing from Python, are not supported."
msgstr ""
#: c-api/list.rst:174
msgid ""
"Sort the items of *list* in place. Return ``0`` on success, ``-1`` on "
"failure. This is equivalent to ``list.sort()``."
msgstr ""
#: c-api/list.rst:180
msgid ""
"Reverse the items of *list* in place. Return ``0`` on success, ``-1`` on "
"failure. This is the equivalent of ``list.reverse()``."
msgstr ""
#: c-api/list.rst:188
msgid ""
"Return a new tuple object containing the contents of *list*; equivalent to "
"``tuple(list)``."
msgstr ""
#: c-api/long.rst:6
#, fuzzy
msgid "Long Integer Objects"
msgstr "Autres Objets"
#: c-api/long.rst:13
msgid ""
"This subtype of :c:type:`PyObject` represents a Python long integer object."
msgstr ""
#: c-api/long.rst:20
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python long integer "
"type. This is the same object as ``long`` and ``types.LongType``."
msgstr ""
#: c-api/long.rst:26
msgid ""
"Return true if its argument is a :c:type:`PyLongObject` or a subtype of :c:"
"type:`PyLongObject`."
msgstr ""
#: c-api/long.rst:35
msgid ""
"Return true if its argument is a :c:type:`PyLongObject`, but not a subtype "
"of :c:type:`PyLongObject`."
msgstr ""
#: c-api/long.rst:43
msgid ""
"Return a new :c:type:`PyLongObject` object from *v*, or *NULL* on failure."
msgstr ""
#: c-api/long.rst:48
msgid ""
"Return a new :c:type:`PyLongObject` object from a C :c:type:`unsigned long`, "
"or *NULL* on failure."
msgstr ""
#: c-api/long.rst:54
msgid ""
"Return a new :c:type:`PyLongObject` object from a C :c:type:`Py_ssize_t`, or "
"*NULL* on failure."
msgstr ""
#: c-api/long.rst:62
msgid ""
"Return a new :c:type:`PyLongObject` object from a C :c:type:`size_t`, or "
"*NULL* on failure."
msgstr ""
#: c-api/long.rst:70
msgid ""
"Return a new :c:type:`PyLongObject` object from a C :c:type:`long long`, or "
"*NULL* on failure."
msgstr ""
#: c-api/long.rst:76
msgid ""
"Return a new :c:type:`PyLongObject` object from a C :c:type:`unsigned long "
"long`, or *NULL* on failure."
msgstr ""
#: c-api/long.rst:82
msgid ""
"Return a new :c:type:`PyLongObject` object from the integer part of *v*, or "
"*NULL* on failure."
msgstr ""
#: c-api/long.rst:88
msgid ""
"Return a new :c:type:`PyLongObject` based on the string value in *str*, "
"which is interpreted according to the radix in *base*. If *pend* is non-"
"*NULL*, *\\*pend* will point to the first character in *str* which follows "
"the representation of the number. If *base* is ``0``, the radix will be "
"determined based on the leading characters of *str*: if *str* starts with "
"``'0x'`` or ``'0X'``, radix 16 will be used; if *str* starts with ``'0'``, "
"radix 8 will be used; otherwise radix 10 will be used. If *base* is not "
"``0``, it must be between ``2`` and ``36``, inclusive. Leading spaces are "
"ignored. If there are no digits, :exc:`ValueError` will be raised."
msgstr ""
#: c-api/long.rst:101
msgid ""
"Convert a sequence of Unicode digits to a Python long integer value. The "
"first parameter, *u*, points to the first character of the Unicode string, "
"*length* gives the number of characters, and *base* is the radix for the "
"conversion. The radix must be in the range [2, 36]; if it is out of range, :"
"exc:`ValueError` will be raised."
msgstr ""
#: c-api/long.rst:109
msgid ""
"This function used an :c:type:`int` for *length*. This might require changes "
"in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/long.rst:116
msgid ""
"Create a Python integer or long integer from the pointer *p*. The pointer "
"value can be retrieved from the resulting value using :c:func:"
"`PyLong_AsVoidPtr`."
msgstr ""
#: c-api/long.rst:121
msgid ""
"If the integer is larger than LONG_MAX, a positive long integer is returned."
msgstr ""
#: c-api/long.rst:131
msgid ""
"Return a C :c:type:`long` representation of the contents of *pylong*. If "
"*pylong* is greater than :const:`LONG_MAX`, an :exc:`OverflowError` is "
"raised and ``-1`` will be returned."
msgstr ""
#: c-api/long.rst:138
msgid ""
"Return a C :c:type:`long` representation of the contents of *pylong*. If "
"*pylong* is greater than :const:`LONG_MAX` or less than :const:`LONG_MIN`, "
"set *\\*overflow* to ``1`` or ``-1``, respectively, and return ``-1``; "
"otherwise, set *\\*overflow* to ``0``. If any other exception occurs (for "
"example a TypeError or MemoryError), then ``-1`` will be returned and *"
"\\*overflow* will be ``0``."
msgstr ""
#: c-api/long.rst:151
msgid ""
"Return a C :c:type:`long long` representation of the contents of *pylong*. "
"If *pylong* is greater than :const:`PY_LLONG_MAX` or less than :const:"
"`PY_LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and "
"return ``-1``; otherwise, set *\\*overflow* to ``0``. If any other "
"exception occurs (for example a TypeError or MemoryError), then ``-1`` will "
"be returned and *\\*overflow* will be ``0``."
msgstr ""
#: c-api/long.rst:168
msgid ""
"Return a C :c:type:`Py_ssize_t` representation of the contents of *pylong*. "
"If *pylong* is greater than :const:`PY_SSIZE_T_MAX`, an :exc:`OverflowError` "
"is raised and ``-1`` will be returned."
msgstr ""
#: c-api/long.rst:181
msgid ""
"Return a C :c:type:`unsigned long` representation of the contents of "
"*pylong*. If *pylong* is greater than :const:`ULONG_MAX`, an :exc:"
"`OverflowError` is raised."
msgstr ""
#: c-api/long.rst:191
msgid ""
"Return a C :c:type:`long long` from a Python long integer. If *pylong* "
"cannot be represented as a :c:type:`long long`, an :exc:`OverflowError` is "
"raised and ``-1`` is returned."
msgstr ""
#: c-api/long.rst:203
msgid ""
"Return a C :c:type:`unsigned long long` from a Python long integer. If "
"*pylong* cannot be represented as an :c:type:`unsigned long long`, an :exc:"
"`OverflowError` is raised and ``(unsigned long long)-1`` is returned."
msgstr ""
#: c-api/long.rst:210
msgid ""
"A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`."
msgstr ""
#: c-api/long.rst:217
msgid ""
"Return a C :c:type:`unsigned long` from a Python long integer, without "
"checking for overflow."
msgstr ""
#: c-api/long.rst:225
msgid ""
"Return a C :c:type:`unsigned long long` from a Python long integer, without "
"checking for overflow."
msgstr ""
#: c-api/long.rst:233
msgid ""
"Return a C :c:type:`double` representation of the contents of *pylong*. If "
"*pylong* cannot be approximately represented as a :c:type:`double`, an :exc:"
"`OverflowError` exception is raised and ``-1.0`` will be returned."
msgstr ""
#: c-api/long.rst:240
msgid ""
"Convert a Python integer or long integer *pylong* to a C :c:type:`void` "
"pointer. If *pylong* cannot be converted, an :exc:`OverflowError` will be "
"raised. This is only assured to produce a usable :c:type:`void` pointer for "
"values created with :c:func:`PyLong_FromVoidPtr`."
msgstr ""
#: c-api/long.rst:247
msgid ""
"For values outside 0..LONG_MAX, both signed and unsigned integers are "
"accepted."
msgstr ""
#: c-api/mapping.rst:6
msgid "Mapping Protocol"
msgstr ""
#: c-api/mapping.rst:11
msgid ""
"Return ``1`` if the object provides mapping protocol, and ``0`` otherwise. "
"This function always succeeds."
msgstr ""
#: c-api/mapping.rst:20
msgid ""
"Returns the number of keys in object *o* on success, and ``-1`` on failure. "
"For objects that do not provide mapping protocol, this is equivalent to the "
"Python expression ``len(o)``."
msgstr ""
#: c-api/mapping.rst:24 c-api/object.rst:357 c-api/sequence.rst:24
msgid ""
"These functions returned an :c:type:`int` type. This might require changes "
"in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/mapping.rst:31 c-api/mapping.rst:37
msgid ""
"Remove the mapping for object *key* from the object *o*. Return ``-1`` on "
"failure. This is equivalent to the Python statement ``del o[key]``."
msgstr ""
#: c-api/mapping.rst:43
msgid ""
"On success, return ``1`` if the mapping object has the key *key* and ``0`` "
"otherwise. This is equivalent to ``o[key]``, returning ``True`` on success "
"and ``False`` on an exception. This function always succeeds."
msgstr ""
#: c-api/mapping.rst:50
msgid ""
"Return ``1`` if the mapping object has the key *key* and ``0`` otherwise. "
"This is equivalent to ``o[key]``, returning ``True`` on success and "
"``False`` on an exception. This function always succeeds."
msgstr ""
#: c-api/mapping.rst:57
msgid ""
"On success, return a list of the keys in object *o*. On failure, return "
"*NULL*. This is equivalent to the Python expression ``o.keys()``."
msgstr ""
#: c-api/mapping.rst:63
msgid ""
"On success, return a list of the values in object *o*. On failure, return "
"*NULL*. This is equivalent to the Python expression ``o.values()``."
msgstr ""
#: c-api/mapping.rst:69
msgid ""
"On success, return a list of the items in object *o*, where each item is a "
"tuple containing a key-value pair. On failure, return *NULL*. This is "
"equivalent to the Python expression ``o.items()``."
msgstr ""
#: c-api/mapping.rst:76 c-api/object.rst:364
msgid ""
"Return element of *o* corresponding to the object *key* or *NULL* on "
"failure. This is the equivalent of the Python expression ``o[key]``."
msgstr ""
#: c-api/mapping.rst:82
msgid ""
"Map the object *key* to the value *v* in object *o*. Returns ``-1`` on "
"failure. This is the equivalent of the Python statement ``o[key] = v``."
msgstr ""
#: c-api/marshal.rst:6
msgid "Data marshalling support"
msgstr ""
#: c-api/marshal.rst:8
msgid ""
"These routines allow C code to work with serialized objects using the same "
"data format as the :mod:`marshal` module. There are functions to write data "
"into the serialization format, and additional functions that can be used to "
"read the data back. Files used to store marshalled data must be opened in "
"binary mode."
msgstr ""
#: c-api/marshal.rst:14
msgid "Numeric values are stored with the least significant byte first."
msgstr ""
#: c-api/marshal.rst:16
msgid ""
"The module supports two versions of the data format: version 0 is the "
"historical version, version 1 (new in Python 2.4) shares interned strings in "
"the file, and upon unmarshalling. Version 2 (new in Python 2.5) uses a "
"binary format for floating point numbers. *Py_MARSHAL_VERSION* indicates "
"the current file format (currently 2)."
msgstr ""
#: c-api/marshal.rst:25
msgid ""
"Marshal a :c:type:`long` integer, *value*, to *file*. This will only write "
"the least-significant 32 bits of *value*; regardless of the size of the "
"native :c:type:`long` type."
msgstr ""
#: c-api/marshal.rst:29 c-api/marshal.rst:37 c-api/marshal.rst:45
msgid "*version* indicates the file format."
msgstr ""
#: c-api/marshal.rst:35
msgid "Marshal a Python object, *value*, to *file*."
msgstr ""
#: c-api/marshal.rst:43
msgid ""
"Return a string object containing the marshalled representation of *value*."
msgstr ""
#: c-api/marshal.rst:49
msgid "The following functions allow marshalled values to be read back in."
msgstr ""
#: c-api/marshal.rst:51
msgid ""
"XXX What about error detection? It appears that reading past the end of the "
"file will always result in a negative numeric value (where that's relevant), "
"but it's not clear that negative values won't be handled properly when "
"there's no error. What's the right way to tell? Should only non-negative "
"values be written using these routines?"
msgstr ""
#: c-api/marshal.rst:60
msgid ""
"Return a C :c:type:`long` from the data stream in a :c:type:`FILE\\*` opened "
"for reading. Only a 32-bit value can be read in using this function, "
"regardless of the native size of :c:type:`long`."
msgstr ""
#: c-api/marshal.rst:67
msgid ""
"Return a C :c:type:`short` from the data stream in a :c:type:`FILE\\*` "
"opened for reading. Only a 16-bit value can be read in using this function, "
"regardless of the native size of :c:type:`short`."
msgstr ""
#: c-api/marshal.rst:74
msgid ""
"Return a Python object from the data stream in a :c:type:`FILE\\*` opened "
"for reading. On error, sets the appropriate exception (:exc:`EOFError` or :"
"exc:`TypeError`) and returns *NULL*."
msgstr ""
#: c-api/marshal.rst:81
msgid ""
"Return a Python object from the data stream in a :c:type:`FILE\\*` opened "
"for reading. Unlike :c:func:`PyMarshal_ReadObjectFromFile`, this function "
"assumes that no further objects will be read from the file, allowing it to "
"aggressively load file data into memory so that the de-serialization can "
"operate from data in memory rather than reading a byte at a time from the "
"file. Only use these variant if you are certain that you won't be reading "
"anything else from the file. On error, sets the appropriate exception (:exc:"
"`EOFError` or :exc:`TypeError`) and returns *NULL*."
msgstr ""
#: c-api/marshal.rst:93
msgid ""
"Return a Python object from the data stream in a character buffer containing "
"*len* bytes pointed to by *string*. On error, sets the appropriate "
"exception (:exc:`EOFError` or :exc:`TypeError`) and returns *NULL*."
msgstr ""
#: c-api/marshal.rst:98 c-api/string.rst:63 c-api/tuple.rst:45
msgid ""
"This function used an :c:type:`int` type for *len*. This might require "
"changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/memory.rst:8
msgid "Memory Management"
msgstr ""
#: c-api/memory.rst:17
msgid "Overview"
msgstr ""
#: c-api/memory.rst:19
msgid ""
"Memory management in Python involves a private heap containing all Python "
"objects and data structures. The management of this private heap is ensured "
"internally by the *Python memory manager*. The Python memory manager has "
"different components which deal with various dynamic storage management "
"aspects, like sharing, segmentation, preallocation or caching."
msgstr ""
#: c-api/memory.rst:25
msgid ""
"At the lowest level, a raw memory allocator ensures that there is enough "
"room in the private heap for storing all Python-related data by interacting "
"with the memory manager of the operating system. On top of the raw memory "
"allocator, several object-specific allocators operate on the same heap and "
"implement distinct memory management policies adapted to the peculiarities "
"of every object type. For example, integer objects are managed differently "
"within the heap than strings, tuples or dictionaries because integers imply "
"different storage requirements and speed/space tradeoffs. The Python memory "
"manager thus delegates some of the work to the object-specific allocators, "
"but ensures that the latter operate within the bounds of the private heap."
msgstr ""
#: c-api/memory.rst:36
msgid ""
"It is important to understand that the management of the Python heap is "
"performed by the interpreter itself and that the user has no control over "
"it, even if she regularly manipulates object pointers to memory blocks "
"inside that heap. The allocation of heap space for Python objects and other "
"internal buffers is performed on demand by the Python memory manager through "
"the Python/C API functions listed in this document."
msgstr ""
#: c-api/memory.rst:49
msgid ""
"To avoid memory corruption, extension writers should never try to operate on "
"Python objects with the functions exported by the C library: :c:func:"
"`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`. This will "
"result in mixed calls between the C allocator and the Python memory manager "
"with fatal consequences, because they implement different algorithms and "
"operate on different heaps. However, one may safely allocate and release "
"memory blocks with the C library allocator for individual purposes, as shown "
"in the following example::"
msgstr ""
#: c-api/memory.rst:68
msgid ""
"In this example, the memory request for the I/O buffer is handled by the C "
"library allocator. The Python memory manager is involved only in the "
"allocation of the string object returned as a result."
msgstr ""
#: c-api/memory.rst:72
msgid ""
"In most situations, however, it is recommended to allocate memory from the "
"Python heap specifically because the latter is under control of the Python "
"memory manager. For example, this is required when the interpreter is "
"extended with new object types written in C. Another reason for using the "
"Python heap is the desire to *inform* the Python memory manager about the "
"memory needs of the extension module. Even when the requested memory is used "
"exclusively for internal, highly-specific purposes, delegating all memory "
"requests to the Python memory manager causes the interpreter to have a more "
"accurate image of its memory footprint as a whole. Consequently, under "
"certain circumstances, the Python memory manager may or may not trigger "
"appropriate actions, like garbage collection, memory compaction or other "
"preventive procedures. Note that by using the C library allocator as shown "
"in the previous example, the allocated memory for the I/O buffer escapes "
"completely the Python memory manager."
msgstr ""
#: c-api/memory.rst:90
msgid "Memory Interface"
msgstr ""
#: c-api/memory.rst:92
msgid ""
"The following function sets, modeled after the ANSI C standard, but "
"specifying behavior when requesting zero bytes, are available for allocating "
"and releasing memory from the Python heap:"
msgstr ""
#: c-api/memory.rst:99
msgid ""
"Allocates *n* bytes and returns a pointer of type :c:type:`void\\*` to the "
"allocated memory, or *NULL* if the request fails. Requesting zero bytes "
"returns a distinct non-*NULL* pointer if possible, as if ``PyMem_Malloc(1)`` "
"had been called instead. The memory will not have been initialized in any "
"way."
msgstr ""
#: c-api/memory.rst:107
msgid ""
"Resizes the memory block pointed to by *p* to *n* bytes. The contents will "
"be unchanged to the minimum of the old and the new sizes. If *p* is *NULL*, "
"the call is equivalent to ``PyMem_Malloc(n)``; else if *n* is equal to zero, "
"the memory block is resized but is not freed, and the returned pointer is "
"non-*NULL*. Unless *p* is *NULL*, it must have been returned by a previous "
"call to :c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc`. If the request "
"fails, :c:func:`PyMem_Realloc` returns *NULL* and *p* remains a valid "
"pointer to the previous memory area."
msgstr ""
#: c-api/memory.rst:119
msgid ""
"Frees the memory block pointed to by *p*, which must have been returned by a "
"previous call to :c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc`. "
"Otherwise, or if ``PyMem_Free(p)`` has been called before, undefined "
"behavior occurs. If *p* is *NULL*, no operation is performed."
msgstr ""
#: c-api/memory.rst:124
msgid ""
"The following type-oriented macros are provided for convenience. Note that "
"*TYPE* refers to any C type."
msgstr ""
#: c-api/memory.rst:130
msgid ""
"Same as :c:func:`PyMem_Malloc`, but allocates ``(n * sizeof(TYPE))`` bytes "
"of memory. Returns a pointer cast to :c:type:`TYPE\\*`. The memory will "
"not have been initialized in any way."
msgstr ""
#: c-api/memory.rst:137
msgid ""
"Same as :c:func:`PyMem_Realloc`, but the memory block is resized to ``(n * "
"sizeof(TYPE))`` bytes. Returns a pointer cast to :c:type:`TYPE\\*`. On "
"return, *p* will be a pointer to the new memory area, or *NULL* in the event "
"of failure. This is a C preprocessor macro; p is always reassigned. Save "
"the original value of p to avoid losing memory when handling errors."
msgstr ""
#: c-api/memory.rst:146
msgid "Same as :c:func:`PyMem_Free`."
msgstr ""
#: c-api/memory.rst:148
msgid ""
"In addition, the following macro sets are provided for calling the Python "
"memory allocator directly, without involving the C API functions listed "
"above. However, note that their use does not preserve binary compatibility "
"across Python versions and is therefore deprecated in extension modules."
msgstr ""
#: c-api/memory.rst:153
msgid ":c:func:`PyMem_MALLOC`, :c:func:`PyMem_REALLOC`, :c:func:`PyMem_FREE`."
msgstr ""
#: c-api/memory.rst:155
msgid ":c:func:`PyMem_NEW`, :c:func:`PyMem_RESIZE`, :c:func:`PyMem_DEL`."
msgstr ""
#: c-api/memory.rst:161
msgid "Examples"
msgstr "Exemples"
#: c-api/memory.rst:163
msgid ""
"Here is the example from section :ref:`memoryoverview`, rewritten so that "
"the I/O buffer is allocated from the Python heap by using the first function "
"set::"
msgstr ""
#: c-api/memory.rst:176
msgid "The same code using the type-oriented function set::"
msgstr ""
#: c-api/memory.rst:188
msgid ""
"Note that in the two examples above, the buffer is always manipulated via "
"functions belonging to the same set. Indeed, it is required to use the same "
"memory API family for a given memory block, so that the risk of mixing "
"different allocators is reduced to a minimum. The following code sequence "
"contains two errors, one of which is labeled as *fatal* because it mixes two "
"different allocators operating on different heaps. ::"
msgstr ""
#: c-api/memory.rst:203
msgid ""
"In addition to the functions aimed at handling raw memory blocks from the "
"Python heap, objects in Python are allocated and released with :c:func:"
"`PyObject_New`, :c:func:`PyObject_NewVar` and :c:func:`PyObject_Del`."
msgstr ""
#: c-api/memory.rst:207
msgid ""
"These will be explained in the next chapter on defining and implementing new "
"object types in C."
msgstr ""
#: c-api/method.rst:6
msgid "Method Objects"
msgstr "Les objets méthode"
#: c-api/method.rst:10
msgid ""
"There are some useful functions that are useful for working with method "
"objects."
msgstr ""
#: c-api/method.rst:17
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python method type. "
"This is exposed to Python programs as ``types.MethodType``."
msgstr ""
#: c-api/method.rst:23
msgid ""
"Return true if *o* is a method object (has type :c:data:`PyMethod_Type`). "
"The parameter must not be *NULL*."
msgstr ""
#: c-api/method.rst:29
msgid ""
"Return a new method object, with *func* being any callable object; this is "
"the function that will be called when the method is called. If this method "
"should be bound to an instance, *self* should be the instance and *class* "
"should be the class of *self*, otherwise *self* should be *NULL* and *class* "
"should be the class which provides the unbound method.."
msgstr ""
#: c-api/method.rst:38
msgid ""
"Return the class object from which the method *meth* was created; if this "
"was created from an instance, it will be the class of the instance."
msgstr ""
#: c-api/method.rst:44
msgid "Macro version of :c:func:`PyMethod_Class` which avoids error checking."
msgstr ""
#: c-api/method.rst:49
msgid "Return the function object associated with the method *meth*."
msgstr ""
#: c-api/method.rst:54
msgid ""
"Macro version of :c:func:`PyMethod_Function` which avoids error checking."
msgstr ""
#: c-api/method.rst:59
msgid ""
"Return the instance associated with the method *meth* if it is bound, "
"otherwise return *NULL*."
msgstr ""
#: c-api/method.rst:65
msgid "Macro version of :c:func:`PyMethod_Self` which avoids error checking."
msgstr ""
#: c-api/method.rst:70 c-api/tuple.rst:162 c-api/unicode.rst:104
msgid "Clear the free list. Return the total number of freed items."
msgstr ""
#: c-api/module.rst:6
msgid "Module Objects"
msgstr ""
#: c-api/module.rst:10
msgid "There are only a few functions special to module objects."
msgstr ""
#: c-api/module.rst:17
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python module type. "
"This is exposed to Python programs as ``types.ModuleType``."
msgstr ""
#: c-api/module.rst:23
msgid "Return true if *p* is a module object, or a subtype of a module object."
msgstr ""
#: c-api/module.rst:31
msgid ""
"Return true if *p* is a module object, but not a subtype of :c:data:"
"`PyModule_Type`."
msgstr ""
#: c-api/module.rst:44
msgid ""
"Return a new module object with the :attr:`__name__` attribute set to "
"*name*. Only the module's :attr:`__doc__` and :attr:`__name__` attributes "
"are filled in; the caller is responsible for providing a :attr:`__file__` "
"attribute."
msgstr ""
#: c-api/module.rst:53
msgid ""
"Return the dictionary object that implements *module*'s namespace; this "
"object is the same as the :attr:`__dict__` attribute of the module object. "
"This function never fails. It is recommended extensions use other :c:func:"
"`PyModule_\\*` and :c:func:`PyObject_\\*` functions rather than directly "
"manipulate a module's :attr:`__dict__`."
msgstr ""
#: c-api/module.rst:66
msgid ""
"Return *module*'s :attr:`__name__` value. If the module does not provide "
"one, or if it is not a string, :exc:`SystemError` is raised and *NULL* is "
"returned."
msgstr ""
#: c-api/module.rst:76
msgid ""
"Return the name of the file from which *module* was loaded using *module*'s :"
"attr:`__file__` attribute. If this is not defined, or if it is not a "
"string, raise :exc:`SystemError` and return *NULL*."
msgstr ""
#: c-api/module.rst:83
msgid ""
"Add an object to *module* as *name*. This is a convenience function which "
"can be used from the module's initialization function. This steals a "
"reference to *value*. Return ``-1`` on error, ``0`` on success."
msgstr ""
#: c-api/module.rst:92
msgid ""
"Add an integer constant to *module* as *name*. This convenience function "
"can be used from the module's initialization function. Return ``-1`` on "
"error, ``0`` on success."
msgstr ""
#: c-api/module.rst:101
msgid ""
"Add a string constant to *module* as *name*. This convenience function can "
"be used from the module's initialization function. The string *value* must "
"be null-terminated. Return ``-1`` on error, ``0`` on success."
msgstr ""
#: c-api/module.rst:109
msgid ""
"Add an int constant to *module*. The name and the value are taken from "
"*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int "
"constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` on "
"error, ``0`` on success."
msgstr ""
#: c-api/module.rst:118
msgid "Add a string constant to *module*."
msgstr ""
#: c-api/none.rst:6
msgid "The None Object"
msgstr ""
#: c-api/none.rst:10
msgid ""
"Note that the :c:type:`PyTypeObject` for ``None`` is not directly exposed in "
"the Python/C API. Since ``None`` is a singleton, testing for object "
"identity (using ``==`` in C) is sufficient. There is no :c:func:"
"`PyNone_Check` function for the same reason."
msgstr ""
#: c-api/none.rst:18
msgid ""
"The Python ``None`` object, denoting lack of value. This object has no "
"methods. It needs to be treated just like any other object with respect to "
"reference counts."
msgstr ""
#: c-api/none.rst:25
msgid "Properly handle returning :c:data:`Py_None` from within a C function."
msgstr ""
#: c-api/number.rst:6
msgid "Number Protocol"
msgstr ""
#: c-api/number.rst:11
msgid ""
"Returns ``1`` if the object *o* provides numeric protocols, and false "
"otherwise. This function always succeeds."
msgstr ""
#: c-api/number.rst:17
msgid ""
"Returns the result of adding *o1* and *o2*, or *NULL* on failure. This is "
"the equivalent of the Python expression ``o1 + o2``."
msgstr ""
#: c-api/number.rst:23
msgid ""
"Returns the result of subtracting *o2* from *o1*, or *NULL* on failure. "
"This is the equivalent of the Python expression ``o1 - o2``."
msgstr ""
#: c-api/number.rst:29
msgid ""
"Returns the result of multiplying *o1* and *o2*, or *NULL* on failure. This "
"is the equivalent of the Python expression ``o1 * o2``."
msgstr ""
#: c-api/number.rst:35
msgid ""
"Returns the result of dividing *o1* by *o2*, or *NULL* on failure. This is "
"the equivalent of the Python expression ``o1 / o2``."
msgstr ""
#: c-api/number.rst:41
msgid ""
"Return the floor of *o1* divided by *o2*, or *NULL* on failure. This is "
"equivalent to the \"classic\" division of integers."
msgstr ""
#: c-api/number.rst:49
msgid ""
"Return a reasonable approximation for the mathematical value of *o1* divided "
"by *o2*, or *NULL* on failure. The return value is \"approximate\" because "
"binary floating point numbers are approximate; it is not possible to "
"represent all real numbers in base two. This function can return a floating "
"point value when passed two integers."
msgstr ""
#: c-api/number.rst:60
msgid ""
"Returns the remainder of dividing *o1* by *o2*, or *NULL* on failure. This "
"is the equivalent of the Python expression ``o1 % o2``."
msgstr ""
#: c-api/number.rst:68
msgid ""
"See the built-in function :func:`divmod`. Returns *NULL* on failure. This "
"is the equivalent of the Python expression ``divmod(o1, o2)``."
msgstr ""
#: c-api/number.rst:76
msgid ""
"See the built-in function :func:`pow`. Returns *NULL* on failure. This is "
"the equivalent of the Python expression ``pow(o1, o2, o3)``, where *o3* is "
"optional. If *o3* is to be ignored, pass :c:data:`Py_None` in its place "
"(passing *NULL* for *o3* would cause an illegal memory access)."
msgstr ""
#: c-api/number.rst:84
msgid ""
"Returns the negation of *o* on success, or *NULL* on failure. This is the "
"equivalent of the Python expression ``-o``."
msgstr ""
#: c-api/number.rst:90
msgid ""
"Returns *o* on success, or *NULL* on failure. This is the equivalent of the "
"Python expression ``+o``."
msgstr ""
#: c-api/number.rst:98
msgid ""
"Returns the absolute value of *o*, or *NULL* on failure. This is the "
"equivalent of the Python expression ``abs(o)``."
msgstr ""
#: c-api/number.rst:104
msgid ""
"Returns the bitwise negation of *o* on success, or *NULL* on failure. This "
"is the equivalent of the Python expression ``~o``."
msgstr ""
#: c-api/number.rst:110
msgid ""
"Returns the result of left shifting *o1* by *o2* on success, or *NULL* on "
"failure. This is the equivalent of the Python expression ``o1 << o2``."
msgstr ""
#: c-api/number.rst:116
msgid ""
"Returns the result of right shifting *o1* by *o2* on success, or *NULL* on "
"failure. This is the equivalent of the Python expression ``o1 >> o2``."
msgstr ""
#: c-api/number.rst:122
msgid ""
"Returns the \"bitwise and\" of *o1* and *o2* on success and *NULL* on "
"failure. This is the equivalent of the Python expression ``o1 & o2``."
msgstr ""
#: c-api/number.rst:128
msgid ""
"Returns the \"bitwise exclusive or\" of *o1* by *o2* on success, or *NULL* "
"on failure. This is the equivalent of the Python expression ``o1 ^ o2``."
msgstr ""
#: c-api/number.rst:134
msgid ""
"Returns the \"bitwise or\" of *o1* and *o2* on success, or *NULL* on "
"failure. This is the equivalent of the Python expression ``o1 | o2``."
msgstr ""
#: c-api/number.rst:140
msgid ""
"Returns the result of adding *o1* and *o2*, or *NULL* on failure. The "
"operation is done *in-place* when *o1* supports it. This is the equivalent "
"of the Python statement ``o1 += o2``."
msgstr ""
#: c-api/number.rst:147
msgid ""
"Returns the result of subtracting *o2* from *o1*, or *NULL* on failure. The "
"operation is done *in-place* when *o1* supports it. This is the equivalent "
"of the Python statement ``o1 -= o2``."
msgstr ""
#: c-api/number.rst:154
msgid ""
"Returns the result of multiplying *o1* and *o2*, or *NULL* on failure. The "
"operation is done *in-place* when *o1* supports it. This is the equivalent "
"of the Python statement ``o1 *= o2``."
msgstr ""
#: c-api/number.rst:161
msgid ""
"Returns the result of dividing *o1* by *o2*, or *NULL* on failure. The "
"operation is done *in-place* when *o1* supports it. This is the equivalent "
"of the Python statement ``o1 /= o2``."
msgstr ""
#: c-api/number.rst:168
msgid ""
"Returns the mathematical floor of dividing *o1* by *o2*, or *NULL* on "
"failure. The operation is done *in-place* when *o1* supports it. This is "
"the equivalent of the Python statement ``o1 //= o2``."
msgstr ""
#: c-api/number.rst:177
msgid ""
"Return a reasonable approximation for the mathematical value of *o1* divided "
"by *o2*, or *NULL* on failure. The return value is \"approximate\" because "
"binary floating point numbers are approximate; it is not possible to "
"represent all real numbers in base two. This function can return a floating "
"point value when passed two integers. The operation is done *in-place* when "
"*o1* supports it."
msgstr ""
#: c-api/number.rst:188
msgid ""
"Returns the remainder of dividing *o1* by *o2*, or *NULL* on failure. The "
"operation is done *in-place* when *o1* supports it. This is the equivalent "
"of the Python statement ``o1 %= o2``."
msgstr ""
#: c-api/number.rst:197
msgid ""
"See the built-in function :func:`pow`. Returns *NULL* on failure. The "
"operation is done *in-place* when *o1* supports it. This is the equivalent "
"of the Python statement ``o1 **= o2`` when o3 is :c:data:`Py_None`, or an in-"
"place variant of ``pow(o1, o2, o3)`` otherwise. If *o3* is to be ignored, "
"pass :c:data:`Py_None` in its place (passing *NULL* for *o3* would cause an "
"illegal memory access)."
msgstr ""
#: c-api/number.rst:206
msgid ""
"Returns the result of left shifting *o1* by *o2* on success, or *NULL* on "
"failure. The operation is done *in-place* when *o1* supports it. This is "
"the equivalent of the Python statement ``o1 <<= o2``."
msgstr ""
#: c-api/number.rst:213
msgid ""
"Returns the result of right shifting *o1* by *o2* on success, or *NULL* on "
"failure. The operation is done *in-place* when *o1* supports it. This is "
"the equivalent of the Python statement ``o1 >>= o2``."
msgstr ""
#: c-api/number.rst:220
msgid ""
"Returns the \"bitwise and\" of *o1* and *o2* on success and *NULL* on "
"failure. The operation is done *in-place* when *o1* supports it. This is "
"the equivalent of the Python statement ``o1 &= o2``."
msgstr ""
#: c-api/number.rst:227
msgid ""
"Returns the \"bitwise exclusive or\" of *o1* by *o2* on success, or *NULL* "
"on failure. The operation is done *in-place* when *o1* supports it. This "
"is the equivalent of the Python statement ``o1 ^= o2``."
msgstr ""
#: c-api/number.rst:234
msgid ""
"Returns the \"bitwise or\" of *o1* and *o2* on success, or *NULL* on "
"failure. The operation is done *in-place* when *o1* supports it. This is "
"the equivalent of the Python statement ``o1 |= o2``."
msgstr ""
#: c-api/number.rst:243
msgid ""
"This function takes the addresses of two variables of type :c:type:`PyObject"
"\\*`. If the objects pointed to by ``*p1`` and ``*p2`` have the same type, "
"increment their reference count and return ``0`` (success). If the objects "
"can be converted to a common numeric type, replace ``*p1`` and ``*p2`` by "
"their converted value (with 'new' reference counts), and return ``0``. If no "
"conversion is possible, or if some other error occurs, return ``-1`` "
"(failure) and don't increment the reference counts. The call "
"``PyNumber_Coerce(&o1, &o2)`` is equivalent to the Python statement ``o1, o2 "
"= coerce(o1, o2)``."
msgstr ""
#: c-api/number.rst:255
msgid ""
"This function is similar to :c:func:`PyNumber_Coerce`, except that it "
"returns ``1`` when the conversion is not possible and when no error is "
"raised. Reference counts are still not increased in this case."
msgstr ""
#: c-api/number.rst:264
msgid ""
"Returns the *o* converted to an integer object on success, or *NULL* on "
"failure. If the argument is outside the integer range a long object will be "
"returned instead. This is the equivalent of the Python expression ``int(o)``."
msgstr ""
#: c-api/number.rst:273
msgid ""
"Returns the *o* converted to a long integer object on success, or *NULL* on "
"failure. This is the equivalent of the Python expression ``long(o)``."
msgstr ""
#: c-api/number.rst:281
msgid ""
"Returns the *o* converted to a float object on success, or *NULL* on "
"failure. This is the equivalent of the Python expression ``float(o)``."
msgstr ""
#: c-api/number.rst:287
msgid ""
"Returns the *o* converted to a Python int or long on success or *NULL* with "
"a :exc:`TypeError` exception raised on failure."
msgstr ""
#: c-api/number.rst:295
msgid ""
"Returns the integer *n* converted to *base* as a string with a base marker "
"of ``'0b'``, ``'0o'``, or ``'0x'`` if applicable. When *base* is not 2, 8, "
"10, or 16, the format is ``'x#num'`` where x is the base. If *n* is not an "
"int object, it is converted with :c:func:`PyNumber_Index` first."
msgstr ""
#: c-api/number.rst:306
msgid ""
"Returns *o* converted to a Py_ssize_t value if *o* can be interpreted as an "
"integer. If *o* can be converted to a Python int or long but the attempt to "
"convert to a Py_ssize_t value would raise an :exc:`OverflowError`, then the "
"*exc* argument is the type of exception that will be raised (usually :exc:"
"`IndexError` or :exc:`OverflowError`). If *exc* is *NULL*, then the "
"exception is cleared and the value is clipped to *PY_SSIZE_T_MIN* for a "
"negative integer or *PY_SSIZE_T_MAX* for a positive integer."
msgstr ""
#: c-api/number.rst:319
msgid ""
"Returns True if *o* is an index integer (has the nb_index slot of the "
"tp_as_number structure filled in)."
msgstr ""
#: c-api/objbuffer.rst:7
msgid "Old Buffer Protocol"
msgstr ""
#: c-api/objbuffer.rst:9
msgid ""
"This section describes the legacy buffer protocol, which has been introduced "
"in Python 1.6. It is still supported but deprecated in the Python 2.x "
"series. Python 3 introduces a new buffer protocol which fixes weaknesses and "
"shortcomings of the protocol, and has been backported to Python 2.6. See :"
"ref:`bufferobjects` for more information."
msgstr ""
#: c-api/objbuffer.rst:18
msgid ""
"Returns a pointer to a read-only memory location usable as character-based "
"input. The *obj* argument must support the single-segment character buffer "
"interface. On success, returns ``0``, sets *buffer* to the memory location "
"and *buffer_len* to the buffer length. Returns ``-1`` and sets a :exc:"
"`TypeError` on error."
msgstr ""
#: c-api/objbuffer.rst:26 c-api/objbuffer.rst:41 c-api/objbuffer.rst:63
msgid ""
"This function used an :c:type:`int *` type for *buffer_len*. This might "
"require changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/objbuffer.rst:33
msgid ""
"Returns a pointer to a read-only memory location containing arbitrary data. "
"The *obj* argument must support the single-segment readable buffer "
"interface. On success, returns ``0``, sets *buffer* to the memory location "
"and *buffer_len* to the buffer length. Returns ``-1`` and sets a :exc:"
"`TypeError` on error."
msgstr ""
#: c-api/objbuffer.rst:48
msgid ""
"Returns ``1`` if *o* supports the single-segment readable buffer interface. "
"Otherwise returns ``0``."
msgstr ""
#: c-api/objbuffer.rst:56
msgid ""
"Returns a pointer to a writeable memory location. The *obj* argument must "
"support the single-segment, character buffer interface. On success, returns "
"``0``, sets *buffer* to the memory location and *buffer_len* to the buffer "
"length. Returns ``-1`` and sets a :exc:`TypeError` on error."
msgstr ""
#: c-api/object.rst:6
msgid "Object Protocol"
msgstr ""
#: c-api/object.rst:11
msgid ""
"Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags "
"argument is used to enable certain printing options. The only option "
"currently supported is :const:`Py_PRINT_RAW`; if given, the :func:`str` of "
"the object is written instead of the :func:`repr`."
msgstr ""
#: c-api/object.rst:19 c-api/object.rst:26
msgid ""
"Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. "
"This is equivalent to the Python expression ``hasattr(o, attr_name)``. This "
"function always succeeds."
msgstr ""
#: c-api/object.rst:33
msgid ""
"Retrieve an attribute named *attr_name* from object *o*. Returns the "
"attribute value on success, or *NULL* on failure. This is the equivalent of "
"the Python expression ``o.attr_name``."
msgstr ""
#: c-api/object.rst:40
msgid ""
"Retrieve an attribute named *attr_name* from object *o*. Returns the "
"attribute value on success, or *NULL* on failure. This is the equivalent of "
"the Python expression ``o.attr_name``."
msgstr ""
#: c-api/object.rst:47
msgid ""
"Generic attribute getter function that is meant to be put into a type "
"object's ``tp_getattro`` slot. It looks for a descriptor in the dictionary "
"of classes in the object's MRO as well as an attribute in the object's :attr:"
"`~object.__dict__` (if present). As outlined in :ref:`descriptors`, data "
"descriptors take preference over instance attributes, while non-data "
"descriptors don't. Otherwise, an :exc:`AttributeError` is raised."
msgstr ""
#: c-api/object.rst:57 c-api/object.rst:64
msgid ""
"Set the value of the attribute named *attr_name*, for object *o*, to the "
"value *v*. Returns ``-1`` on failure. This is the equivalent of the Python "
"statement ``o.attr_name = v``."
msgstr ""
#: c-api/object.rst:71
msgid ""
"Generic attribute setter function that is meant to be put into a type "
"object's ``tp_setattro`` slot. It looks for a data descriptor in the "
"dictionary of classes in the object's MRO, and if found it takes preference "
"over setting the attribute in the instance dictionary. Otherwise, the "
"attribute is set in the object's :attr:`~object.__dict__` (if present). "
"Otherwise, an :exc:`AttributeError` is raised and ``-1`` is returned."
msgstr ""
#: c-api/object.rst:81 c-api/object.rst:87
msgid ""
"Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on "
"failure. This is the equivalent of the Python statement ``del o.attr_name``."
msgstr ""
#: c-api/object.rst:93
msgid ""
"Compare the values of *o1* and *o2* using the operation specified by *opid*, "
"which must be one of :const:`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`, :const:"
"`Py_NE`, :const:`Py_GT`, or :const:`Py_GE`, corresponding to ``<``, ``<=``, "
"``==``, ``!=``, ``>``, or ``>=`` respectively. This is the equivalent of the "
"Python expression ``o1 op o2``, where ``op`` is the operator corresponding "
"to *opid*. Returns the value of the comparison on success, or *NULL* on "
"failure."
msgstr ""
#: c-api/object.rst:103
msgid ""
"Compare the values of *o1* and *o2* using the operation specified by *opid*, "
"which must be one of :const:`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`, :const:"
"`Py_NE`, :const:`Py_GT`, or :const:`Py_GE`, corresponding to ``<``, ``<=``, "
"``==``, ``!=``, ``>``, or ``>=`` respectively. Returns ``-1`` on error, "
"``0`` if the result is false, ``1`` otherwise. This is the equivalent of the "
"Python expression ``o1 op o2``, where ``op`` is the operator corresponding "
"to *opid*."
msgstr ""
#: c-api/object.rst:112
msgid ""
"If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool` "
"will always return ``1`` for :const:`Py_EQ` and ``0`` for :const:`Py_NE`."
msgstr ""
#: c-api/object.rst:119
msgid ""
"Compare the values of *o1* and *o2* using a routine provided by *o1*, if one "
"exists, otherwise with a routine provided by *o2*. The result of the "
"comparison is returned in *result*. Returns ``-1`` on failure. This is the "
"equivalent of the Python statement ``result = cmp(o1, o2)``."
msgstr ""
#: c-api/object.rst:129
msgid ""
"Compare the values of *o1* and *o2* using a routine provided by *o1*, if one "
"exists, otherwise with a routine provided by *o2*. Returns the result of "
"the comparison on success. On error, the value returned is undefined; use :"
"c:func:`PyErr_Occurred` to detect an error. This is equivalent to the "
"Python expression ``cmp(o1, o2)``."
msgstr ""
#: c-api/object.rst:140
msgid ""
"Compute a string representation of object *o*. Returns the string "
"representation on success, *NULL* on failure. This is the equivalent of the "
"Python expression ``repr(o)``. Called by the :func:`repr` built-in function "
"and by reverse quotes."
msgstr ""
#: c-api/object.rst:150
msgid ""
"Compute a string representation of object *o*. Returns the string "
"representation on success, *NULL* on failure. This is the equivalent of the "
"Python expression ``str(o)``. Called by the :func:`str` built-in function "
"and by the :keyword:`print` statement."
msgstr ""
#: c-api/object.rst:160
msgid ""
"Compute a bytes representation of object *o*. In 2.x, this is just a alias "
"for :c:func:`PyObject_Str`."
msgstr ""
#: c-api/object.rst:168
msgid ""
"Compute a Unicode string representation of object *o*. Returns the Unicode "
"string representation on success, *NULL* on failure. This is the equivalent "
"of the Python expression ``unicode(o)``. Called by the :func:`unicode` "
"built-in function."
msgstr ""
#: c-api/object.rst:176
msgid ""
"Returns ``1`` if *inst* is an instance of the class *cls* or a subclass of "
"*cls*, or ``0`` if not. On error, returns ``-1`` and sets an exception. If "
"*cls* is a type object rather than a class object, :c:func:"
"`PyObject_IsInstance` returns ``1`` if *inst* is of type *cls*. If *cls* is "
"a tuple, the check will be done against every entry in *cls*. The result "
"will be ``1`` when at least one of the checks returns ``1``, otherwise it "
"will be ``0``. If *inst* is not a class instance and *cls* is neither a type "
"object, nor a class object, nor a tuple, *inst* must have a :attr:`~instance."
"__class__` attribute --- the class relationship of the value of that "
"attribute with *cls* will be used to determine the result of this function."
msgstr ""
#: c-api/object.rst:189
msgid "Support for a tuple as the second argument added."
msgstr ""
#: c-api/object.rst:192
msgid ""
"Subclass determination is done in a fairly straightforward way, but includes "
"a wrinkle that implementors of extensions to the class system may want to be "
"aware of. If :class:`A` and :class:`B` are class objects, :class:`B` is a "
"subclass of :class:`A` if it inherits from :class:`A` either directly or "
"indirectly. If either is not a class object, a more general mechanism is "
"used to determine the class relationship of the two objects. When testing "
"if *B* is a subclass of *A*, if *A* is *B*, :c:func:`PyObject_IsSubclass` "
"returns true. If *A* and *B* are different objects, *B*'s :attr:`~class."
"__bases__` attribute is searched in a depth-first fashion for *A* --- the "
"presence of the :attr:`~class.__bases__` attribute is considered sufficient "
"for this determination."
msgstr ""
#: c-api/object.rst:206
msgid ""
"Returns ``1`` if the class *derived* is identical to or derived from the "
"class *cls*, otherwise returns ``0``. In case of an error, returns ``-1``. "
"If *cls* is a tuple, the check will be done against every entry in *cls*. "
"The result will be ``1`` when at least one of the checks returns ``1``, "
"otherwise it will be ``0``. If either *derived* or *cls* is not an actual "
"class object (or tuple), this function uses the generic algorithm described "
"above."
msgstr ""
#: c-api/object.rst:215
msgid ""
"Older versions of Python did not support a tuple as the second argument."
msgstr ""
#: c-api/object.rst:221
msgid ""
"Determine if the object *o* is callable. Return ``1`` if the object is "
"callable and ``0`` otherwise. This function always succeeds."
msgstr ""
#: c-api/object.rst:229
msgid ""
"Call a callable Python object *callable_object*, with arguments given by the "
"tuple *args*, and named arguments given by the dictionary *kw*. If no named "
"arguments are needed, *kw* may be *NULL*. *args* must not be *NULL*, use an "
"empty tuple if no arguments are needed. Returns the result of the call on "
"success, or *NULL* on failure. This is the equivalent of the Python "
"expression ``apply(callable_object, args, kw)`` or ``callable_object(*args, "
"**kw)``."
msgstr ""
#: c-api/object.rst:243
msgid ""
"Call a callable Python object *callable_object*, with arguments given by the "
"tuple *args*. If no arguments are needed, then *args* may be *NULL*. "
"Returns the result of the call on success, or *NULL* on failure. This is "
"the equivalent of the Python expression ``apply(callable_object, args)`` or "
"``callable_object(*args)``."
msgstr ""
#: c-api/object.rst:254
msgid ""
"Call a callable Python object *callable*, with a variable number of C "
"arguments. The C arguments are described using a :c:func:`Py_BuildValue` "
"style format string. The format may be *NULL*, indicating that no arguments "
"are provided. Returns the result of the call on success, or *NULL* on "
"failure. This is the equivalent of the Python expression ``apply(callable, "
"args)`` or ``callable(*args)``. Note that if you only pass :c:type:`PyObject "
"\\*` args, :c:func:`PyObject_CallFunctionObjArgs` is a faster alternative."
msgstr ""
#: c-api/object.rst:265
msgid ""
"Call the method named *method* of object *o* with a variable number of C "
"arguments. The C arguments are described by a :c:func:`Py_BuildValue` "
"format string that should produce a tuple. The format may be *NULL*, "
"indicating that no arguments are provided. Returns the result of the call on "
"success, or *NULL* on failure. This is the equivalent of the Python "
"expression ``o.method(args)``. Note that if you only pass :c:type:`PyObject "
"\\*` args, :c:func:`PyObject_CallMethodObjArgs` is a faster alternative."
msgstr ""
#: c-api/object.rst:276
msgid ""
"Call a callable Python object *callable*, with a variable number of :c:type:"
"`PyObject\\*` arguments. The arguments are provided as a variable number of "
"parameters followed by *NULL*. Returns the result of the call on success, or "
"*NULL* on failure."
msgstr ""
#: c-api/object.rst:286
msgid ""
"Calls a method of the object *o*, where the name of the method is given as a "
"Python string object in *name*. It is called with a variable number of :c:"
"type:`PyObject\\*` arguments. The arguments are provided as a variable "
"number of parameters followed by *NULL*. Returns the result of the call on "
"success, or *NULL* on failure."
msgstr ""
#: c-api/object.rst:299
msgid ""
"Compute and return the hash value of an object *o*. On failure, return "
"``-1``. This is the equivalent of the Python expression ``hash(o)``."
msgstr ""
#: c-api/object.rst:305
msgid ""
"Set a :exc:`TypeError` indicating that ``type(o)`` is not hashable and "
"return ``-1``. This function receives special treatment when stored in a "
"``tp_hash`` slot, allowing a type to explicitly indicate to the interpreter "
"that it is not hashable."
msgstr ""
#: c-api/object.rst:315
msgid ""
"Returns ``1`` if the object *o* is considered to be true, and ``0`` "
"otherwise. This is equivalent to the Python expression ``not not o``. On "
"failure, return ``-1``."
msgstr ""
#: c-api/object.rst:322
msgid ""
"Returns ``0`` if the object *o* is considered to be true, and ``1`` "
"otherwise. This is equivalent to the Python expression ``not o``. On "
"failure, return ``-1``."
msgstr ""
#: c-api/object.rst:331
msgid ""
"When *o* is non-*NULL*, returns a type object corresponding to the object "
"type of object *o*. On failure, raises :exc:`SystemError` and returns "
"*NULL*. This is equivalent to the Python expression ``type(o)``. This "
"function increments the reference count of the return value. There's really "
"no reason to use this function instead of the common expression ``o-"
">ob_type``, which returns a pointer of type :c:type:`PyTypeObject\\*`, "
"except when the incremented reference count is needed."
msgstr ""
#: c-api/object.rst:342
msgid ""
"Return true if the object *o* is of type *type* or a subtype of *type*. "
"Both parameters must be non-*NULL*."
msgstr ""
#: c-api/object.rst:353
msgid ""
"Return the length of object *o*. If the object *o* provides either the "
"sequence and mapping protocols, the sequence length is returned. On error, "
"``-1`` is returned. This is the equivalent to the Python expression "
"``len(o)``."
msgstr ""
#: c-api/object.rst:370
msgid ""
"Map the object *key* to the value *v*. Returns ``-1`` on failure. This is "
"the equivalent of the Python statement ``o[key] = v``."
msgstr ""
#: c-api/object.rst:376
msgid ""
"Delete the mapping for *key* from *o*. Returns ``-1`` on failure. This is "
"the equivalent of the Python statement ``del o[key]``."
msgstr ""
#: c-api/object.rst:382
msgid ""
"Derives a file descriptor from a Python object. If the object is an integer "
"or long integer, its value is returned. If not, the object's :meth:`fileno` "
"method is called if it exists; the method must return an integer or long "
"integer, which is returned as the file descriptor value. Returns ``-1`` on "
"failure."
msgstr ""
#: c-api/object.rst:390
msgid ""
"This is equivalent to the Python expression ``dir(o)``, returning a "
"(possibly empty) list of strings appropriate for the object argument, or "
"*NULL* if there was an error. If the argument is *NULL*, this is like the "
"Python ``dir()``, returning the names of the current locals; in this case, "
"if no execution frame is active then *NULL* is returned but :c:func:"
"`PyErr_Occurred` will return false."
msgstr ""
#: c-api/object.rst:399
msgid ""
"This is equivalent to the Python expression ``iter(o)``. It returns a new "
"iterator for the object argument, or the object itself if the object is "
"already an iterator. Raises :exc:`TypeError` and returns *NULL* if the "
"object cannot be iterated."
msgstr ""
#: c-api/objimpl.rst:8
msgid "Object Implementation Support"
msgstr ""
#: c-api/objimpl.rst:10
msgid ""
"This chapter describes the functions, types, and macros used when defining "
"new object types."
msgstr ""
#: c-api/refcounting.rst:8
msgid "Reference Counting"
msgstr ""
#: c-api/refcounting.rst:10
msgid ""
"The macros in this section are used for managing reference counts of Python "
"objects."
msgstr ""
#: c-api/refcounting.rst:16
msgid ""
"Increment the reference count for object *o*. The object must not be "
"*NULL*; if you aren't sure that it isn't *NULL*, use :c:func:`Py_XINCREF`."
msgstr ""
#: c-api/refcounting.rst:22
msgid ""
"Increment the reference count for object *o*. The object may be *NULL*, in "
"which case the macro has no effect."
msgstr ""
#: c-api/refcounting.rst:28
msgid ""
"Decrement the reference count for object *o*. The object must not be "
"*NULL*; if you aren't sure that it isn't *NULL*, use :c:func:`Py_XDECREF`. "
"If the reference count reaches zero, the object's type's deallocation "
"function (which must not be *NULL*) is invoked."
msgstr ""
#: c-api/refcounting.rst:35
msgid ""
"The deallocation function can cause arbitrary Python code to be invoked (e."
"g. when a class instance with a :meth:`__del__` method is deallocated). "
"While exceptions in such code are not propagated, the executed code has free "
"access to all Python global variables. This means that any object that is "
"reachable from a global variable should be in a consistent state before :c:"
"func:`Py_DECREF` is invoked. For example, code to delete an object from a "
"list should copy a reference to the deleted object in a temporary variable, "
"update the list data structure, and then call :c:func:`Py_DECREF` for the "
"temporary variable."
msgstr ""
#: c-api/refcounting.rst:47
msgid ""
"Decrement the reference count for object *o*. The object may be *NULL*, in "
"which case the macro has no effect; otherwise the effect is the same as for :"
"c:func:`Py_DECREF`, and the same warning applies."
msgstr ""
#: c-api/refcounting.rst:54
msgid ""
"Decrement the reference count for object *o*. The object may be *NULL*, in "
"which case the macro has no effect; otherwise the effect is the same as for :"
"c:func:`Py_DECREF`, except that the argument is also set to *NULL*. The "
"warning for :c:func:`Py_DECREF` does not apply with respect to the object "
"passed because the macro carefully uses a temporary variable and sets the "
"argument to *NULL* before decrementing its reference count."
msgstr ""
#: c-api/refcounting.rst:61
msgid ""
"It is a good idea to use this macro whenever decrementing the value of a "
"variable that might be traversed during garbage collection."
msgstr ""
#: c-api/refcounting.rst:66
msgid ""
"The following functions are for runtime dynamic embedding of Python: "
"``Py_IncRef(PyObject *o)``, ``Py_DecRef(PyObject *o)``. They are simply "
"exported function versions of :c:func:`Py_XINCREF` and :c:func:`Py_XDECREF`, "
"respectively."
msgstr ""
#: c-api/refcounting.rst:71
msgid ""
"The following functions or macros are only for use within the interpreter "
"core: :c:func:`_Py_Dealloc`, :c:func:`_Py_ForgetReference`, :c:func:"
"`_Py_NewReference`, as well as the global variable :c:data:`_Py_RefTotal`."
msgstr ""
#: c-api/reflection.rst:6
msgid "Reflection"
msgstr ""
#: c-api/reflection.rst:10
msgid ""
"Return a dictionary of the builtins in the current execution frame, or the "
"interpreter of the thread state if no frame is currently executing."
msgstr ""
#: c-api/reflection.rst:16
msgid ""
"Return a dictionary of the local variables in the current execution frame, "
"or *NULL* if no frame is currently executing."
msgstr ""
#: c-api/reflection.rst:22
msgid ""
"Return a dictionary of the global variables in the current execution frame, "
"or *NULL* if no frame is currently executing."
msgstr ""
#: c-api/reflection.rst:28
msgid ""
"Return the current thread state's frame, which is *NULL* if no frame is "
"currently executing."
msgstr ""
#: c-api/reflection.rst:34
msgid "Return the line number that *frame* is currently executing."
msgstr ""
#: c-api/reflection.rst:39
msgid ""
"If there is a current frame and it is executing in restricted mode, return "
"true, otherwise false."
msgstr ""
#: c-api/reflection.rst:45
msgid ""
"Return the name of *func* if it is a function, class or instance object, "
"else the name of *func*\\s type."
msgstr ""
#: c-api/reflection.rst:51
msgid ""
"Return a description string, depending on the type of *func*. Return values "
"include \"()\" for functions and methods, \" constructor\", \" instance\", "
"and \" object\". Concatenated with the result of :c:func:"
"`PyEval_GetFuncName`, the result will be a description of *func*."
msgstr ""
#: c-api/sequence.rst:6
msgid "Sequence Protocol"
msgstr ""
#: c-api/sequence.rst:11
msgid ""
"Return ``1`` if the object provides sequence protocol, and ``0`` otherwise. "
"This function always succeeds."
msgstr ""
#: c-api/sequence.rst:20
msgid ""
"Returns the number of objects in sequence *o* on success, and ``-1`` on "
"failure. For objects that do not provide sequence protocol, this is "
"equivalent to the Python expression ``len(o)``."
msgstr ""
#: c-api/sequence.rst:31
msgid ""
"Return the concatenation of *o1* and *o2* on success, and *NULL* on failure. "
"This is the equivalent of the Python expression ``o1 + o2``."
msgstr ""
#: c-api/sequence.rst:37
msgid ""
"Return the result of repeating sequence object *o* *count* times, or *NULL* "
"on failure. This is the equivalent of the Python expression ``o * count``."
msgstr ""
#: c-api/sequence.rst:40 c-api/sequence.rst:58
msgid ""
"This function used an :c:type:`int` type for *count*. This might require "
"changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/sequence.rst:47
msgid ""
"Return the concatenation of *o1* and *o2* on success, and *NULL* on failure. "
"The operation is done *in-place* when *o1* supports it. This is the "
"equivalent of the Python expression ``o1 += o2``."
msgstr ""
#: c-api/sequence.rst:54
msgid ""
"Return the result of repeating sequence object *o* *count* times, or *NULL* "
"on failure. The operation is done *in-place* when *o* supports it. This is "
"the equivalent of the Python expression ``o *= count``."
msgstr ""
#: c-api/sequence.rst:65
msgid ""
"Return the *i*\\ th element of *o*, or *NULL* on failure. This is the "
"equivalent of the Python expression ``o[i]``."
msgstr ""
#: c-api/sequence.rst:68 c-api/sequence.rst:89 c-api/sequence.rst:99
#: c-api/sequence.rst:181 c-api/sequence.rst:207
msgid ""
"This function used an :c:type:`int` type for *i*. This might require changes "
"in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/sequence.rst:75
msgid ""
"Return the slice of sequence object *o* between *i1* and *i2*, or *NULL* on "
"failure. This is the equivalent of the Python expression ``o[i1:i2]``."
msgstr ""
#: c-api/sequence.rst:78 c-api/sequence.rst:109 c-api/sequence.rst:119
msgid ""
"This function used an :c:type:`int` type for *i1* and *i2*. This might "
"require changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/sequence.rst:85
msgid ""
"Assign object *v* to the *i*\\ th element of *o*. Returns ``-1`` on "
"failure. This is the equivalent of the Python statement ``o[i] = v``. This "
"function *does not* steal a reference to *v*."
msgstr ""
#: c-api/sequence.rst:96
msgid ""
"Delete the *i*\\ th element of object *o*. Returns ``-1`` on failure. This "
"is the equivalent of the Python statement ``del o[i]``."
msgstr ""
#: c-api/sequence.rst:106
msgid ""
"Assign the sequence object *v* to the slice in sequence object *o* from *i1* "
"to *i2*. This is the equivalent of the Python statement ``o[i1:i2] = v``."
msgstr ""
#: c-api/sequence.rst:116
msgid ""
"Delete the slice in sequence object *o* from *i1* to *i2*. Returns ``-1`` "
"on failure. This is the equivalent of the Python statement ``del o[i1:i2]``."
msgstr ""
#: c-api/sequence.rst:126
msgid ""
"Return the number of occurrences of *value* in *o*, that is, return the "
"number of keys for which ``o[key] == value``. On failure, return ``-1``. "
"This is equivalent to the Python expression ``o.count(value)``."
msgstr ""
#: c-api/sequence.rst:130 c-api/sequence.rst:147 c-api/string.rst:157
#: c-api/tuple.rst:67 c-api/tuple.rst:77 c-api/unicode.rst:75
#: c-api/unicode.rst:85 c-api/unicode.rst:343
msgid ""
"This function returned an :c:type:`int` type. This might require changes in "
"your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/sequence.rst:137
msgid ""
"Determine if *o* contains *value*. If an item in *o* is equal to *value*, "
"return ``1``, otherwise return ``0``. On error, return ``-1``. This is "
"equivalent to the Python expression ``value in o``."
msgstr ""
#: c-api/sequence.rst:144
msgid ""
"Return the first index *i* for which ``o[i] == value``. On error, return "
"``-1``. This is equivalent to the Python expression ``o.index(value)``."
msgstr ""
#: c-api/sequence.rst:154
msgid ""
"Return a list object with the same contents as the arbitrary sequence *o*. "
"The returned list is guaranteed to be new."
msgstr ""
#: c-api/sequence.rst:162
msgid ""
"Return a tuple object with the same contents as the arbitrary sequence *o* "
"or *NULL* on failure. If *o* is a tuple, a new reference will be returned, "
"otherwise a tuple will be constructed with the appropriate contents. This "
"is equivalent to the Python expression ``tuple(o)``."
msgstr ""
#: c-api/sequence.rst:170
msgid ""
"Return the sequence *o* as a list, unless it is already a tuple or list, in "
"which case *o* is returned. Use :c:func:`PySequence_Fast_GET_ITEM` to "
"access the members of the result. Returns *NULL* on failure. If the object "
"is not a sequence, raises :exc:`TypeError` with *m* as the message text."
msgstr ""
#: c-api/sequence.rst:178
msgid ""
"Return the *i*\\ th element of *o*, assuming that *o* was returned by :c:"
"func:`PySequence_Fast`, *o* is not *NULL*, and that *i* is within bounds."
msgstr ""
#: c-api/sequence.rst:188
msgid ""
"Return the underlying array of PyObject pointers. Assumes that *o* was "
"returned by :c:func:`PySequence_Fast` and *o* is not *NULL*."
msgstr ""
#: c-api/sequence.rst:191
msgid ""
"Note, if a list gets resized, the reallocation may relocate the items array. "
"So, only use the underlying array pointer in contexts where the sequence "
"cannot change."
msgstr ""
#: c-api/sequence.rst:200
msgid ""
"Return the *i*\\ th element of *o* or *NULL* on failure. Macro form of :c:"
"func:`PySequence_GetItem` but without checking that :c:func:"
"`PySequence_Check` on *o* is true and without adjustment for negative "
"indices."
msgstr ""
#: c-api/sequence.rst:214
msgid ""
"Returns the length of *o*, assuming that *o* was returned by :c:func:"
"`PySequence_Fast` and that *o* is not *NULL*. The size can also be gotten "
"by calling :c:func:`PySequence_Size` on *o*, but :c:func:"
"`PySequence_Fast_GET_SIZE` is faster because it can assume *o* is a list or "
"tuple."
msgstr ""
#: c-api/set.rst:6
msgid "Set Objects"
msgstr ""
#: c-api/set.rst:17
msgid ""
"This section details the public API for :class:`set` and :class:`frozenset` "
"objects. Any functionality not listed below is best accessed using the "
"either the abstract object protocol (including :c:func:"
"`PyObject_CallMethod`, :c:func:`PyObject_RichCompareBool`, :c:func:"
"`PyObject_Hash`, :c:func:`PyObject_Repr`, :c:func:`PyObject_IsTrue`, :c:func:"
"`PyObject_Print`, and :c:func:`PyObject_GetIter`) or the abstract number "
"protocol (including :c:func:`PyNumber_And`, :c:func:`PyNumber_Subtract`, :c:"
"func:`PyNumber_Or`, :c:func:`PyNumber_Xor`, :c:func:`PyNumber_InPlaceAnd`, :"
"c:func:`PyNumber_InPlaceSubtract`, :c:func:`PyNumber_InPlaceOr`, and :c:func:"
"`PyNumber_InPlaceXor`)."
msgstr ""
#: c-api/set.rst:31
msgid ""
"This subtype of :c:type:`PyObject` is used to hold the internal data for "
"both :class:`set` and :class:`frozenset` objects. It is like a :c:type:"
"`PyDictObject` in that it is a fixed size for small sets (much like tuple "
"storage) and will point to a separate, variable sized block of memory for "
"medium and large sized sets (much like list storage). None of the fields of "
"this structure should be considered public and are subject to change. All "
"access should be done through the documented API rather than by manipulating "
"the values in the structure."
msgstr ""
#: c-api/set.rst:42
msgid ""
"This is an instance of :c:type:`PyTypeObject` representing the Python :class:"
"`set` type."
msgstr ""
#: c-api/set.rst:48
msgid ""
"This is an instance of :c:type:`PyTypeObject` representing the Python :class:"
"`frozenset` type."
msgstr ""
#: c-api/set.rst:51
msgid ""
"The following type check macros work on pointers to any Python object. "
"Likewise, the constructor functions work with any iterable Python object."
msgstr ""
#: c-api/set.rst:57
msgid ""
"Return true if *p* is a :class:`set` object or an instance of a subtype."
msgstr ""
#: c-api/set.rst:63
msgid ""
"Return true if *p* is a :class:`frozenset` object or an instance of a "
"subtype."
msgstr ""
#: c-api/set.rst:70
msgid ""
"Return true if *p* is a :class:`set` object, a :class:`frozenset` object, or "
"an instance of a subtype."
msgstr ""
#: c-api/set.rst:76
msgid ""
"Return true if *p* is a :class:`set` object or a :class:`frozenset` object "
"but not an instance of a subtype."
msgstr ""
#: c-api/set.rst:82
msgid ""
"Return true if *p* is a :class:`frozenset` object but not an instance of a "
"subtype."
msgstr ""
#: c-api/set.rst:88
msgid ""
"Return a new :class:`set` containing objects returned by the *iterable*. "
"The *iterable* may be *NULL* to create a new empty set. Return the new set "
"on success or *NULL* on failure. Raise :exc:`TypeError` if *iterable* is "
"not actually iterable. The constructor is also useful for copying a set "
"(``c=set(s)``)."
msgstr ""
#: c-api/set.rst:97
msgid ""
"Return a new :class:`frozenset` containing objects returned by the "
"*iterable*. The *iterable* may be *NULL* to create a new empty frozenset. "
"Return the new set on success or *NULL* on failure. Raise :exc:`TypeError` "
"if *iterable* is not actually iterable."
msgstr ""
#: c-api/set.rst:102
msgid ""
"Now guaranteed to return a brand-new :class:`frozenset`. Formerly, "
"frozensets of zero-length were a singleton. This got in the way of building-"
"up new frozensets with :meth:`PySet_Add`."
msgstr ""
#: c-api/set.rst:107
msgid ""
"The following functions and macros are available for instances of :class:"
"`set` or :class:`frozenset` or instances of their subtypes."
msgstr ""
#: c-api/set.rst:115
msgid ""
"Return the length of a :class:`set` or :class:`frozenset` object. Equivalent "
"to ``len(anyset)``. Raises a :exc:`PyExc_SystemError` if *anyset* is not a :"
"class:`set`, :class:`frozenset`, or an instance of a subtype."
msgstr ""
#: c-api/set.rst:126
msgid "Macro form of :c:func:`PySet_Size` without error checking."
msgstr ""
#: c-api/set.rst:131
msgid ""
"Return 1 if found, 0 if not found, and -1 if an error is encountered. "
"Unlike the Python :meth:`__contains__` method, this function does not "
"automatically convert unhashable sets into temporary frozensets. Raise a :"
"exc:`TypeError` if the *key* is unhashable. Raise :exc:`PyExc_SystemError` "
"if *anyset* is not a :class:`set`, :class:`frozenset`, or an instance of a "
"subtype."
msgstr ""
#: c-api/set.rst:140
msgid ""
"Add *key* to a :class:`set` instance. Does not apply to :class:`frozenset` "
"instances. Return 0 on success or -1 on failure. Raise a :exc:`TypeError` "
"if the *key* is unhashable. Raise a :exc:`MemoryError` if there is no room "
"to grow. Raise a :exc:`SystemError` if *set* is an not an instance of :class:"
"`set` or its subtype."
msgstr ""
#: c-api/set.rst:146
msgid ""
"Now works with instances of :class:`frozenset` or its subtypes. Like :c:func:"
"`PyTuple_SetItem` in that it can be used to fill-in the values of brand new "
"frozensets before they are exposed to other code."
msgstr ""
#: c-api/set.rst:151
msgid ""
"The following functions are available for instances of :class:`set` or its "
"subtypes but not for instances of :class:`frozenset` or its subtypes."
msgstr ""
#: c-api/set.rst:157
msgid ""
"Return 1 if found and removed, 0 if not found (no action taken), and -1 if "
"an error is encountered. Does not raise :exc:`KeyError` for missing keys. "
"Raise a :exc:`TypeError` if the *key* is unhashable. Unlike the Python :"
"meth:`~set.discard` method, this function does not automatically convert "
"unhashable sets into temporary frozensets. Raise :exc:`PyExc_SystemError` if "
"*set* is an not an instance of :class:`set` or its subtype."
msgstr ""
#: c-api/set.rst:167
msgid ""
"Return a new reference to an arbitrary object in the *set*, and removes the "
"object from the *set*. Return *NULL* on failure. Raise :exc:`KeyError` if "
"the set is empty. Raise a :exc:`SystemError` if *set* is an not an instance "
"of :class:`set` or its subtype."
msgstr ""
#: c-api/set.rst:175
msgid "Empty an existing set of all elements."
msgstr ""
#: c-api/slice.rst:6
msgid "Slice Objects"
msgstr ""
#: c-api/slice.rst:13
msgid ""
"The type object for slice objects. This is the same as ``slice`` and "
"``types.SliceType``."
msgstr ""
#: c-api/slice.rst:19
msgid "Return true if *ob* is a slice object; *ob* must not be *NULL*."
msgstr ""
#: c-api/slice.rst:24
msgid ""
"Return a new slice object with the given values. The *start*, *stop*, and "
"*step* parameters are used as the values of the slice object attributes of "
"the same names. Any of the values may be *NULL*, in which case the ``None`` "
"will be used for the corresponding attribute. Return *NULL* if the new "
"object could not be allocated."
msgstr ""
#: c-api/slice.rst:33
msgid ""
"Retrieve the start, stop and step indices from the slice object *slice*, "
"assuming a sequence of length *length*. Treats indices greater than *length* "
"as errors."
msgstr ""
#: c-api/slice.rst:37
msgid ""
"Returns 0 on success and -1 on error with no exception set (unless one of "
"the indices was not :const:`None` and failed to be converted to an integer, "
"in which case -1 is returned with an exception set)."
msgstr ""
#: c-api/slice.rst:41
msgid ""
"You probably do not want to use this function. If you want to use slice "
"objects in versions of Python prior to 2.3, you would probably do well to "
"incorporate the source of :c:func:`PySlice_GetIndicesEx`, suitably renamed, "
"in the source of your extension."
msgstr ""
#: c-api/slice.rst:46
msgid ""
"This function used an :c:type:`int` type for *length* and an :c:type:`int *` "
"type for *start*, *stop*, and *step*. This might require changes in your "
"code for properly supporting 64-bit systems."
msgstr ""
#: c-api/slice.rst:54
msgid ""
"Usable replacement for :c:func:`PySlice_GetIndices`. Retrieve the start, "
"stop, and step indices from the slice object *slice* assuming a sequence of "
"length *length*, and store the length of the slice in *slicelength*. Out of "
"bounds indices are clipped in a manner consistent with the handling of "
"normal slices."
msgstr ""
#: c-api/slice.rst:60
msgid "Returns 0 on success and -1 on error with exception set."
msgstr ""
#: c-api/slice.rst:64
msgid ""
"This function used an :c:type:`int` type for *length* and an :c:type:`int *` "
"type for *start*, *stop*, *step*, and *slicelength*. This might require "
"changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/string.rst:6
msgid "String/Bytes Objects"
msgstr ""
#: c-api/string.rst:8
#, fuzzy
msgid ""
"These functions raise :exc:`TypeError` when expecting a string parameter and "
"are called with a non-string parameter."
msgstr ""
"Ces fonctions lèvent :exc:`TypeError` lorsqu'elles attendent un paramètre de "
"type octets et qu'elles sont appelées avec un paramètre qui n'est pas un "
"octet."
#: c-api/string.rst:13
msgid ""
"These functions have been renamed to PyBytes_* in Python 3.x. Unless "
"otherwise noted, the PyBytes functions available in 3.x are aliased to their "
"PyString_* equivalents to help porting."
msgstr ""
#: c-api/string.rst:22
msgid "This subtype of :c:type:`PyObject` represents a Python string object."
msgstr ""
#: c-api/string.rst:29
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python string type; "
"it is the same object as ``str`` and ``types.StringType`` in the Python "
"layer. ."
msgstr ""
#: c-api/string.rst:35
msgid ""
"Return true if the object *o* is a string object or an instance of a subtype "
"of the string type."
msgstr ""
#: c-api/string.rst:44
msgid ""
"Return true if the object *o* is a string object, but not an instance of a "
"subtype of the string type."
msgstr ""
#: c-api/string.rst:52
msgid ""
"Return a new string object with a copy of the string *v* as value on "
"success, and *NULL* on failure. The parameter *v* must not be *NULL*; it "
"will not be checked."
msgstr ""
#: c-api/string.rst:59
msgid ""
"Return a new string object with a copy of the string *v* as value and length "
"*len* on success, and *NULL* on failure. If *v* is *NULL*, the contents of "
"the string are uninitialized."
msgstr ""
#: c-api/string.rst:70
msgid ""
"Take a C :c:func:`printf`\\ -style *format* string and a variable number of "
"arguments, calculate the size of the resulting Python string and return a "
"string with the values formatted into it. The variable arguments must be C "
"types and must correspond exactly to the format characters in the *format* "
"string. The following format characters are allowed:"
msgstr ""
#: c-api/string.rst:86 c-api/unicode.rst:258
msgid "Format Characters"
msgstr ""
#: c-api/string.rst:86 c-api/unicode.rst:258
msgid "Type"
msgstr ""
#: c-api/string.rst:86 c-api/unicode.rst:258
msgid "Comment"
msgstr ""
#: c-api/string.rst:88 c-api/unicode.rst:260
msgid ":attr:`%%`"
msgstr ""
#: c-api/string.rst:88 c-api/unicode.rst:260
msgid "*n/a*"
msgstr ""
#: c-api/string.rst:88 c-api/unicode.rst:260
msgid "The literal % character."
msgstr ""
#: c-api/string.rst:90 c-api/unicode.rst:262
msgid ":attr:`%c`"
msgstr ""
#: c-api/string.rst:90 c-api/string.rst:93 c-api/string.rst:117
#: c-api/string.rst:120 c-api/structures.rst:145 c-api/structures.rst:269
#: c-api/structures.rst:276 c-api/structures.rst:292 c-api/unicode.rst:262
#: c-api/unicode.rst:265 c-api/unicode.rst:283 c-api/unicode.rst:286
msgid "int"
msgstr "int"
#: c-api/string.rst:90 c-api/unicode.rst:262
msgid "A single character, represented as an C int."
msgstr ""
#: c-api/string.rst:93 c-api/unicode.rst:265
msgid ":attr:`%d`"
msgstr ""
#: c-api/string.rst:93 c-api/unicode.rst:265
msgid "Exactly equivalent to ``printf(\"%d\")``."
msgstr ""
#: c-api/string.rst:96 c-api/unicode.rst:268
msgid ":attr:`%u`"
msgstr ""
#: c-api/string.rst:96 c-api/structures.rst:302 c-api/unicode.rst:268
msgid "unsigned int"
msgstr "unsigned int"
#: c-api/string.rst:96 c-api/unicode.rst:268
msgid "Exactly equivalent to ``printf(\"%u\")``."
msgstr ""
#: c-api/string.rst:99 c-api/unicode.rst:271
msgid ":attr:`%ld`"
msgstr ""
#: c-api/string.rst:99 c-api/structures.rst:293 c-api/unicode.rst:271
msgid "long"
msgstr ""
#: c-api/string.rst:99 c-api/unicode.rst:271
msgid "Exactly equivalent to ``printf(\"%ld\")``."
msgstr ""
#: c-api/string.rst:102 c-api/unicode.rst:274
msgid ":attr:`%lu`"
msgstr ""
#: c-api/string.rst:102 c-api/structures.rst:304 c-api/unicode.rst:274
msgid "unsigned long"
msgstr "unsigned long"
#: c-api/string.rst:102 c-api/unicode.rst:274
msgid "Exactly equivalent to ``printf(\"%lu\")``."
msgstr ""
#: c-api/string.rst:105
msgid ":attr:`%lld`"
msgstr ""
#: c-api/string.rst:105 c-api/structures.rst:306
msgid "long long"
msgstr ""
#: c-api/string.rst:105
msgid "Exactly equivalent to ``printf(\"%lld\")``."
msgstr ""
#: c-api/string.rst:108
msgid ":attr:`%llu`"
msgstr ""
#: c-api/string.rst:108 c-api/structures.rst:307
msgid "unsigned long long"
msgstr "unsigned long long"
#: c-api/string.rst:108
msgid "Exactly equivalent to ``printf(\"%llu\")``."
msgstr ""
#: c-api/string.rst:111 c-api/unicode.rst:277
msgid ":attr:`%zd`"
msgstr ""
#: c-api/string.rst:111 c-api/structures.rst:272 c-api/structures.rst:308
#: c-api/unicode.rst:277
msgid "Py_ssize_t"
msgstr ""
#: c-api/string.rst:111 c-api/unicode.rst:277
msgid "Exactly equivalent to ``printf(\"%zd\")``."
msgstr ""
#: c-api/string.rst:114 c-api/unicode.rst:280
msgid ":attr:`%zu`"
msgstr ""
#: c-api/string.rst:114 c-api/unicode.rst:280
msgid "size_t"
msgstr ""
#: c-api/string.rst:114 c-api/unicode.rst:280
msgid "Exactly equivalent to ``printf(\"%zu\")``."
msgstr ""
#: c-api/string.rst:117 c-api/unicode.rst:283
msgid ":attr:`%i`"
msgstr ""
#: c-api/string.rst:117 c-api/unicode.rst:283
msgid "Exactly equivalent to ``printf(\"%i\")``."
msgstr ""
#: c-api/string.rst:120 c-api/unicode.rst:286
msgid ":attr:`%x`"
msgstr ""
#: c-api/string.rst:120 c-api/unicode.rst:286
msgid "Exactly equivalent to ``printf(\"%x\")``."
msgstr ""
#: c-api/string.rst:123 c-api/unicode.rst:289
msgid ":attr:`%s`"
msgstr ""
#: c-api/string.rst:123 c-api/unicode.rst:289
msgid "char\\*"
msgstr ""
#: c-api/string.rst:123 c-api/unicode.rst:289
msgid "A null-terminated C character array."
msgstr ""
#: c-api/string.rst:126 c-api/unicode.rst:292
msgid ":attr:`%p`"
msgstr ""
#: c-api/string.rst:126 c-api/unicode.rst:292
msgid "void\\*"
msgstr ""
#: c-api/string.rst:126 c-api/unicode.rst:292
msgid ""
"The hex representation of a C pointer. Mostly equivalent to ``printf(\"%p"
"\")`` except that it is guaranteed to start with the literal ``0x`` "
"regardless of what the platform's ``printf`` yields."
msgstr ""
#: c-api/string.rst:135 c-api/unicode.rst:316
msgid ""
"An unrecognized format character causes all the rest of the format string to "
"be copied as-is to the result string, and any extra arguments discarded."
msgstr ""
#: c-api/string.rst:140
msgid ""
"The `\"%lld\"` and `\"%llu\"` format specifiers are only available when :"
"const:`HAVE_LONG_LONG` is defined."
msgstr ""
#: c-api/string.rst:143
msgid "Support for `\"%lld\"` and `\"%llu\"` added."
msgstr ""
#: c-api/string.rst:149
msgid ""
"Identical to :c:func:`PyString_FromFormat` except that it takes exactly two "
"arguments."
msgstr ""
#: c-api/string.rst:155
msgid "Return the length of the string in string object *string*."
msgstr ""
#: c-api/string.rst:164
msgid "Macro form of :c:func:`PyString_Size` but without error checking."
msgstr ""
#: c-api/string.rst:166
msgid ""
"This macro returned an :c:type:`int` type. This might require changes in "
"your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/string.rst:173
msgid ""
"Return a NUL-terminated representation of the contents of *string*. The "
"pointer refers to the internal buffer of *string*, not a copy. The data "
"must not be modified in any way, unless the string was just created using "
"``PyString_FromStringAndSize(NULL, size)``. It must not be deallocated. If "
"*string* is a Unicode object, this function computes the default encoding of "
"*string* and operates on that. If *string* is not a string object at all, :"
"c:func:`PyString_AsString` returns *NULL* and raises :exc:`TypeError`."
msgstr ""
#: c-api/string.rst:184
msgid ""
"Macro form of :c:func:`PyString_AsString` but without error checking. Only "
"string objects are supported; no Unicode objects should be passed."
msgstr ""
#: c-api/string.rst:190
msgid ""
"Return a NUL-terminated representation of the contents of the object *obj* "
"through the output variables *buffer* and *length*."
msgstr ""
#: c-api/string.rst:193
msgid ""
"The function accepts both string and Unicode objects as input. For Unicode "
"objects it returns the default encoded version of the object. If *length* "
"is *NULL*, the resulting buffer may not contain NUL characters; if it does, "
"the function returns ``-1`` and a :exc:`TypeError` is raised."
msgstr ""
#: c-api/string.rst:198
msgid ""
"The buffer refers to an internal string buffer of *obj*, not a copy. The "
"data must not be modified in any way, unless the string was just created "
"using ``PyString_FromStringAndSize(NULL, size)``. It must not be "
"deallocated. If *string* is a Unicode object, this function computes the "
"default encoding of *string* and operates on that. If *string* is not a "
"string object at all, :c:func:`PyString_AsStringAndSize` returns ``-1`` and "
"raises :exc:`TypeError`."
msgstr ""
#: c-api/string.rst:205
msgid ""
"This function used an :c:type:`int *` type for *length*. This might require "
"changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/string.rst:212
msgid ""
"Create a new string object in *\\*string* containing the contents of "
"*newpart* appended to *string*; the caller will own the new reference. The "
"reference to the old value of *string* will be stolen. If the new string "
"cannot be created, the old reference to *string* will still be discarded and "
"the value of *\\*string* will be set to *NULL*; the appropriate exception "
"will be set."
msgstr ""
#: c-api/string.rst:221
msgid ""
"Create a new string object in *\\*string* containing the contents of "
"*newpart* appended to *string*. This version decrements the reference count "
"of *newpart*."
msgstr ""
#: c-api/string.rst:227
msgid ""
"A way to resize a string object even though it is \"immutable\". Only use "
"this to build up a brand new string object; don't use this if the string may "
"already be known in other parts of the code. It is an error to call this "
"function if the refcount on the input string object is not one. Pass the "
"address of an existing string object as an lvalue (it may be written into), "
"and the new size desired. On success, *\\*string* holds the resized string "
"object and ``0`` is returned; the address in *\\*string* may differ from its "
"input value. If the reallocation fails, the original string object at *"
"\\*string* is deallocated, *\\*string* is set to *NULL*, a memory exception "
"is set, and ``-1`` is returned."
msgstr ""
#: c-api/string.rst:243
msgid ""
"Return a new string object from *format* and *args*. Analogous to ``format % "
"args``. The *args* argument must be a tuple or dict."
msgstr ""
#: c-api/string.rst:249
msgid ""
"Intern the argument *\\*string* in place. The argument must be the address "
"of a pointer variable pointing to a Python string object. If there is an "
"existing interned string that is the same as *\\*string*, it sets *"
"\\*string* to it (decrementing the reference count of the old string object "
"and incrementing the reference count of the interned string object), "
"otherwise it leaves *\\*string* alone and interns it (incrementing its "
"reference count). (Clarification: even though there is a lot of talk about "
"reference counts, think of this function as reference-count-neutral; you own "
"the object after the call if and only if you owned it before the call.)"
msgstr ""
#: c-api/string.rst:261 c-api/string.rst:273 c-api/string.rst:286
#: c-api/string.rst:303 c-api/string.rst:316 c-api/string.rst:333
msgid ""
"This function is not available in 3.x and does not have a PyBytes alias."
msgstr ""
#: c-api/string.rst:266
msgid ""
"A combination of :c:func:`PyString_FromString` and :c:func:"
"`PyString_InternInPlace`, returning either a new string object that has been "
"interned, or a new (\"owned\") reference to an earlier interned string "
"object with the same value."
msgstr ""
#: c-api/string.rst:278
msgid ""
"Create an object by decoding *size* bytes of the encoded buffer *s* using "
"the codec registered for *encoding*. *encoding* and *errors* have the same "
"meaning as the parameters of the same name in the :func:`unicode` built-in "
"function. The codec to be used is looked up using the Python codec "
"registry. Return *NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/string.rst:295
msgid ""
"Decode a string object by passing it to the codec registered for *encoding* "
"and return the result as Python object. *encoding* and *errors* have the "
"same meaning as the parameters of the same name in the string :meth:`encode` "
"method. The codec to be used is looked up using the Python codec registry. "
"Return *NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/string.rst:308
msgid ""
"Encode the :c:type:`char` buffer of the given size by passing it to the "
"codec registered for *encoding* and return a Python object. *encoding* and "
"*errors* have the same meaning as the parameters of the same name in the "
"string :meth:`encode` method. The codec to be used is looked up using the "
"Python codec registry. Return *NULL* if an exception was raised by the "
"codec."
msgstr ""
#: c-api/string.rst:325
msgid ""
"Encode a string object using the codec registered for *encoding* and return "
"the result as Python object. *encoding* and *errors* have the same meaning "
"as the parameters of the same name in the string :meth:`encode` method. The "
"codec to be used is looked up using the Python codec registry. Return *NULL* "
"if an exception was raised by the codec."
msgstr ""
#: c-api/structures.rst:6
msgid "Common Object Structures"
msgstr ""
#: c-api/structures.rst:8
msgid ""
"There are a large number of structures which are used in the definition of "
"object types for Python. This section describes these structures and how "
"they are used."
msgstr ""
#: c-api/structures.rst:12
msgid ""
"All Python objects ultimately share a small number of fields at the "
"beginning of the object's representation in memory. These are represented "
"by the :c:type:`PyObject` and :c:type:`PyVarObject` types, which are "
"defined, in turn, by the expansions of some macros also used, whether "
"directly or indirectly, in the definition of all other Python objects."
msgstr ""
#: c-api/structures.rst:21
msgid ""
"All object types are extensions of this type. This is a type which contains "
"the information Python needs to treat a pointer to an object as an object. "
"In a normal \"release\" build, it contains only the object's reference count "
"and a pointer to the corresponding type object. It corresponds to the "
"fields defined by the expansion of the ``PyObject_HEAD`` macro."
msgstr ""
#: c-api/structures.rst:31
msgid ""
"This is an extension of :c:type:`PyObject` that adds the :attr:`ob_size` "
"field. This is only used for objects that have some notion of *length*. "
"This type does not often appear in the Python/C API. It corresponds to the "
"fields defined by the expansion of the ``PyObject_VAR_HEAD`` macro."
msgstr ""
#: c-api/structures.rst:36
msgid ""
"These macros are used in the definition of :c:type:`PyObject` and :c:type:"
"`PyVarObject`:"
msgstr ""
#: c-api/structures.rst:42
msgid ""
"This is a macro which expands to the declarations of the fields of the :c:"
"type:`PyObject` type; it is used when declaring new types which represent "
"objects without a varying length. The specific fields it expands to depend "
"on the definition of :c:macro:`Py_TRACE_REFS`. By default, that macro is "
"not defined, and :c:macro:`PyObject_HEAD` expands to::"
msgstr ""
#: c-api/structures.rst:51
msgid "When :c:macro:`Py_TRACE_REFS` is defined, it expands to::"
msgstr ""
#: c-api/structures.rst:60
msgid ""
"This is a macro which expands to the declarations of the fields of the :c:"
"type:`PyVarObject` type; it is used when declaring new types which represent "
"objects with a length that varies from instance to instance. This macro "
"always expands to::"
msgstr ""
#: c-api/structures.rst:68
msgid ""
"Note that :c:macro:`PyObject_HEAD` is part of the expansion, and that its "
"own expansion varies depending on the definition of :c:macro:`Py_TRACE_REFS`."
msgstr ""
#: c-api/structures.rst:74
msgid ""
"This macro is used to access the :attr:`ob_type` member of a Python object. "
"It expands to::"
msgstr ""
#: c-api/structures.rst:84
msgid ""
"This macro is used to access the :attr:`ob_refcnt` member of a Python "
"object. It expands to::"
msgstr ""
#: c-api/structures.rst:95
msgid ""
"This macro is used to access the :attr:`ob_size` member of a Python object. "
"It expands to::"
msgstr ""
#: c-api/structures.rst:105
msgid ""
"This is a macro which expands to initialization values for a new :c:type:"
"`PyObject` type. This macro expands to::"
msgstr ""
#: c-api/structures.rst:114
msgid ""
"This is a macro which expands to initialization values for a new :c:type:"
"`PyVarObject` type, including the :attr:`ob_size` field. This macro expands "
"to::"
msgstr ""
#: c-api/structures.rst:124
msgid ""
"Type of the functions used to implement most Python callables in C. "
"Functions of this type take two :c:type:`PyObject\\*` parameters and return "
"one such value. If the return value is *NULL*, an exception shall have been "
"set. If not *NULL*, the return value is interpreted as the return value of "
"the function as exposed in Python. The function must return a new reference."
msgstr ""
#: c-api/structures.rst:134
msgid ""
"Structure used to describe a method of an extension type. This structure "
"has four fields:"
msgstr ""
#: c-api/structures.rst:138 c-api/structures.rst:265
msgid "Field"
msgstr ""
#: c-api/structures.rst:138 c-api/structures.rst:265
msgid "C Type"
msgstr "Type C"
#: c-api/structures.rst:138 c-api/structures.rst:265
msgid "Meaning"
msgstr "Signification"
#: c-api/structures.rst:140
msgid ":attr:`ml_name`"
msgstr ""
#: c-api/structures.rst:140 c-api/structures.rst:148 c-api/structures.rst:267
#: c-api/structures.rst:280 c-api/structures.rst:296
msgid "char \\*"
msgstr ""
#: c-api/structures.rst:140
msgid "name of the method"
msgstr ""
#: c-api/structures.rst:142
msgid ":attr:`ml_meth`"
msgstr ""
#: c-api/structures.rst:142
#, fuzzy
msgid "PyCFunction"
msgstr "Fonction de l'API"
#: c-api/structures.rst:142
msgid "pointer to the C implementation"
msgstr ""
#: c-api/structures.rst:145
msgid ":attr:`ml_flags`"
msgstr ""
#: c-api/structures.rst:145
msgid "flag bits indicating how the call should be constructed"
msgstr ""
#: c-api/structures.rst:148
msgid ":attr:`ml_doc`"
msgstr ""
#: c-api/structures.rst:148 c-api/structures.rst:280
msgid "points to the contents of the docstring"
msgstr ""
#: c-api/structures.rst:152
msgid ""
"The :attr:`ml_meth` is a C function pointer. The functions may be of "
"different types, but they always return :c:type:`PyObject\\*`. If the "
"function is not of the :c:type:`PyCFunction`, the compiler will require a "
"cast in the method table. Even though :c:type:`PyCFunction` defines the "
"first parameter as :c:type:`PyObject\\*`, it is common that the method "
"implementation uses the specific C type of the *self* object."
msgstr ""
#: c-api/structures.rst:159
msgid ""
"The :attr:`ml_flags` field is a bitfield which can include the following "
"flags. The individual flags indicate either a calling convention or a "
"binding convention. Of the calling convention flags, only :const:"
"`METH_VARARGS` and :const:`METH_KEYWORDS` can be combined (but note that :"
"const:`METH_KEYWORDS` alone is equivalent to ``METH_VARARGS | "
"METH_KEYWORDS``). Any of the calling convention flags can be combined with a "
"binding flag."
msgstr ""
#: c-api/structures.rst:169
msgid ""
"This is the typical calling convention, where the methods have the type :c:"
"type:`PyCFunction`. The function expects two :c:type:`PyObject\\*` values. "
"The first one is the *self* object for methods; for module functions, it is "
"the module object. The second parameter (often called *args*) is a tuple "
"object representing all arguments. This parameter is typically processed "
"using :c:func:`PyArg_ParseTuple` or :c:func:`PyArg_UnpackTuple`."
msgstr ""
#: c-api/structures.rst:179
msgid ""
"Methods with these flags must be of type :c:type:`PyCFunctionWithKeywords`. "
"The function expects three parameters: *self*, *args*, and a dictionary of "
"all the keyword arguments. The flag is typically combined with :const:"
"`METH_VARARGS`, and the parameters are typically processed using :c:func:"
"`PyArg_ParseTupleAndKeywords`."
msgstr ""
#: c-api/structures.rst:188
msgid ""
"Methods without parameters don't need to check whether arguments are given "
"if they are listed with the :const:`METH_NOARGS` flag. They need to be of "
"type :c:type:`PyCFunction`. The first parameter is typically named ``self`` "
"and will hold a reference to the module or object instance. In all cases "
"the second parameter will be *NULL*."
msgstr ""
#: c-api/structures.rst:197
msgid ""
"Methods with a single object argument can be listed with the :const:`METH_O` "
"flag, instead of invoking :c:func:`PyArg_ParseTuple` with a ``\"O\"`` "
"argument. They have the type :c:type:`PyCFunction`, with the *self* "
"parameter, and a :c:type:`PyObject\\*` parameter representing the single "
"argument."
msgstr ""
#: c-api/structures.rst:205
msgid ""
"This calling convention is deprecated. The method must be of type :c:type:"
"`PyCFunction`. The second argument is *NULL* if no arguments are given, a "
"single object if exactly one argument is given, and a tuple of objects if "
"more than one argument is given. There is no way for a function using this "
"convention to distinguish between a call with multiple arguments and a call "
"with a tuple as the only argument."
msgstr ""
#: c-api/structures.rst:212
msgid ""
"These two constants are not used to indicate the calling convention but the "
"binding when use with methods of classes. These may not be used for "
"functions defined for modules. At most one of these flags may be set for "
"any given method."
msgstr ""
#: c-api/structures.rst:222
msgid ""
"The method will be passed the type object as the first parameter rather than "
"an instance of the type. This is used to create *class methods*, similar to "
"what is created when using the :func:`classmethod` built-in function."
msgstr ""
#: c-api/structures.rst:234
msgid ""
"The method will be passed *NULL* as the first parameter rather than an "
"instance of the type. This is used to create *static methods*, similar to "
"what is created when using the :func:`staticmethod` built-in function."
msgstr ""
#: c-api/structures.rst:240
msgid ""
"One other constant controls whether a method is loaded in place of another "
"definition with the same method name."
msgstr ""
#: c-api/structures.rst:246
msgid ""
"The method will be loaded in place of existing definitions. Without "
"*METH_COEXIST*, the default is to skip repeated definitions. Since slot "
"wrappers are loaded before the method table, the existence of a "
"*sq_contains* slot, for example, would generate a wrapped method named :meth:"
"`__contains__` and preclude the loading of a corresponding PyCFunction with "
"the same name. With the flag defined, the PyCFunction will be loaded in "
"place of the wrapper object and will co-exist with the slot. This is "
"helpful because calls to PyCFunctions are optimized more than wrapper object "
"calls."
msgstr ""
#: c-api/structures.rst:261
msgid ""
"Structure which describes an attribute of a type which corresponds to a C "
"struct member. Its fields are:"
msgstr ""
#: c-api/structures.rst:267
msgid ":attr:`name`"
msgstr ""
#: c-api/structures.rst:267
msgid "name of the member"
msgstr ""
#: c-api/structures.rst:269
msgid ":attr:`type`"
msgstr ""
#: c-api/structures.rst:269
msgid "the type of the member in the C struct"
msgstr ""
#: c-api/structures.rst:272
msgid ":attr:`offset`"
msgstr ""
#: c-api/structures.rst:272
msgid ""
"the offset in bytes that the member is located on the type's object struct"
msgstr ""
#: c-api/structures.rst:276
msgid ":attr:`flags`"
msgstr ""
#: c-api/structures.rst:276
msgid "flag bits indicating if the field should be read-only or writable"
msgstr ""
#: c-api/structures.rst:280
msgid ":attr:`doc`"
msgstr ""
#: c-api/structures.rst:284
msgid ""
":attr:`type` can be one of many ``T_`` macros corresponding to various C "
"types. When the member is accessed in Python, it will be converted to the "
"equivalent Python type."
msgstr ""
#: c-api/structures.rst:289
#, fuzzy
msgid "Macro name"
msgstr "Macros"
#: c-api/structures.rst:289
msgid "C type"
msgstr "Type C"
#: c-api/structures.rst:291
msgid "T_SHORT"
msgstr ""
#: c-api/structures.rst:291
msgid "short"
msgstr ""
#: c-api/structures.rst:292
msgid "T_INT"
msgstr ""
#: c-api/structures.rst:293
msgid "T_LONG"
msgstr ""
#: c-api/structures.rst:294
msgid "T_FLOAT"
msgstr ""
#: c-api/structures.rst:294
msgid "float"
msgstr "float"
#: c-api/structures.rst:295
msgid "T_DOUBLE"
msgstr ""
#: c-api/structures.rst:295
msgid "double"
msgstr "double"
#: c-api/structures.rst:296
msgid "T_STRING"
msgstr ""
#: c-api/structures.rst:297
msgid "T_OBJECT"
msgstr ""
#: c-api/structures.rst:297 c-api/structures.rst:298
#, fuzzy
msgid "PyObject \\*"
msgstr "PyObject\\*"
#: c-api/structures.rst:298
msgid "T_OBJECT_EX"
msgstr ""
#: c-api/structures.rst:299
msgid "T_CHAR"
msgstr ""
#: c-api/structures.rst:299 c-api/structures.rst:300 c-api/structures.rst:305
msgid "char"
msgstr "char"
#: c-api/structures.rst:300
msgid "T_BYTE"
msgstr ""
#: c-api/structures.rst:301
msgid "T_UBYTE"
msgstr ""
#: c-api/structures.rst:301
msgid "unsigned char"
msgstr "unsigned char"
#: c-api/structures.rst:302
msgid "T_UINT"
msgstr ""
#: c-api/structures.rst:303
msgid "T_USHORT"
msgstr ""
#: c-api/structures.rst:303
msgid "unsigned short"
msgstr "unsigned short"
#: c-api/structures.rst:304
msgid "T_ULONG"
msgstr ""
#: c-api/structures.rst:305
msgid "T_BOOL"
msgstr ""
#: c-api/structures.rst:306
msgid "T_LONGLONG"
msgstr ""
#: c-api/structures.rst:307
msgid "T_ULONGLONG"
msgstr ""
#: c-api/structures.rst:308
msgid "T_PYSSIZET"
msgstr ""
#: c-api/structures.rst:311
msgid ""
":c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` differ in that :c:macro:"
"`T_OBJECT` returns ``None`` if the member is *NULL* and :c:macro:"
"`T_OBJECT_EX` raises an :exc:`AttributeError`. Try to use :c:macro:"
"`T_OBJECT_EX` over :c:macro:`T_OBJECT` because :c:macro:`T_OBJECT_EX` "
"handles use of the :keyword:`del` statement on that attribute more correctly "
"than :c:macro:`T_OBJECT`."
msgstr ""
#: c-api/structures.rst:318
msgid ""
":attr:`flags` can be 0 for write and read access or :c:macro:`READONLY` for "
"read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies :c:"
"macro:`READONLY`. Only :c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` "
"members can be deleted. (They are set to *NULL*)."
msgstr ""
#: c-api/structures.rst:326
msgid ""
"Return a bound method object for an extension type implemented in C. This "
"can be useful in the implementation of a :c:member:`~PyTypeObject."
"tp_getattro` or :c:member:`~PyTypeObject.tp_getattr` handler that does not "
"use the :c:func:`PyObject_GenericGetAttr` function."
msgstr ""
#: c-api/sys.rst:6
msgid "Operating System Utilities"
msgstr ""
#: c-api/sys.rst:11
msgid ""
"Return true (nonzero) if the standard I/O file *fp* with name *filename* is "
"deemed interactive. This is the case for files for which "
"``isatty(fileno(fp))`` is true. If the global flag :c:data:"
"`Py_InteractiveFlag` is true, this function also returns true if the "
"*filename* pointer is *NULL* or if the name is equal to one of the strings "
"``'<stdin>'`` or ``'???'``."
msgstr ""
#: c-api/sys.rst:20
msgid ""
"Function to update some internal state after a process fork; this should be "
"called in the new process if the Python interpreter will continue to be "
"used. If a new executable is loaded into the new process, this function does "
"not need to be called."
msgstr ""
#: c-api/sys.rst:28
msgid ""
"Return true when the interpreter runs out of stack space. This is a "
"reliable check, but is only available when :const:`USE_STACKCHECK` is "
"defined (currently on Windows using the Microsoft Visual C++ compiler). :"
"const:`USE_STACKCHECK` will be defined automatically; you should never "
"change the definition in your own code."
msgstr ""
#: c-api/sys.rst:37
msgid ""
"Return the current signal handler for signal *i*. This is a thin wrapper "
"around either :c:func:`sigaction` or :c:func:`signal`. Do not call those "
"functions directly! :c:type:`PyOS_sighandler_t` is a typedef alias for :c:"
"type:`void (\\*)(int)`."
msgstr ""
#: c-api/sys.rst:45
msgid ""
"Set the signal handler for signal *i* to be *h*; return the old signal "
"handler. This is a thin wrapper around either :c:func:`sigaction` or :c:func:"
"`signal`. Do not call those functions directly! :c:type:"
"`PyOS_sighandler_t` is a typedef alias for :c:type:`void (\\*)(int)`."
msgstr ""
#: c-api/sys.rst:53
msgid "System Functions"
msgstr ""
#: c-api/sys.rst:55
msgid ""
"These are utility functions that make functionality from the :mod:`sys` "
"module accessible to C code. They all work with the current interpreter "
"thread's :mod:`sys` module's dict, which is contained in the internal thread "
"state structure."
msgstr ""
#: c-api/sys.rst:61
msgid ""
"Return the object *name* from the :mod:`sys` module or *NULL* if it does not "
"exist, without setting an exception."
msgstr ""
#: c-api/sys.rst:66
msgid ""
"Return the :c:type:`FILE*` associated with the object *name* in the :mod:"
"`sys` module, or *def* if *name* is not in the module or is not associated "
"with a :c:type:`FILE*`."
msgstr ""
#: c-api/sys.rst:72
msgid ""
"Set *name* in the :mod:`sys` module to *v* unless *v* is *NULL*, in which "
"case *name* is deleted from the sys module. Returns ``0`` on success, ``-1`` "
"on error."
msgstr ""
#: c-api/sys.rst:78
msgid "Reset :data:`sys.warnoptions` to an empty list."
msgstr ""
#: c-api/sys.rst:82
msgid "Append *s* to :data:`sys.warnoptions`."
msgstr ""
#: c-api/sys.rst:86
msgid ""
"Set :data:`sys.path` to a list object of paths found in *path* which should "
"be a list of paths separated with the platform's search path delimiter (``:"
"`` on Unix, ``;`` on Windows)."
msgstr ""
#: c-api/sys.rst:92
msgid ""
"Write the output string described by *format* to :data:`sys.stdout`. No "
"exceptions are raised, even if truncation occurs (see below)."
msgstr ""
#: c-api/sys.rst:95
msgid ""
"*format* should limit the total size of the formatted output string to 1000 "
"bytes or less -- after 1000 bytes, the output string is truncated. In "
"particular, this means that no unrestricted \"%s\" formats should occur; "
"these should be limited using \"%.<N>s\" where <N> is a decimal number "
"calculated so that <N> plus the maximum size of other formatted text does "
"not exceed 1000 bytes. Also watch out for \"%f\", which can print hundreds "
"of digits for very large numbers."
msgstr ""
#: c-api/sys.rst:103
msgid ""
"If a problem occurs, or :data:`sys.stdout` is unset, the formatted message "
"is written to the real (C level) *stdout*."
msgstr ""
#: c-api/sys.rst:108
msgid "As above, but write to :data:`sys.stderr` or *stderr* instead."
msgstr ""
#: c-api/sys.rst:114
msgid "Process Control"
msgstr ""
#: c-api/sys.rst:121
msgid ""
"Print a fatal error message and kill the process. No cleanup is performed. "
"This function should only be invoked when a condition is detected that would "
"make it dangerous to continue using the Python interpreter; e.g., when the "
"object administration appears to be corrupted. On Unix, the standard C "
"library function :c:func:`abort` is called which will attempt to produce a :"
"file:`core` file."
msgstr ""
#: c-api/sys.rst:135
msgid ""
"Exit the current process. This calls :c:func:`Py_Finalize` and then calls "
"the standard C library function ``exit(status)``."
msgstr ""
#: c-api/sys.rst:145
msgid ""
"Register a cleanup function to be called by :c:func:`Py_Finalize`. The "
"cleanup function will be called with no arguments and should return no "
"value. At most 32 cleanup functions can be registered. When the "
"registration is successful, :c:func:`Py_AtExit` returns ``0``; on failure, "
"it returns ``-1``. The cleanup function registered last is called first. "
"Each cleanup function will be called at most once. Since Python's internal "
"finalization will have completed before the cleanup function, no Python APIs "
"should be called by *func*."
msgstr ""
#: c-api/tuple.rst:6
msgid "Tuple Objects"
msgstr ""
#: c-api/tuple.rst:13
msgid "This subtype of :c:type:`PyObject` represents a Python tuple object."
msgstr ""
#: c-api/tuple.rst:20
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python tuple type; it "
"is the same object as ``tuple`` and ``types.TupleType`` in the Python layer.."
msgstr ""
#: c-api/tuple.rst:26
msgid ""
"Return true if *p* is a tuple object or an instance of a subtype of the "
"tuple type."
msgstr ""
#: c-api/tuple.rst:35
msgid ""
"Return true if *p* is a tuple object, but not an instance of a subtype of "
"the tuple type."
msgstr ""
#: c-api/tuple.rst:43
msgid "Return a new tuple object of size *len*, or *NULL* on failure."
msgstr ""
#: c-api/tuple.rst:52
msgid ""
"Return a new tuple object of size *n*, or *NULL* on failure. The tuple "
"values are initialized to the subsequent *n* C arguments pointing to Python "
"objects. ``PyTuple_Pack(2, a, b)`` is equivalent to "
"``Py_BuildValue(\"(OO)\", a, b)``."
msgstr ""
#: c-api/tuple.rst:58
msgid ""
"This function used an :c:type:`int` type for *n*. This might require changes "
"in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/tuple.rst:65
msgid "Take a pointer to a tuple object, and return the size of that tuple."
msgstr ""
#: c-api/tuple.rst:74
msgid ""
"Return the size of the tuple *p*, which must be non-*NULL* and point to a "
"tuple; no error checking is performed."
msgstr ""
#: c-api/tuple.rst:84
msgid ""
"Return the object at position *pos* in the tuple pointed to by *p*. If "
"*pos* is out of bounds, return *NULL* and sets an :exc:`IndexError` "
"exception."
msgstr ""
#: c-api/tuple.rst:87 c-api/tuple.rst:96 c-api/tuple.rst:120
#: c-api/tuple.rst:134
msgid ""
"This function used an :c:type:`int` type for *pos*. This might require "
"changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/tuple.rst:94
msgid "Like :c:func:`PyTuple_GetItem`, but does no checking of its arguments."
msgstr ""
#: c-api/tuple.rst:103
msgid ""
"Take a slice of the tuple pointed to by *p* from *low* to *high* and return "
"it as a new tuple."
msgstr ""
#: c-api/tuple.rst:106
msgid ""
"This function used an :c:type:`int` type for *low* and *high*. This might "
"require changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/tuple.rst:113
msgid ""
"Insert a reference to object *o* at position *pos* of the tuple pointed to "
"by *p*. Return ``0`` on success."
msgstr ""
#: c-api/tuple.rst:118 c-api/tuple.rst:132
msgid "This function \"steals\" a reference to *o*."
msgstr ""
#: c-api/tuple.rst:127
msgid ""
"Like :c:func:`PyTuple_SetItem`, but does no error checking, and should "
"*only* be used to fill in brand new tuples."
msgstr ""
#: c-api/tuple.rst:141
msgid ""
"Can be used to resize a tuple. *newsize* will be the new length of the "
"tuple. Because tuples are *supposed* to be immutable, this should only be "
"used if there is only one reference to the object. Do *not* use this if the "
"tuple may already be known to some other part of the code. The tuple will "
"always grow or shrink at the end. Think of this as destroying the old tuple "
"and creating a new one, only more efficiently. Returns ``0`` on success. "
"Client code should never assume that the resulting value of ``*p`` will be "
"the same as before calling this function. If the object referenced by ``*p`` "
"is replaced, the original ``*p`` is destroyed. On failure, returns ``-1`` "
"and sets ``*p`` to *NULL*, and raises :exc:`MemoryError` or :exc:"
"`SystemError`."
msgstr ""
#: c-api/tuple.rst:152
msgid "Removed unused third parameter, *last_is_sticky*."
msgstr ""
#: c-api/type.rst:6 c-api/typeobj.rst:6
msgid "Type Objects"
msgstr ""
#: c-api/type.rst:13
msgid "The C structure of the objects used to describe built-in types."
msgstr ""
#: c-api/type.rst:20
msgid ""
"This is the type object for type objects; it is the same object as ``type`` "
"and ``types.TypeType`` in the Python layer."
msgstr ""
#: c-api/type.rst:26
msgid ""
"Return true if the object *o* is a type object, including instances of types "
"derived from the standard type object. Return false in all other cases."
msgstr ""
#: c-api/type.rst:32
msgid ""
"Return true if the object *o* is a type object, but not a subtype of the "
"standard type object. Return false in all other cases."
msgstr ""
#: c-api/type.rst:40
msgid "Clear the internal lookup cache. Return the current version tag."
msgstr ""
#: c-api/type.rst:47
msgid ""
"Invalidate the internal lookup cache for the type and all of its subtypes. "
"This function must be called after any manual modification of the attributes "
"or base classes of the type."
msgstr ""
#: c-api/type.rst:56
msgid ""
"Return true if the type object *o* sets the feature *feature*. Type "
"features are denoted by single bit flags."
msgstr ""
#: c-api/type.rst:62
msgid ""
"Return true if the type object includes support for the cycle detector; this "
"tests the type flag :const:`Py_TPFLAGS_HAVE_GC`."
msgstr ""
#: c-api/type.rst:70
msgid "Return true if *a* is a subtype of *b*."
msgstr ""
#: c-api/type.rst:74
msgid ""
"This function only checks for actual subtypes, which means that :meth:"
"`~class.__subclasscheck__` is not called on *b*. Call :c:func:"
"`PyObject_IsSubclass` to do the same check that :func:`issubclass` would do."
msgstr ""
#: c-api/type.rst:84
msgid ""
"This function used an :c:type:`int` type for *nitems*. This might require "
"changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/type.rst:96
msgid ""
"Finalize a type object. This should be called on all type objects to finish "
"their initialization. This function is responsible for adding inherited "
"slots from a type's base class. Return ``0`` on success, or return ``-1`` "
"and sets an exception on error."
msgstr ""
#: c-api/typeobj.rst:8
msgid ""
"Perhaps one of the most important structures of the Python object system is "
"the structure that defines a new type: the :c:type:`PyTypeObject` "
"structure. Type objects can be handled using any of the :c:func:`PyObject_"
"\\*` or :c:func:`PyType_\\*` functions, but do not offer much that's "
"interesting to most Python applications. These objects are fundamental to "
"how objects behave, so they are very important to the interpreter itself and "
"to any extension module that implements new types."
msgstr ""
#: c-api/typeobj.rst:16
msgid ""
"Type objects are fairly large compared to most of the standard types. The "
"reason for the size is that each type object stores a large number of "
"values, mostly C function pointers, each of which implements a small part of "
"the type's functionality. The fields of the type object are examined in "
"detail in this section. The fields will be described in the order in which "
"they occur in the structure."
msgstr ""
#: c-api/typeobj.rst:23
msgid ""
"Typedefs: unaryfunc, binaryfunc, ternaryfunc, inquiry, coercion, intargfunc, "
"intintargfunc, intobjargproc, intintobjargproc, objobjargproc, destructor, "
"freefunc, printfunc, getattrfunc, getattrofunc, setattrfunc, setattrofunc, "
"cmpfunc, reprfunc, hashfunc"
msgstr ""
#: c-api/typeobj.rst:28
msgid ""
"The structure definition for :c:type:`PyTypeObject` can be found in :file:"
"`Include/object.h`. For convenience of reference, this repeats the "
"definition found there:"
msgstr ""
#: c-api/typeobj.rst:35
msgid ""
"The type object structure extends the :c:type:`PyVarObject` structure. The :"
"attr:`ob_size` field is used for dynamic types (created by :func:"
"`type_new`, usually called from a class statement). Note that :c:data:"
"`PyType_Type` (the metatype) initializes :c:member:`~PyTypeObject."
"tp_itemsize`, which means that its instances (i.e. type objects) *must* have "
"the :attr:`ob_size` field."
msgstr ""
#: c-api/typeobj.rst:45
msgid ""
"These fields are only present when the macro ``Py_TRACE_REFS`` is defined. "
"Their initialization to *NULL* is taken care of by the "
"``PyObject_HEAD_INIT`` macro. For statically allocated objects, these "
"fields always remain *NULL*. For dynamically allocated objects, these two "
"fields are used to link the object into a doubly-linked list of *all* live "
"objects on the heap. This could be used for various debugging purposes; "
"currently the only use is to print the objects that are still alive at the "
"end of a run when the environment variable :envvar:`PYTHONDUMPREFS` is set."
msgstr ""
#: c-api/typeobj.rst:54
msgid "These fields are not inherited by subtypes."
msgstr ""
#: c-api/typeobj.rst:59
msgid ""
"This is the type object's reference count, initialized to ``1`` by the "
"``PyObject_HEAD_INIT`` macro. Note that for statically allocated type "
"objects, the type's instances (objects whose :attr:`ob_type` points back to "
"the type) do *not* count as references. But for dynamically allocated type "
"objects, the instances *do* count as references."
msgstr ""
#: c-api/typeobj.rst:65 c-api/typeobj.rst:100 c-api/typeobj.rst:127
msgid "This field is not inherited by subtypes."
msgstr ""
#: c-api/typeobj.rst:67
msgid ""
"This field used to be an :c:type:`int` type. This might require changes in "
"your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/typeobj.rst:74
msgid ""
"This is the type's type, in other words its metatype. It is initialized by "
"the argument to the ``PyObject_HEAD_INIT`` macro, and its value should "
"normally be ``&PyType_Type``. However, for dynamically loadable extension "
"modules that must be usable on Windows (at least), the compiler complains "
"that this is not a valid initializer. Therefore, the convention is to pass "
"*NULL* to the ``PyObject_HEAD_INIT`` macro and to initialize this field "
"explicitly at the start of the module's initialization function, before "
"doing anything else. This is typically done like this::"
msgstr ""
#: c-api/typeobj.rst:85
msgid ""
"This should be done before any instances of the type are created. :c:func:"
"`PyType_Ready` checks if :attr:`ob_type` is *NULL*, and if so, initializes "
"it: in Python 2.2, it is set to ``&PyType_Type``; in Python 2.2.1 and later "
"it is initialized to the :attr:`ob_type` field of the base class. :c:func:"
"`PyType_Ready` will not change this field if it is non-zero."
msgstr ""
#: c-api/typeobj.rst:91
msgid ""
"In Python 2.2, this field is not inherited by subtypes. In 2.2.1, and in "
"2.3 and beyond, it is inherited by subtypes."
msgstr ""
#: c-api/typeobj.rst:97
msgid ""
"For statically allocated type objects, this should be initialized to zero. "
"For dynamically allocated type objects, this field has a special internal "
"meaning."
msgstr ""
#: c-api/typeobj.rst:105
msgid ""
"Pointer to a NUL-terminated string containing the name of the type. For "
"types that are accessible as module globals, the string should be the full "
"module name, followed by a dot, followed by the type name; for built-in "
"types, it should be just the type name. If the module is a submodule of a "
"package, the full package name is part of the full module name. For "
"example, a type named :class:`T` defined in module :mod:`M` in subpackage :"
"mod:`Q` in package :mod:`P` should have the :c:member:`~PyTypeObject."
"tp_name` initializer ``\"P.Q.M.T\"``."
msgstr ""
#: c-api/typeobj.rst:113
msgid ""
"For dynamically allocated type objects, this should just be the type name, "
"and the module name explicitly stored in the type dict as the value for key "
"``'__module__'``."
msgstr ""
#: c-api/typeobj.rst:117
msgid ""
"For statically allocated type objects, the tp_name field should contain a "
"dot. Everything before the last dot is made accessible as the :attr:"
"`__module__` attribute, and everything after the last dot is made accessible "
"as the :attr:`__name__` attribute."
msgstr ""
#: c-api/typeobj.rst:122
msgid ""
"If no dot is present, the entire :c:member:`~PyTypeObject.tp_name` field is "
"made accessible as the :attr:`__name__` attribute, and the :attr:"
"`__module__` attribute is undefined (unless explicitly set in the "
"dictionary, as explained above). This means your type will be impossible to "
"pickle."
msgstr ""
#: c-api/typeobj.rst:133
msgid ""
"These fields allow calculating the size in bytes of instances of the type."
msgstr ""
#: c-api/typeobj.rst:135
msgid ""
"There are two kinds of types: types with fixed-length instances have a zero :"
"c:member:`~PyTypeObject.tp_itemsize` field, types with variable-length "
"instances have a non-zero :c:member:`~PyTypeObject.tp_itemsize` field. For "
"a type with fixed-length instances, all instances have the same size, given "
"in :c:member:`~PyTypeObject.tp_basicsize`."
msgstr ""
#: c-api/typeobj.rst:140
msgid ""
"For a type with variable-length instances, the instances must have an :attr:"
"`ob_size` field, and the instance size is :c:member:`~PyTypeObject."
"tp_basicsize` plus N times :c:member:`~PyTypeObject.tp_itemsize`, where N is "
"the \"length\" of the object. The value of N is typically stored in the "
"instance's :attr:`ob_size` field. There are exceptions: for example, long "
"ints use a negative :attr:`ob_size` to indicate a negative number, and N is "
"``abs(ob_size)`` there. Also, the presence of an :attr:`ob_size` field in "
"the instance layout doesn't mean that the instance structure is variable-"
"length (for example, the structure for the list type has fixed-length "
"instances, yet those instances have a meaningful :attr:`ob_size` field)."
msgstr ""
#: c-api/typeobj.rst:151
msgid ""
"The basic size includes the fields in the instance declared by the macro :c:"
"macro:`PyObject_HEAD` or :c:macro:`PyObject_VAR_HEAD` (whichever is used to "
"declare the instance struct) and this in turn includes the :attr:`_ob_prev` "
"and :attr:`_ob_next` fields if they are present. This means that the only "
"correct way to get an initializer for the :c:member:`~PyTypeObject."
"tp_basicsize` is to use the ``sizeof`` operator on the struct used to "
"declare the instance layout. The basic size does not include the GC header "
"size (this is new in Python 2.2; in 2.1 and 2.0, the GC header size was "
"included in :c:member:`~PyTypeObject.tp_basicsize`)."
msgstr ""
#: c-api/typeobj.rst:160
msgid ""
"These fields are inherited separately by subtypes. If the base type has a "
"non-zero :c:member:`~PyTypeObject.tp_itemsize`, it is generally not safe to "
"set :c:member:`~PyTypeObject.tp_itemsize` to a different non-zero value in a "
"subtype (though this depends on the implementation of the base type)."
msgstr ""
#: c-api/typeobj.rst:165
msgid ""
"A note about alignment: if the variable items require a particular "
"alignment, this should be taken care of by the value of :c:member:"
"`~PyTypeObject.tp_basicsize`. Example: suppose a type implements an array "
"of ``double``. :c:member:`~PyTypeObject.tp_itemsize` is ``sizeof(double)``. "
"It is the programmer's responsibility that :c:member:`~PyTypeObject."
"tp_basicsize` is a multiple of ``sizeof(double)`` (assuming this is the "
"alignment requirement for ``double``)."
msgstr ""
#: c-api/typeobj.rst:175
msgid ""
"A pointer to the instance destructor function. This function must be "
"defined unless the type guarantees that its instances will never be "
"deallocated (as is the case for the singletons ``None`` and ``Ellipsis``)."
msgstr ""
#: c-api/typeobj.rst:179
msgid ""
"The destructor function is called by the :c:func:`Py_DECREF` and :c:func:"
"`Py_XDECREF` macros when the new reference count is zero. At this point, "
"the instance is still in existence, but there are no references to it. The "
"destructor function should free all references which the instance owns, free "
"all memory buffers owned by the instance (using the freeing function "
"corresponding to the allocation function used to allocate the buffer), and "
"finally (as its last action) call the type's :c:member:`~PyTypeObject."
"tp_free` function. If the type is not subtypable (doesn't have the :const:"
"`Py_TPFLAGS_BASETYPE` flag bit set), it is permissible to call the object "
"deallocator directly instead of via :c:member:`~PyTypeObject.tp_free`. The "
"object deallocator should be the one used to allocate the instance; this is "
"normally :c:func:`PyObject_Del` if the instance was allocated using :c:func:"
"`PyObject_New` or :c:func:`PyObject_VarNew`, or :c:func:`PyObject_GC_Del` if "
"the instance was allocated using :c:func:`PyObject_GC_New` or :c:func:"
"`PyObject_GC_NewVar`."
msgstr ""
#: c-api/typeobj.rst:194 c-api/typeobj.rst:223 c-api/typeobj.rst:287
#: c-api/typeobj.rst:355 c-api/typeobj.rst:373 c-api/typeobj.rst:763
#: c-api/typeobj.rst:781 c-api/typeobj.rst:874 c-api/typeobj.rst:885
#: c-api/typeobj.rst:970
msgid "This field is inherited by subtypes."
msgstr ""
#: c-api/typeobj.rst:199
msgid "An optional pointer to the instance print function."
msgstr ""
#: c-api/typeobj.rst:201
msgid ""
"The print function is only called when the instance is printed to a *real* "
"file; when it is printed to a pseudo-file (like a :class:`~StringIO."
"StringIO` instance), the instance's :c:member:`~PyTypeObject.tp_repr` or :c:"
"member:`~PyTypeObject.tp_str` function is called to convert it to a string. "
"These are also called when the type's :c:member:`~PyTypeObject.tp_print` "
"field is *NULL*. A type should never implement :c:member:`~PyTypeObject."
"tp_print` in a way that produces different output than :c:member:"
"`~PyTypeObject.tp_repr` or :c:member:`~PyTypeObject.tp_str` would."
msgstr ""
#: c-api/typeobj.rst:208
msgid ""
"The print function is called with the same signature as :c:func:"
"`PyObject_Print`: ``int tp_print(PyObject *self, FILE *file, int flags)``. "
"The *self* argument is the instance to be printed. The *file* argument is "
"the stdio file to which it is to be printed. The *flags* argument is "
"composed of flag bits. The only flag bit currently defined is :const:"
"`Py_PRINT_RAW`. When the :const:`Py_PRINT_RAW` flag bit is set, the instance "
"should be printed the same way as :c:member:`~PyTypeObject.tp_str` would "
"format it; when the :const:`Py_PRINT_RAW` flag bit is clear, the instance "
"should be printed the same was as :c:member:`~PyTypeObject.tp_repr` would "
"format it. It should return ``-1`` and set an exception condition when an "
"error occurred during the comparison."
msgstr ""
#: c-api/typeobj.rst:219
msgid ""
"It is possible that the :c:member:`~PyTypeObject.tp_print` field will be "
"deprecated. In any case, it is recommended not to define :c:member:"
"`~PyTypeObject.tp_print`, but instead to rely on :c:member:`~PyTypeObject."
"tp_repr` and :c:member:`~PyTypeObject.tp_str` for printing."
msgstr ""
#: c-api/typeobj.rst:228
msgid "An optional pointer to the get-attribute-string function."
msgstr ""
#: c-api/typeobj.rst:230
msgid ""
"This field is deprecated. When it is defined, it should point to a function "
"that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, "
"but taking a C string instead of a Python string object to give the "
"attribute name. The signature is the same as for :c:func:"
"`PyObject_GetAttrString`."
msgstr ""
#: c-api/typeobj.rst:235
msgid ""
"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
"tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` "
"and :c:member:`~PyTypeObject.tp_getattro` from its base type when the "
"subtype's :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject."
"tp_getattro` are both *NULL*."
msgstr ""
#: c-api/typeobj.rst:242
msgid "An optional pointer to the set-attribute-string function."
msgstr ""
#: c-api/typeobj.rst:244
msgid ""
"This field is deprecated. When it is defined, it should point to a function "
"that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, "
"but taking a C string instead of a Python string object to give the "
"attribute name. The signature is the same as for :c:func:"
"`PyObject_SetAttrString`."
msgstr ""
#: c-api/typeobj.rst:249
msgid ""
"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
"tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` "
"and :c:member:`~PyTypeObject.tp_setattro` from its base type when the "
"subtype's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject."
"tp_setattro` are both *NULL*."
msgstr ""
#: c-api/typeobj.rst:256
msgid "An optional pointer to the three-way comparison function."
msgstr ""
#: c-api/typeobj.rst:258
msgid ""
"The signature is the same as for :c:func:`PyObject_Compare`. The function "
"should return ``1`` if *self* greater than *other*, ``0`` if *self* is equal "
"to *other*, and ``-1`` if *self* less than *other*. It should return ``-1`` "
"and set an exception condition when an error occurred during the comparison."
msgstr ""
#: c-api/typeobj.rst:263
msgid ""
"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
"tp_richcompare` and :c:member:`~PyTypeObject.tp_hash`: a subtypes inherits "
"all three of :c:member:`~PyTypeObject.tp_compare`, :c:member:`~PyTypeObject."
"tp_richcompare`, and :c:member:`~PyTypeObject.tp_hash` when the subtype's :c:"
"member:`~PyTypeObject.tp_compare`, :c:member:`~PyTypeObject.tp_richcompare`, "
"and :c:member:`~PyTypeObject.tp_hash` are all *NULL*."
msgstr ""
#: c-api/typeobj.rst:273
msgid ""
"An optional pointer to a function that implements the built-in function :"
"func:`repr`."
msgstr ""
#: c-api/typeobj.rst:276
msgid ""
"The signature is the same as for :c:func:`PyObject_Repr`; it must return a "
"string or a Unicode object. Ideally, this function should return a string "
"that, when passed to :func:`eval`, given a suitable environment, returns an "
"object with the same value. If this is not feasible, it should return a "
"string starting with ``'<'`` and ending with ``'>'`` from which both the "
"type and the value of the object can be deduced."
msgstr ""
#: c-api/typeobj.rst:283
msgid ""
"When this field is not set, a string of the form ``<%s object at %p>`` is "
"returned, where ``%s`` is replaced by the type name, and ``%p`` by the "
"object's memory address."
msgstr ""
#: c-api/typeobj.rst:291
msgid ""
"Pointer to an additional structure that contains fields relevant only to "
"objects which implement the number protocol. These fields are documented "
"in :ref:`number-structs`."
msgstr ""
#: c-api/typeobj.rst:295
msgid ""
"The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the "
"contained fields are inherited individually."
msgstr ""
#: c-api/typeobj.rst:301
msgid ""
"Pointer to an additional structure that contains fields relevant only to "
"objects which implement the sequence protocol. These fields are documented "
"in :ref:`sequence-structs`."
msgstr ""
#: c-api/typeobj.rst:305
msgid ""
"The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the "
"contained fields are inherited individually."
msgstr ""
#: c-api/typeobj.rst:311
msgid ""
"Pointer to an additional structure that contains fields relevant only to "
"objects which implement the mapping protocol. These fields are documented "
"in :ref:`mapping-structs`."
msgstr ""
#: c-api/typeobj.rst:315
msgid ""
"The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the "
"contained fields are inherited individually."
msgstr ""
#: c-api/typeobj.rst:323
msgid ""
"An optional pointer to a function that implements the built-in function :"
"func:`hash`."
msgstr ""
#: c-api/typeobj.rst:326
msgid ""
"The signature is the same as for :c:func:`PyObject_Hash`; it must return a C "
"long. The value ``-1`` should not be returned as a normal return value; "
"when an error occurs during the computation of the hash value, the function "
"should set an exception and return ``-1``."
msgstr ""
#: c-api/typeobj.rst:331
msgid ""
"This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to "
"block inheritance of the hash method from a parent type. This is interpreted "
"as the equivalent of ``__hash__ = None`` at the Python level, causing "
"``isinstance(o, collections.Hashable)`` to correctly return ``False``. Note "
"that the converse is also true - setting ``__hash__ = None`` on a class at "
"the Python level will result in the ``tp_hash`` slot being set to :c:func:"
"`PyObject_HashNotImplemented`."
msgstr ""
#: c-api/typeobj.rst:339
msgid ""
"When this field is not set, two possibilities exist: if the :c:member:"
"`~PyTypeObject.tp_compare` and :c:member:`~PyTypeObject.tp_richcompare` "
"fields are both *NULL*, a default hash value based on the object's address "
"is returned; otherwise, a :exc:`TypeError` is raised."
msgstr ""
#: c-api/typeobj.rst:343
msgid ""
"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
"tp_richcompare` and :c:member:`~PyTypeObject.tp_compare`: a subtypes "
"inherits all three of :c:member:`~PyTypeObject.tp_compare`, :c:member:"
"`~PyTypeObject.tp_richcompare`, and :c:member:`~PyTypeObject.tp_hash`, when "
"the subtype's :c:member:`~PyTypeObject.tp_compare`, :c:member:`~PyTypeObject."
"tp_richcompare` and :c:member:`~PyTypeObject.tp_hash` are all *NULL*."
msgstr ""
#: c-api/typeobj.rst:351
msgid ""
"An optional pointer to a function that implements calling the object. This "
"should be *NULL* if the object is not callable. The signature is the same "
"as for :c:func:`PyObject_Call`."
msgstr ""
#: c-api/typeobj.rst:360
msgid ""
"An optional pointer to a function that implements the built-in operation :"
"func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls "
"the constructor for that type. This constructor calls :c:func:"
"`PyObject_Str` to do the actual work, and :c:func:`PyObject_Str` will call "
"this handler.)"
msgstr ""
#: c-api/typeobj.rst:365
msgid ""
"The signature is the same as for :c:func:`PyObject_Str`; it must return a "
"string or a Unicode object. This function should return a \"friendly\" "
"string representation of the object, as this is the representation that will "
"be used by the print statement."
msgstr ""
#: c-api/typeobj.rst:370
msgid ""
"When this field is not set, :c:func:`PyObject_Repr` is called to return a "
"string representation."
msgstr ""
#: c-api/typeobj.rst:378
msgid "An optional pointer to the get-attribute function."
msgstr ""
#: c-api/typeobj.rst:380
msgid ""
"The signature is the same as for :c:func:`PyObject_GetAttr`. It is usually "
"convenient to set this field to :c:func:`PyObject_GenericGetAttr`, which "
"implements the normal way of looking for object attributes."
msgstr ""
#: c-api/typeobj.rst:384
msgid ""
"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
"tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` "
"and :c:member:`~PyTypeObject.tp_getattro` from its base type when the "
"subtype's :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject."
"tp_getattro` are both *NULL*."
msgstr ""
#: c-api/typeobj.rst:391
msgid "An optional pointer to the set-attribute function."
msgstr ""
#: c-api/typeobj.rst:393
msgid ""
"The signature is the same as for :c:func:`PyObject_SetAttr`. It is usually "
"convenient to set this field to :c:func:`PyObject_GenericSetAttr`, which "
"implements the normal way of setting object attributes."
msgstr ""
#: c-api/typeobj.rst:397
msgid ""
"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
"tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` "
"and :c:member:`~PyTypeObject.tp_setattro` from its base type when the "
"subtype's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject."
"tp_setattro` are both *NULL*."
msgstr ""
#: c-api/typeobj.rst:404
msgid ""
"Pointer to an additional structure that contains fields relevant only to "
"objects which implement the buffer interface. These fields are documented "
"in :ref:`buffer-structs`."
msgstr ""
#: c-api/typeobj.rst:408
msgid ""
"The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the "
"contained fields are inherited individually."
msgstr ""
#: c-api/typeobj.rst:414
msgid ""
"This field is a bit mask of various flags. Some flags indicate variant "
"semantics for certain situations; others are used to indicate that certain "
"fields in the type object (or in the extension structures referenced via :c:"
"member:`~PyTypeObject.tp_as_number`, :c:member:`~PyTypeObject."
"tp_as_sequence`, :c:member:`~PyTypeObject.tp_as_mapping`, and :c:member:"
"`~PyTypeObject.tp_as_buffer`) that were historically not always present are "
"valid; if such a flag bit is clear, the type fields it guards must not be "
"accessed and must be considered to have a zero or *NULL* value instead."
msgstr ""
#: c-api/typeobj.rst:422
msgid ""
"Inheritance of this field is complicated. Most flag bits are inherited "
"individually, i.e. if the base type has a flag bit set, the subtype inherits "
"this flag bit. The flag bits that pertain to extension structures are "
"strictly inherited if the extension structure is inherited, i.e. the base "
"type's value of the flag bit is copied into the subtype together with a "
"pointer to the extension structure. The :const:`Py_TPFLAGS_HAVE_GC` flag "
"bit is inherited together with the :c:member:`~PyTypeObject.tp_traverse` "
"and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if the :const:"
"`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the :c:member:"
"`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` fields in "
"the subtype exist (as indicated by the :const:`Py_TPFLAGS_HAVE_RICHCOMPARE` "
"flag bit) and have *NULL* values."
msgstr ""
#: c-api/typeobj.rst:434
msgid ""
"The following bit masks are currently defined; these can be ORed together "
"using the ``|`` operator to form the value of the :c:member:`~PyTypeObject."
"tp_flags` field. The macro :c:func:`PyType_HasFeature` takes a type and a "
"flags value, *tp* and *f*, and checks whether ``tp->tp_flags & f`` is non-"
"zero."
msgstr ""
#: c-api/typeobj.rst:442
msgid ""
"If this bit is set, the :c:type:`PyBufferProcs` struct referenced by :c:"
"member:`~PyTypeObject.tp_as_buffer` has the :attr:`bf_getcharbuffer` field."
msgstr ""
#: c-api/typeobj.rst:448
msgid ""
"If this bit is set, the :c:type:`PySequenceMethods` struct referenced by :c:"
"member:`~PyTypeObject.tp_as_sequence` has the :attr:`sq_contains` field."
msgstr ""
#: c-api/typeobj.rst:454
msgid ""
"This bit is obsolete. The bit it used to name is no longer in use. The "
"symbol is now defined as zero."
msgstr ""
#: c-api/typeobj.rst:460
msgid ""
"If this bit is set, the :c:type:`PySequenceMethods` struct referenced by :c:"
"member:`~PyTypeObject.tp_as_sequence` and the :c:type:`PyNumberMethods` "
"structure referenced by :c:member:`~PyTypeObject.tp_as_number` contain the "
"fields for in-place operators. In particular, this means that the :c:type:"
"`PyNumberMethods` structure has the fields :attr:`nb_inplace_add`, :attr:"
"`nb_inplace_subtract`, :attr:`nb_inplace_multiply`, :attr:"
"`nb_inplace_divide`, :attr:`nb_inplace_remainder`, :attr:"
"`nb_inplace_power`, :attr:`nb_inplace_lshift`, :attr:`nb_inplace_rshift`, :"
"attr:`nb_inplace_and`, :attr:`nb_inplace_xor`, and :attr:`nb_inplace_or`; "
"and the :c:type:`PySequenceMethods` struct has the fields :attr:"
"`sq_inplace_concat` and :attr:`sq_inplace_repeat`."
msgstr ""
#: c-api/typeobj.rst:475
msgid ""
"If this bit is set, the binary and ternary operations in the :c:type:"
"`PyNumberMethods` structure referenced by :c:member:`~PyTypeObject."
"tp_as_number` accept arguments of arbitrary object types, and do their own "
"type conversions if needed. If this bit is clear, those operations require "
"that all arguments have the current type as their type, and the caller is "
"supposed to perform a coercion operation first. This applies to :attr:"
"`nb_add`, :attr:`nb_subtract`, :attr:`nb_multiply`, :attr:`nb_divide`, :attr:"
"`nb_remainder`, :attr:`nb_divmod`, :attr:`nb_power`, :attr:`nb_lshift`, :"
"attr:`nb_rshift`, :attr:`nb_and`, :attr:`nb_xor`, and :attr:`nb_or`."
msgstr ""
#: c-api/typeobj.rst:488
msgid ""
"If this bit is set, the type object has the :c:member:`~PyTypeObject."
"tp_richcompare` field, as well as the :c:member:`~PyTypeObject.tp_traverse` "
"and the :c:member:`~PyTypeObject.tp_clear` fields."
msgstr ""
#: c-api/typeobj.rst:494
msgid ""
"If this bit is set, the :c:member:`~PyTypeObject.tp_weaklistoffset` field is "
"defined. Instances of a type are weakly referenceable if the type's :c:"
"member:`~PyTypeObject.tp_weaklistoffset` field has a value greater than zero."
msgstr ""
#: c-api/typeobj.rst:501
msgid ""
"If this bit is set, the type object has the :c:member:`~PyTypeObject."
"tp_iter` and :c:member:`~PyTypeObject.tp_iternext` fields."
msgstr ""
#: c-api/typeobj.rst:507
msgid ""
"If this bit is set, the type object has several new fields defined starting "
"in Python 2.2: :c:member:`~PyTypeObject.tp_methods`, :c:member:"
"`~PyTypeObject.tp_members`, :c:member:`~PyTypeObject.tp_getset`, :c:member:"
"`~PyTypeObject.tp_base`, :c:member:`~PyTypeObject.tp_dict`, :c:member:"
"`~PyTypeObject.tp_descr_get`, :c:member:`~PyTypeObject.tp_descr_set`, :c:"
"member:`~PyTypeObject.tp_dictoffset`, :c:member:`~PyTypeObject.tp_init`, :c:"
"member:`~PyTypeObject.tp_alloc`, :c:member:`~PyTypeObject.tp_new`, :c:member:"
"`~PyTypeObject.tp_free`, :c:member:`~PyTypeObject.tp_is_gc`, :c:member:"
"`~PyTypeObject.tp_bases`, :c:member:`~PyTypeObject.tp_mro`, :c:member:"
"`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject.tp_subclasses`, and :c:"
"member:`~PyTypeObject.tp_weaklist`."
msgstr ""
#: c-api/typeobj.rst:517
msgid ""
"This bit is set when the type object itself is allocated on the heap. In "
"this case, the :attr:`ob_type` field of its instances is considered a "
"reference to the type, and the type object is INCREF'ed when a new instance "
"is created, and DECREF'ed when an instance is destroyed (this does not apply "
"to instances of subtypes; only the type referenced by the instance's ob_type "
"gets INCREF'ed or DECREF'ed)."
msgstr ""
#: c-api/typeobj.rst:527
msgid ""
"This bit is set when the type can be used as the base type of another type. "
"If this bit is clear, the type cannot be subtyped (similar to a \"final\" "
"class in Java)."
msgstr ""
#: c-api/typeobj.rst:534
msgid ""
"This bit is set when the type object has been fully initialized by :c:func:"
"`PyType_Ready`."
msgstr ""
#: c-api/typeobj.rst:540
msgid ""
"This bit is set while :c:func:`PyType_Ready` is in the process of "
"initializing the type object."
msgstr ""
#: c-api/typeobj.rst:546
msgid ""
"This bit is set when the object supports garbage collection. If this bit is "
"set, instances must be created using :c:func:`PyObject_GC_New` and destroyed "
"using :c:func:`PyObject_GC_Del`. More information in section :ref:"
"`supporting-cycle-detection`. This bit also implies that the GC-related "
"fields :c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject."
"tp_clear` are present in the type object; but those fields also exist when :"
"const:`Py_TPFLAGS_HAVE_GC` is clear but :const:`Py_TPFLAGS_HAVE_RICHCOMPARE` "
"is set."
msgstr ""
#: c-api/typeobj.rst:558
msgid ""
"This is a bitmask of all the bits that pertain to the existence of certain "
"fields in the type object and its extension structures. Currently, it "
"includes the following bits: :const:`Py_TPFLAGS_HAVE_GETCHARBUFFER`, :const:"
"`Py_TPFLAGS_HAVE_SEQUENCE_IN`, :const:`Py_TPFLAGS_HAVE_INPLACEOPS`, :const:"
"`Py_TPFLAGS_HAVE_RICHCOMPARE`, :const:`Py_TPFLAGS_HAVE_WEAKREFS`, :const:"
"`Py_TPFLAGS_HAVE_ITER`, and :const:`Py_TPFLAGS_HAVE_CLASS`."
msgstr ""
#: c-api/typeobj.rst:568
msgid ""
"An optional pointer to a NUL-terminated C string giving the docstring for "
"this type object. This is exposed as the :attr:`__doc__` attribute on the "
"type and instances of the type."
msgstr ""
#: c-api/typeobj.rst:572
msgid "This field is *not* inherited by subtypes."
msgstr ""
#: c-api/typeobj.rst:574
msgid ""
"The following three fields only exist if the :const:"
"`Py_TPFLAGS_HAVE_RICHCOMPARE` flag bit is set."
msgstr ""
#: c-api/typeobj.rst:580
msgid ""
"An optional pointer to a traversal function for the garbage collector. This "
"is only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. More "
"information about Python's garbage collection scheme can be found in "
"section :ref:`supporting-cycle-detection`."
msgstr ""
#: c-api/typeobj.rst:585
msgid ""
"The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage "
"collector to detect reference cycles. A typical implementation of a :c:"
"member:`~PyTypeObject.tp_traverse` function simply calls :c:func:`Py_VISIT` "
"on each of the instance's members that are Python objects. For example, "
"this is function :c:func:`local_traverse` from the :mod:`thread` extension "
"module::"
msgstr ""
#: c-api/typeobj.rst:600
msgid ""
"Note that :c:func:`Py_VISIT` is called only on those members that can "
"participate in reference cycles. Although there is also a ``self->key`` "
"member, it can only be *NULL* or a Python string and therefore cannot be "
"part of a reference cycle."
msgstr ""
#: c-api/typeobj.rst:604
msgid ""
"On the other hand, even if you know a member can never be part of a cycle, "
"as a debugging aid you may want to visit it anyway just so the :mod:`gc` "
"module's :func:`~gc.get_referents` function will include it."
msgstr ""
#: c-api/typeobj.rst:608
msgid ""
"Note that :c:func:`Py_VISIT` requires the *visit* and *arg* parameters to :c:"
"func:`local_traverse` to have these specific names; don't name them just "
"anything."
msgstr ""
#: c-api/typeobj.rst:612
msgid ""
"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
"tp_clear` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:"
"member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` "
"are all inherited from the base type if they are all zero in the subtype "
"*and* the subtype has the :const:`Py_TPFLAGS_HAVE_RICHCOMPARE` flag bit set."
msgstr ""
#: c-api/typeobj.rst:621
msgid ""
"An optional pointer to a clear function for the garbage collector. This is "
"only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set."
msgstr ""
#: c-api/typeobj.rst:624
msgid ""
"The :c:member:`~PyTypeObject.tp_clear` member function is used to break "
"reference cycles in cyclic garbage detected by the garbage collector. Taken "
"together, all :c:member:`~PyTypeObject.tp_clear` functions in the system "
"must combine to break all reference cycles. This is subtle, and if in any "
"doubt supply a :c:member:`~PyTypeObject.tp_clear` function. For example, "
"the tuple type does not implement a :c:member:`~PyTypeObject.tp_clear` "
"function, because it's possible to prove that no reference cycle can be "
"composed entirely of tuples. Therefore the :c:member:`~PyTypeObject."
"tp_clear` functions of other types must be sufficient to break any cycle "
"containing a tuple. This isn't immediately obvious, and there's rarely a "
"good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`."
msgstr ""
#: c-api/typeobj.rst:634
msgid ""
"Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the "
"instance's references to those of its members that may be Python objects, "
"and set its pointers to those members to *NULL*, as in the following "
"example::"
msgstr ""
#: c-api/typeobj.rst:648
msgid ""
"The :c:func:`Py_CLEAR` macro should be used, because clearing references is "
"delicate: the reference to the contained object must not be decremented "
"until after the pointer to the contained object is set to *NULL*. This is "
"because decrementing the reference count may cause the contained object to "
"become trash, triggering a chain of reclamation activity that may include "
"invoking arbitrary Python code (due to finalizers, or weakref callbacks, "
"associated with the contained object). If it's possible for such code to "
"reference *self* again, it's important that the pointer to the contained "
"object be *NULL* at that time, so that *self* knows the contained object can "
"no longer be used. The :c:func:`Py_CLEAR` macro performs the operations in "
"a safe order."
msgstr ""
#: c-api/typeobj.rst:659
msgid ""
"Because the goal of :c:member:`~PyTypeObject.tp_clear` functions is to break "
"reference cycles, it's not necessary to clear contained objects like Python "
"strings or Python integers, which can't participate in reference cycles. On "
"the other hand, it may be convenient to clear all contained Python objects, "
"and write the type's :c:member:`~PyTypeObject.tp_dealloc` function to "
"invoke :c:member:`~PyTypeObject.tp_clear`."
msgstr ""
#: c-api/typeobj.rst:665
msgid ""
"More information about Python's garbage collection scheme can be found in "
"section :ref:`supporting-cycle-detection`."
msgstr ""
#: c-api/typeobj.rst:668
msgid ""
"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
"tp_traverse` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:"
"member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` "
"are all inherited from the base type if they are all zero in the subtype "
"*and* the subtype has the :const:`Py_TPFLAGS_HAVE_RICHCOMPARE` flag bit set."
msgstr ""
#: c-api/typeobj.rst:677
msgid ""
"An optional pointer to the rich comparison function, whose signature is "
"``PyObject *tp_richcompare(PyObject *a, PyObject *b, int op)``."
msgstr ""
#: c-api/typeobj.rst:680
msgid ""
"The function should return the result of the comparison (usually ``Py_True`` "
"or ``Py_False``). If the comparison is undefined, it must return "
"``Py_NotImplemented``, if another error occurred it must return ``NULL`` and "
"set an exception condition."
msgstr ""
#: c-api/typeobj.rst:687
msgid ""
"If you want to implement a type for which only a limited set of comparisons "
"makes sense (e.g. ``==`` and ``!=``, but not ``<`` and friends), directly "
"raise :exc:`TypeError` in the rich comparison function."
msgstr ""
#: c-api/typeobj.rst:691
msgid ""
"This field is inherited by subtypes together with :c:member:`~PyTypeObject."
"tp_compare` and :c:member:`~PyTypeObject.tp_hash`: a subtype inherits all "
"three of :c:member:`~PyTypeObject.tp_compare`, :c:member:`~PyTypeObject."
"tp_richcompare`, and :c:member:`~PyTypeObject.tp_hash`, when the subtype's :"
"c:member:`~PyTypeObject.tp_compare`, :c:member:`~PyTypeObject."
"tp_richcompare`, and :c:member:`~PyTypeObject.tp_hash` are all *NULL*."
msgstr ""
#: c-api/typeobj.rst:696
msgid ""
"The following constants are defined to be used as the third argument for :c:"
"member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:"
msgstr ""
#: c-api/typeobj.rst:700
msgid "Constant"
msgstr ""
#: c-api/typeobj.rst:700
msgid "Comparison"
msgstr ""
#: c-api/typeobj.rst:702
msgid ":const:`Py_LT`"
msgstr ""
#: c-api/typeobj.rst:702
msgid "``<``"
msgstr "``<``"
#: c-api/typeobj.rst:704
msgid ":const:`Py_LE`"
msgstr ""
#: c-api/typeobj.rst:704
msgid "``<=``"
msgstr "``<=``"
#: c-api/typeobj.rst:706
msgid ":const:`Py_EQ`"
msgstr ""
#: c-api/typeobj.rst:706
msgid "``==``"
msgstr "``==``"
#: c-api/typeobj.rst:708
msgid ":const:`Py_NE`"
msgstr ""
#: c-api/typeobj.rst:708
msgid "``!=``"
msgstr "``!=``"
#: c-api/typeobj.rst:710
msgid ":const:`Py_GT`"
msgstr ""
#: c-api/typeobj.rst:710
msgid "``>``"
msgstr "``>``"
#: c-api/typeobj.rst:712
msgid ":const:`Py_GE`"
msgstr ""
#: c-api/typeobj.rst:712
msgid "``>=``"
msgstr "``>=``"
#: c-api/typeobj.rst:716
msgid ""
"The next field only exists if the :const:`Py_TPFLAGS_HAVE_WEAKREFS` flag bit "
"is set."
msgstr ""
#: c-api/typeobj.rst:721
msgid ""
"If the instances of this type are weakly referenceable, this field is "
"greater than zero and contains the offset in the instance structure of the "
"weak reference list head (ignoring the GC header, if present); this offset "
"is used by :c:func:`PyObject_ClearWeakRefs` and the :c:func:`PyWeakref_\\*` "
"functions. The instance structure needs to include a field of type :c:type:"
"`PyObject\\*` which is initialized to *NULL*."
msgstr ""
#: c-api/typeobj.rst:728
msgid ""
"Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that "
"is the list head for weak references to the type object itself."
msgstr ""
#: c-api/typeobj.rst:731
msgid ""
"This field is inherited by subtypes, but see the rules listed below. A "
"subtype may override this offset; this means that the subtype uses a "
"different weak reference list head than the base type. Since the list head "
"is always found via :c:member:`~PyTypeObject.tp_weaklistoffset`, this should "
"not be a problem."
msgstr ""
#: c-api/typeobj.rst:736
msgid ""
"When a type defined by a class statement has no :attr:`~object.__slots__` "
"declaration, and none of its base types are weakly referenceable, the type "
"is made weakly referenceable by adding a weak reference list head slot to "
"the instance layout and setting the :c:member:`~PyTypeObject."
"tp_weaklistoffset` of that slot's offset."
msgstr ""
#: c-api/typeobj.rst:741
msgid ""
"When a type's :attr:`__slots__` declaration contains a slot named :attr:"
"`__weakref__`, that slot becomes the weak reference list head for instances "
"of the type, and the slot's offset is stored in the type's :c:member:"
"`~PyTypeObject.tp_weaklistoffset`."
msgstr ""
#: c-api/typeobj.rst:746
msgid ""
"When a type's :attr:`__slots__` declaration does not contain a slot named :"
"attr:`__weakref__`, the type inherits its :c:member:`~PyTypeObject."
"tp_weaklistoffset` from its base type."
msgstr ""
#: c-api/typeobj.rst:750
msgid ""
"The next two fields only exist if the :const:`Py_TPFLAGS_HAVE_ITER` flag bit "
"is set."
msgstr ""
#: c-api/typeobj.rst:756
msgid ""
"An optional pointer to a function that returns an iterator for the object. "
"Its presence normally signals that the instances of this type are iterable "
"(although sequences may be iterable without this function, and classic "
"instances always have this function, even if they don't define an :meth:"
"`__iter__` method)."
msgstr ""
#: c-api/typeobj.rst:761
msgid "This function has the same signature as :c:func:`PyObject_GetIter`."
msgstr ""
#: c-api/typeobj.rst:768
msgid ""
"An optional pointer to a function that returns the next item in an iterator. "
"When the iterator is exhausted, it must return *NULL*; a :exc:"
"`StopIteration` exception may or may not be set. When another error occurs, "
"it must return *NULL* too. Its presence normally signals that the instances "
"of this type are iterators (although classic instances always have this "
"function, even if they don't define a :meth:`~iterator.next` method)."
msgstr ""
#: c-api/typeobj.rst:775
msgid ""
"Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` "
"function, and that function should return the iterator instance itself (not "
"a new iterator instance)."
msgstr ""
#: c-api/typeobj.rst:779
msgid "This function has the same signature as :c:func:`PyIter_Next`."
msgstr ""
#: c-api/typeobj.rst:783
msgid ""
"The next fields, up to and including :c:member:`~PyTypeObject.tp_weaklist`, "
"only exist if the :const:`Py_TPFLAGS_HAVE_CLASS` flag bit is set."
msgstr ""
#: c-api/typeobj.rst:789
msgid ""
"An optional pointer to a static *NULL*-terminated array of :c:type:"
"`PyMethodDef` structures, declaring regular methods of this type."
msgstr ""
#: c-api/typeobj.rst:792
msgid ""
"For each entry in the array, an entry is added to the type's dictionary "
"(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor."
msgstr ""
#: c-api/typeobj.rst:795
msgid ""
"This field is not inherited by subtypes (methods are inherited through a "
"different mechanism)."
msgstr ""
#: c-api/typeobj.rst:801
msgid ""
"An optional pointer to a static *NULL*-terminated array of :c:type:"
"`PyMemberDef` structures, declaring regular data members (fields or slots) "
"of instances of this type."
msgstr ""
#: c-api/typeobj.rst:805
msgid ""
"For each entry in the array, an entry is added to the type's dictionary "
"(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor."
msgstr ""
#: c-api/typeobj.rst:808
msgid ""
"This field is not inherited by subtypes (members are inherited through a "
"different mechanism)."
msgstr ""
#: c-api/typeobj.rst:814
msgid ""
"An optional pointer to a static *NULL*-terminated array of :c:type:"
"`PyGetSetDef` structures, declaring computed attributes of instances of this "
"type."
msgstr ""
#: c-api/typeobj.rst:817
msgid ""
"For each entry in the array, an entry is added to the type's dictionary "
"(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor."
msgstr ""
#: c-api/typeobj.rst:820
msgid ""
"This field is not inherited by subtypes (computed attributes are inherited "
"through a different mechanism)."
msgstr ""
#: c-api/typeobj.rst:825
msgid "Docs for PyGetSetDef::"
msgstr ""
#: c-api/typeobj.rst:841
msgid ""
"An optional pointer to a base type from which type properties are "
"inherited. At this level, only single inheritance is supported; multiple "
"inheritance require dynamically creating a type object by calling the "
"metatype."
msgstr ""
#: c-api/typeobj.rst:845
msgid ""
"This field is not inherited by subtypes (obviously), but it defaults to "
"``&PyBaseObject_Type`` (which to Python programmers is known as the type :"
"class:`object`)."
msgstr ""
#: c-api/typeobj.rst:852
msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`."
msgstr ""
#: c-api/typeobj.rst:854
msgid ""
"This field should normally be initialized to *NULL* before PyType_Ready is "
"called; it may also be initialized to a dictionary containing initial "
"attributes for the type. Once :c:func:`PyType_Ready` has initialized the "
"type, extra attributes for the type may be added to this dictionary only if "
"they don't correspond to overloaded operations (like :meth:`__add__`)."
msgstr ""
#: c-api/typeobj.rst:860
msgid ""
"This field is not inherited by subtypes (though the attributes defined in "
"here are inherited through a different mechanism)."
msgstr ""
#: c-api/typeobj.rst:866
msgid "An optional pointer to a \"descriptor get\" function."
msgstr ""
#: c-api/typeobj.rst:868 c-api/typeobj.rst:881 c-api/typeobj.rst:952
#: c-api/typeobj.rst:977 c-api/typeobj.rst:1008
msgid "The function signature is ::"
msgstr ""
#: c-api/typeobj.rst:879
msgid "An optional pointer to a \"descriptor set\" function."
msgstr ""
#: c-api/typeobj.rst:892
msgid ""
"If the instances of this type have a dictionary containing instance "
"variables, this field is non-zero and contains the offset in the instances "
"of the type of the instance variable dictionary; this offset is used by :c:"
"func:`PyObject_GenericGetAttr`."
msgstr ""
#: c-api/typeobj.rst:897
msgid ""
"Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is "
"the dictionary for attributes of the type object itself."
msgstr ""
#: c-api/typeobj.rst:900
msgid ""
"If the value of this field is greater than zero, it specifies the offset "
"from the start of the instance structure. If the value is less than zero, "
"it specifies the offset from the *end* of the instance structure. A "
"negative offset is more expensive to use, and should only be used when the "
"instance structure contains a variable-length part. This is used for "
"example to add an instance variable dictionary to subtypes of :class:`str` "
"or :class:`tuple`. Note that the :c:member:`~PyTypeObject.tp_basicsize` "
"field should account for the dictionary added to the end in that case, even "
"though the dictionary is not included in the basic object layout. On a "
"system with a pointer size of 4 bytes, :c:member:`~PyTypeObject."
"tp_dictoffset` should be set to ``-4`` to indicate that the dictionary is at "
"the very end of the structure."
msgstr ""
#: c-api/typeobj.rst:912
msgid ""
"The real dictionary offset in an instance can be computed from a negative :c:"
"member:`~PyTypeObject.tp_dictoffset` as follows::"
msgstr ""
#: c-api/typeobj.rst:919
msgid ""
"where :c:member:`~PyTypeObject.tp_basicsize`, :c:member:`~PyTypeObject."
"tp_itemsize` and :c:member:`~PyTypeObject.tp_dictoffset` are taken from the "
"type object, and :attr:`ob_size` is taken from the instance. The absolute "
"value is taken because long ints use the sign of :attr:`ob_size` to store "
"the sign of the number. (There's never a need to do this calculation "
"yourself; it is done for you by :c:func:`_PyObject_GetDictPtr`.)"
msgstr ""
#: c-api/typeobj.rst:925
msgid ""
"This field is inherited by subtypes, but see the rules listed below. A "
"subtype may override this offset; this means that the subtype instances "
"store the dictionary at a difference offset than the base type. Since the "
"dictionary is always found via :c:member:`~PyTypeObject.tp_dictoffset`, this "
"should not be a problem."
msgstr ""
#: c-api/typeobj.rst:930
msgid ""
"When a type defined by a class statement has no :attr:`~object.__slots__` "
"declaration, and none of its base types has an instance variable dictionary, "
"a dictionary slot is added to the instance layout and the :c:member:"
"`~PyTypeObject.tp_dictoffset` is set to that slot's offset."
msgstr ""
#: c-api/typeobj.rst:935
msgid ""
"When a type defined by a class statement has a :attr:`__slots__` "
"declaration, the type inherits its :c:member:`~PyTypeObject.tp_dictoffset` "
"from its base type."
msgstr ""
#: c-api/typeobj.rst:938
msgid ""
"(Adding a slot named :attr:`~object.__dict__` to the :attr:`__slots__` "
"declaration does not have the expected effect, it just causes confusion. "
"Maybe this should be added as a feature just like :attr:`__weakref__` "
"though.)"
msgstr ""
#: c-api/typeobj.rst:945
msgid "An optional pointer to an instance initialization function."
msgstr ""
#: c-api/typeobj.rst:947
msgid ""
"This function corresponds to the :meth:`__init__` method of classes. Like :"
"meth:`__init__`, it is possible to create an instance without calling :meth:"
"`__init__`, and it is possible to reinitialize an instance by calling its :"
"meth:`__init__` method again."
msgstr ""
#: c-api/typeobj.rst:956
msgid ""
"The self argument is the instance to be initialized; the *args* and *kwds* "
"arguments represent positional and keyword arguments of the call to :meth:"
"`__init__`."
msgstr ""
#: c-api/typeobj.rst:960
msgid ""
"The :c:member:`~PyTypeObject.tp_init` function, if not *NULL*, is called "
"when an instance is created normally by calling its type, after the type's :"
"c:member:`~PyTypeObject.tp_new` function has returned an instance of the "
"type. If the :c:member:`~PyTypeObject.tp_new` function returns an instance "
"of some other type that is not a subtype of the original type, no :c:member:"
"`~PyTypeObject.tp_init` function is called; if :c:member:`~PyTypeObject."
"tp_new` returns an instance of a subtype of the original type, the "
"subtype's :c:member:`~PyTypeObject.tp_init` is called. (VERSION NOTE: "
"described here is what is implemented in Python 2.2.1 and later. In Python "
"2.2, the :c:member:`~PyTypeObject.tp_init` of the type of the object "
"returned by :c:member:`~PyTypeObject.tp_new` was always called, if not "
"*NULL*.)"
msgstr ""
#: c-api/typeobj.rst:975
msgid "An optional pointer to an instance allocation function."
msgstr ""
#: c-api/typeobj.rst:981
msgid ""
"The purpose of this function is to separate memory allocation from memory "
"initialization. It should return a pointer to a block of memory of adequate "
"length for the instance, suitably aligned, and initialized to zeros, but "
"with :attr:`ob_refcnt` set to ``1`` and :attr:`ob_type` set to the type "
"argument. If the type's :c:member:`~PyTypeObject.tp_itemsize` is non-zero, "
"the object's :attr:`ob_size` field should be initialized to *nitems* and the "
"length of the allocated memory block should be ``tp_basicsize + "
"nitems*tp_itemsize``, rounded up to a multiple of ``sizeof(void*)``; "
"otherwise, *nitems* is not used and the length of the block should be :c:"
"member:`~PyTypeObject.tp_basicsize`."
msgstr ""
#: c-api/typeobj.rst:991
msgid ""
"Do not use this function to do any other instance initialization, not even "
"to allocate additional memory; that should be done by :c:member:"
"`~PyTypeObject.tp_new`."
msgstr ""
#: c-api/typeobj.rst:994
msgid ""
"This field is inherited by static subtypes, but not by dynamic subtypes "
"(subtypes created by a class statement); in the latter, this field is always "
"set to :c:func:`PyType_GenericAlloc`, to force a standard heap allocation "
"strategy. That is also the recommended value for statically defined types."
msgstr ""
#: c-api/typeobj.rst:1002
msgid "An optional pointer to an instance creation function."
msgstr ""
#: c-api/typeobj.rst:1004
msgid ""
"If this function is *NULL* for a particular type, that type cannot be called "
"to create new instances; presumably there is some other way to create "
"instances, like a factory function."
msgstr ""
#: c-api/typeobj.rst:1012
msgid ""
"The subtype argument is the type of the object being created; the *args* and "
"*kwds* arguments represent positional and keyword arguments of the call to "
"the type. Note that subtype doesn't have to equal the type whose :c:member:"
"`~PyTypeObject.tp_new` function is called; it may be a subtype of that type "
"(but not an unrelated type)."
msgstr ""
#: c-api/typeobj.rst:1018
msgid ""
"The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-"
">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do "
"only as much further initialization as is absolutely necessary. "
"Initialization that can safely be ignored or repeated should be placed in "
"the :c:member:`~PyTypeObject.tp_init` handler. A good rule of thumb is that "
"for immutable types, all initialization should take place in :c:member:"
"`~PyTypeObject.tp_new`, while for mutable types, most initialization should "
"be deferred to :c:member:`~PyTypeObject.tp_init`."
msgstr ""
#: c-api/typeobj.rst:1026
msgid ""
"This field is inherited by subtypes, except it is not inherited by static "
"types whose :c:member:`~PyTypeObject.tp_base` is *NULL* or "
"``&PyBaseObject_Type``. The latter exception is a precaution so that old "
"extension types don't become callable simply by being linked with Python 2.2."
msgstr ""
#: c-api/typeobj.rst:1034
msgid "An optional pointer to an instance deallocation function."
msgstr ""
#: c-api/typeobj.rst:1036
msgid ""
"The signature of this function has changed slightly: in Python 2.2 and "
"2.2.1, its signature is :c:type:`destructor`::"
msgstr ""
#: c-api/typeobj.rst:1041
msgid "In Python 2.3 and beyond, its signature is :c:type:`freefunc`::"
msgstr ""
#: c-api/typeobj.rst:1045
msgid ""
"The only initializer that is compatible with both versions is "
"``_PyObject_Del``, whose definition has suitably adapted in Python 2.3."
msgstr ""
#: c-api/typeobj.rst:1048
msgid ""
"This field is inherited by static subtypes, but not by dynamic subtypes "
"(subtypes created by a class statement); in the latter, this field is set to "
"a deallocator suitable to match :c:func:`PyType_GenericAlloc` and the value "
"of the :const:`Py_TPFLAGS_HAVE_GC` flag bit."
msgstr ""
#: c-api/typeobj.rst:1056
msgid "An optional pointer to a function called by the garbage collector."
msgstr ""
#: c-api/typeobj.rst:1058
msgid ""
"The garbage collector needs to know whether a particular object is "
"collectible or not. Normally, it is sufficient to look at the object's "
"type's :c:member:`~PyTypeObject.tp_flags` field, and check the :const:"
"`Py_TPFLAGS_HAVE_GC` flag bit. But some types have a mixture of statically "
"and dynamically allocated instances, and the statically allocated instances "
"are not collectible. Such types should define this function; it should "
"return ``1`` for a collectible instance, and ``0`` for a non-collectible "
"instance. The signature is ::"
msgstr ""
#: c-api/typeobj.rst:1068
msgid ""
"(The only example of this are types themselves. The metatype, :c:data:"
"`PyType_Type`, defines this function to distinguish between statically and "
"dynamically allocated types.)"
msgstr ""
#: c-api/typeobj.rst:1072
msgid ""
"This field is inherited by subtypes. (VERSION NOTE: in Python 2.2, it was "
"not inherited. It is inherited in 2.2.1 and later versions.)"
msgstr ""
#: c-api/typeobj.rst:1078
msgid "Tuple of base types."
msgstr ""
#: c-api/typeobj.rst:1080
msgid ""
"This is set for types created by a class statement. It should be *NULL* for "
"statically defined types."
msgstr ""
#: c-api/typeobj.rst:1083
msgid "This field is not inherited."
msgstr ""
#: c-api/typeobj.rst:1088
msgid ""
"Tuple containing the expanded set of base types, starting with the type "
"itself and ending with :class:`object`, in Method Resolution Order."
msgstr ""
#: c-api/typeobj.rst:1091
msgid ""
"This field is not inherited; it is calculated fresh by :c:func:"
"`PyType_Ready`."
msgstr ""
#: c-api/typeobj.rst:1096
msgid "Unused. Not inherited. Internal use only."
msgstr ""
#: c-api/typeobj.rst:1101
msgid ""
"List of weak references to subclasses. Not inherited. Internal use only."
msgstr ""
#: c-api/typeobj.rst:1106
msgid ""
"Weak reference list head, for weak references to this type object. Not "
"inherited. Internal use only."
msgstr ""
#: c-api/typeobj.rst:1109
msgid ""
"The remaining fields are only defined if the feature test macro :const:"
"`COUNT_ALLOCS` is defined, and are for internal use only. They are "
"documented here for completeness. None of these fields are inherited by "
"subtypes."
msgstr ""
#: c-api/typeobj.rst:1117
msgid "Number of allocations."
msgstr ""
#: c-api/typeobj.rst:1122
#, fuzzy
msgid "Number of frees."
msgstr "Nombres"
#: c-api/typeobj.rst:1127
msgid "Maximum simultaneously allocated objects."
msgstr ""
#: c-api/typeobj.rst:1132
msgid ""
"Pointer to the next type object with a non-zero :c:member:`~PyTypeObject."
"tp_allocs` field."
msgstr ""
#: c-api/typeobj.rst:1134
msgid ""
"Also, note that, in a garbage collected Python, tp_dealloc may be called "
"from any Python thread, not just the thread which created the object (if the "
"object becomes part of a refcount cycle, that cycle might be collected by a "
"garbage collection on any thread). This is not a problem for Python API "
"calls, since the thread on which tp_dealloc is called will own the Global "
"Interpreter Lock (GIL). However, if the object being destroyed in turn "
"destroys objects from some other C or C++ library, care should be taken to "
"ensure that destroying those objects on the thread which called tp_dealloc "
"will not violate any assumptions of the library."
msgstr ""
#: c-api/typeobj.rst:1148
msgid "Number Object Structures"
msgstr ""
#: c-api/typeobj.rst:1155
msgid ""
"This structure holds pointers to the functions which an object uses to "
"implement the number protocol. Almost every function below is used by the "
"function of similar name documented in the :ref:`number` section."
msgstr ""
#: c-api/typeobj.rst:1159
msgid "Here is the structure definition::"
msgstr ""
#: c-api/typeobj.rst:1210
msgid ""
"Binary and ternary functions may receive different kinds of arguments, "
"depending on the flag bit :const:`Py_TPFLAGS_CHECKTYPES`:"
msgstr ""
#: c-api/typeobj.rst:1213
msgid ""
"If :const:`Py_TPFLAGS_CHECKTYPES` is not set, the function arguments are "
"guaranteed to be of the object's type; the caller is responsible for calling "
"the coercion method specified by the :attr:`nb_coerce` member to convert the "
"arguments:"
msgstr ""
#: c-api/typeobj.rst:1220
msgid ""
"This function is used by :c:func:`PyNumber_CoerceEx` and has the same "
"signature. The first argument is always a pointer to an object of the "
"defined type. If the conversion to a common \"larger\" type is possible, "
"the function replaces the pointers with new references to the converted "
"objects and returns ``0``. If the conversion is not possible, the function "
"returns ``1``. If an error condition is set, it will return ``-1``."
msgstr ""
#: c-api/typeobj.rst:1227
msgid ""
"If the :const:`Py_TPFLAGS_CHECKTYPES` flag is set, binary and ternary "
"functions must check the type of all their operands, and implement the "
"necessary conversions (at least one of the operands is an instance of the "
"defined type). This is the recommended way; with Python 3 coercion will "
"disappear completely."
msgstr ""
#: c-api/typeobj.rst:1233
msgid ""
"If the operation is not defined for the given operands, binary and ternary "
"functions must return ``Py_NotImplemented``, if another error occurred they "
"must return ``NULL`` and set an exception."
msgstr ""
#: c-api/typeobj.rst:1241
msgid "Mapping Object Structures"
msgstr ""
#: c-api/typeobj.rst:1248
msgid ""
"This structure holds pointers to the functions which an object uses to "
"implement the mapping protocol. It has three members:"
msgstr ""
#: c-api/typeobj.rst:1253
msgid ""
"This function is used by :c:func:`PyMapping_Length` and :c:func:"
"`PyObject_Size`, and has the same signature. This slot may be set to *NULL* "
"if the object has no defined length."
msgstr ""
#: c-api/typeobj.rst:1259
msgid ""
"This function is used by :c:func:`PyObject_GetItem` and has the same "
"signature. This slot must be filled for the :c:func:`PyMapping_Check` "
"function to return ``1``, it can be *NULL* otherwise."
msgstr ""
#: c-api/typeobj.rst:1265
msgid ""
"This function is used by :c:func:`PyObject_SetItem` and has the same "
"signature. If this slot is *NULL*, the object does not support item "
"assignment."
msgstr ""
#: c-api/typeobj.rst:1273
msgid "Sequence Object Structures"
msgstr ""
#: c-api/typeobj.rst:1280
msgid ""
"This structure holds pointers to the functions which an object uses to "
"implement the sequence protocol."
msgstr ""
#: c-api/typeobj.rst:1285
msgid ""
"This function is used by :c:func:`PySequence_Size` and :c:func:"
"`PyObject_Size`, and has the same signature."
msgstr ""
#: c-api/typeobj.rst:1290
msgid ""
"This function is used by :c:func:`PySequence_Concat` and has the same "
"signature. It is also used by the ``+`` operator, after trying the numeric "
"addition via the :c:member:`~PyTypeObject.tp_as_number.nb_add` slot."
msgstr ""
#: c-api/typeobj.rst:1296
msgid ""
"This function is used by :c:func:`PySequence_Repeat` and has the same "
"signature. It is also used by the ``*`` operator, after trying numeric "
"multiplication via the :c:member:`~PyTypeObject.tp_as_number.nb_multiply` "
"slot."
msgstr ""
#: c-api/typeobj.rst:1303
msgid ""
"This function is used by :c:func:`PySequence_GetItem` and has the same "
"signature. This slot must be filled for the :c:func:`PySequence_Check` "
"function to return ``1``, it can be *NULL* otherwise."
msgstr ""
#: c-api/typeobj.rst:1307
msgid ""
"Negative indexes are handled as follows: if the :attr:`sq_length` slot is "
"filled, it is called and the sequence length is used to compute a positive "
"index which is passed to :attr:`sq_item`. If :attr:`sq_length` is *NULL*, "
"the index is passed as is to the function."
msgstr ""
#: c-api/typeobj.rst:1314
msgid ""
"This function is used by :c:func:`PySequence_SetItem` and has the same "
"signature. This slot may be left to *NULL* if the object does not support "
"item assignment."
msgstr ""
#: c-api/typeobj.rst:1320
msgid ""
"This function may be used by :c:func:`PySequence_Contains` and has the same "
"signature. This slot may be left to *NULL*, in this case :c:func:"
"`PySequence_Contains` simply traverses the sequence until it finds a match."
msgstr ""
#: c-api/typeobj.rst:1327
msgid ""
"This function is used by :c:func:`PySequence_InPlaceConcat` and has the same "
"signature. It should modify its first operand, and return it."
msgstr ""
#: c-api/typeobj.rst:1332
msgid ""
"This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same "
"signature. It should modify its first operand, and return it."
msgstr ""
#: c-api/typeobj.rst:1342
msgid "Buffer Object Structures"
msgstr ""
#: c-api/typeobj.rst:1347
msgid ""
"The buffer interface exports a model where an object can expose its internal "
"data as a set of chunks of data, where each chunk is specified as a pointer/"
"length pair. These chunks are called :dfn:`segments` and are presumed to be "
"non-contiguous in memory."
msgstr ""
#: c-api/typeobj.rst:1352
msgid ""
"If an object does not export the buffer interface, then its :c:member:"
"`~PyTypeObject.tp_as_buffer` member in the :c:type:`PyTypeObject` structure "
"should be *NULL*. Otherwise, the :c:member:`~PyTypeObject.tp_as_buffer` "
"will point to a :c:type:`PyBufferProcs` structure."
msgstr ""
#: c-api/typeobj.rst:1358
msgid ""
"It is very important that your :c:type:`PyTypeObject` structure uses :const:"
"`Py_TPFLAGS_DEFAULT` for the value of the :c:member:`~PyTypeObject.tp_flags` "
"member rather than ``0``. This tells the Python runtime that your :c:type:"
"`PyBufferProcs` structure contains the :attr:`bf_getcharbuffer` slot. Older "
"versions of Python did not have this member, so a new Python interpreter "
"using an old extension needs to be able to test for its presence before "
"using it."
msgstr ""
#: c-api/typeobj.rst:1368
msgid ""
"Structure used to hold the function pointers which define an implementation "
"of the buffer protocol."
msgstr ""
#: c-api/typeobj.rst:1371
msgid ""
"The first slot is :attr:`bf_getreadbuffer`, of type :c:type:"
"`getreadbufferproc`. If this slot is *NULL*, then the object does not "
"support reading from the internal data. This is non-sensical, so "
"implementors should fill this in, but callers should test that the slot "
"contains a non-*NULL* value."
msgstr ""
#: c-api/typeobj.rst:1376
msgid ""
"The next slot is :attr:`bf_getwritebuffer` having type :c:type:"
"`getwritebufferproc`. This slot may be *NULL* if the object does not allow "
"writing into its returned buffers."
msgstr ""
#: c-api/typeobj.rst:1380
msgid ""
"The third slot is :attr:`bf_getsegcount`, with type :c:type:"
"`getsegcountproc`. This slot must not be *NULL* and is used to inform the "
"caller how many segments the object contains. Simple objects such as :c:"
"type:`PyString_Type` and :c:type:`PyBuffer_Type` objects contain a single "
"segment."
msgstr ""
#: c-api/typeobj.rst:1387
msgid ""
"The last slot is :attr:`bf_getcharbuffer`, of type :c:type:"
"`getcharbufferproc`. This slot will only be present if the :const:"
"`Py_TPFLAGS_HAVE_GETCHARBUFFER` flag is present in the :c:member:"
"`~PyTypeObject.tp_flags` field of the object's :c:type:`PyTypeObject`. "
"Before using this slot, the caller should test whether it is present by "
"using the :c:func:`PyType_HasFeature` function. If the flag is present, :"
"attr:`bf_getcharbuffer` may be *NULL*, indicating that the object's contents "
"cannot be used as *8-bit characters*. The slot function may also raise an "
"error if the object's contents cannot be interpreted as 8-bit characters. "
"For example, if the object is an array which is configured to hold floating "
"point values, an exception may be raised if a caller attempts to use :attr:"
"`bf_getcharbuffer` to fetch a sequence of 8-bit characters. This notion of "
"exporting the internal buffers as \"text\" is used to distinguish between "
"objects that are binary in nature, and those which have character-based "
"content."
msgstr ""
#: c-api/typeobj.rst:1403
msgid ""
"The current policy seems to state that these characters may be multi-byte "
"characters. This implies that a buffer size of *N* does not mean there are "
"*N* characters present."
msgstr ""
#: c-api/typeobj.rst:1410
msgid ""
"Flag bit set in the type structure to indicate that the :attr:"
"`bf_getcharbuffer` slot is known. This being set does not indicate that the "
"object supports the buffer interface or that the :attr:`bf_getcharbuffer` "
"slot is non-*NULL*."
msgstr ""
#: c-api/typeobj.rst:1417
msgid ""
"Return a pointer to a readable segment of the buffer in ``*ptrptr``. This "
"function is allowed to raise an exception, in which case it must return "
"``-1``. The *segment* which is specified must be zero or positive, and "
"strictly less than the number of segments returned by the :attr:"
"`bf_getsegcount` slot function. On success, it returns the length of the "
"segment, and sets ``*ptrptr`` to a pointer to that memory."
msgstr ""
#: c-api/typeobj.rst:1427
msgid ""
"Return a pointer to a writable memory buffer in ``*ptrptr``, and the length "
"of that segment as the function return value. The memory buffer must "
"correspond to buffer segment *segment*. Must return ``-1`` and set an "
"exception on error. :exc:`TypeError` should be raised if the object only "
"supports read-only buffers, and :exc:`SystemError` should be raised when "
"*segment* specifies a segment that doesn't exist."
msgstr ""
#: c-api/typeobj.rst:1441
msgid ""
"Return the number of memory segments which comprise the buffer. If *lenp* "
"is not *NULL*, the implementation must report the sum of the sizes (in "
"bytes) of all segments in ``*lenp``. The function cannot fail."
msgstr ""
#: c-api/typeobj.rst:1448
msgid ""
"Return the size of the segment *segment* that *ptrptr* is set to. "
"``*ptrptr`` is set to the memory buffer. Returns ``-1`` on error."
msgstr ""
#: c-api/unicode.rst:6
msgid "Unicode Objects and Codecs"
msgstr ""
#: c-api/unicode.rst:11
msgid "Unicode Objects"
msgstr ""
#: c-api/unicode.rst:15
msgid "Unicode Type"
msgstr ""
#: c-api/unicode.rst:17
msgid ""
"These are the basic Unicode object types used for the Unicode implementation "
"in Python:"
msgstr ""
#: c-api/unicode.rst:23
msgid ""
"This type represents the storage type which is used by Python internally as "
"basis for holding Unicode ordinals. Python's default builds use a 16-bit "
"type for :c:type:`Py_UNICODE` and store Unicode values internally as UCS2. "
"It is also possible to build a UCS4 version of Python (most recent Linux "
"distributions come with UCS4 builds of Python). These builds then use a 32-"
"bit type for :c:type:`Py_UNICODE` and store Unicode data internally as UCS4. "
"On platforms where :c:type:`wchar_t` is available and compatible with the "
"chosen Python Unicode build variant, :c:type:`Py_UNICODE` is a typedef alias "
"for :c:type:`wchar_t` to enhance native platform compatibility. On all other "
"platforms, :c:type:`Py_UNICODE` is a typedef alias for either :c:type:"
"`unsigned short` (UCS2) or :c:type:`unsigned long` (UCS4)."
msgstr ""
#: c-api/unicode.rst:35
msgid ""
"Note that UCS2 and UCS4 Python builds are not binary compatible. Please keep "
"this in mind when writing extensions or interfaces."
msgstr ""
#: c-api/unicode.rst:41
msgid "This subtype of :c:type:`PyObject` represents a Python Unicode object."
msgstr ""
#: c-api/unicode.rst:46
msgid ""
"This instance of :c:type:`PyTypeObject` represents the Python Unicode type. "
"It is exposed to Python code as ``unicode`` and ``types.UnicodeType``."
msgstr ""
#: c-api/unicode.rst:49
msgid ""
"The following APIs are really C macros and can be used to do fast checks and "
"to access internal read-only data of Unicode objects:"
msgstr ""
#: c-api/unicode.rst:55
msgid ""
"Return true if the object *o* is a Unicode object or an instance of a "
"Unicode subtype."
msgstr ""
#: c-api/unicode.rst:64
msgid ""
"Return true if the object *o* is a Unicode object, but not an instance of a "
"subtype."
msgstr ""
#: c-api/unicode.rst:72
msgid ""
"Return the size of the object. *o* has to be a :c:type:`PyUnicodeObject` "
"(not checked)."
msgstr ""
#: c-api/unicode.rst:82
msgid ""
"Return the size of the object's internal buffer in bytes. *o* has to be a :"
"c:type:`PyUnicodeObject` (not checked)."
msgstr ""
#: c-api/unicode.rst:92
msgid ""
"Return a pointer to the internal :c:type:`Py_UNICODE` buffer of the object. "
"*o* has to be a :c:type:`PyUnicodeObject` (not checked)."
msgstr ""
#: c-api/unicode.rst:98
msgid ""
"Return a pointer to the internal buffer of the object. *o* has to be a :c:"
"type:`PyUnicodeObject` (not checked)."
msgstr ""
#: c-api/unicode.rst:110
msgid "Unicode Character Properties"
msgstr ""
#: c-api/unicode.rst:112
msgid ""
"Unicode provides many different character properties. The most often needed "
"ones are available through these macros which are mapped to C functions "
"depending on the Python configuration."
msgstr ""
#: c-api/unicode.rst:119
msgid "Return 1 or 0 depending on whether *ch* is a whitespace character."
msgstr ""
#: c-api/unicode.rst:124
msgid "Return 1 or 0 depending on whether *ch* is a lowercase character."
msgstr ""
#: c-api/unicode.rst:129
msgid "Return 1 or 0 depending on whether *ch* is an uppercase character."
msgstr ""
#: c-api/unicode.rst:134
msgid "Return 1 or 0 depending on whether *ch* is a titlecase character."
msgstr ""
#: c-api/unicode.rst:139
msgid "Return 1 or 0 depending on whether *ch* is a linebreak character."
msgstr ""
#: c-api/unicode.rst:144
msgid "Return 1 or 0 depending on whether *ch* is a decimal character."
msgstr ""
#: c-api/unicode.rst:149
msgid "Return 1 or 0 depending on whether *ch* is a digit character."
msgstr ""
#: c-api/unicode.rst:154
msgid "Return 1 or 0 depending on whether *ch* is a numeric character."
msgstr ""
#: c-api/unicode.rst:159
msgid "Return 1 or 0 depending on whether *ch* is an alphabetic character."
msgstr ""
#: c-api/unicode.rst:164
msgid "Return 1 or 0 depending on whether *ch* is an alphanumeric character."
msgstr ""
#: c-api/unicode.rst:166
msgid "These APIs can be used for fast direct character conversions:"
msgstr ""
#: c-api/unicode.rst:171
msgid "Return the character *ch* converted to lower case."
msgstr ""
#: c-api/unicode.rst:176
msgid "Return the character *ch* converted to upper case."
msgstr ""
#: c-api/unicode.rst:181
msgid "Return the character *ch* converted to title case."
msgstr ""
#: c-api/unicode.rst:186
msgid ""
"Return the character *ch* converted to a decimal positive integer. Return "
"``-1`` if this is not possible. This macro does not raise exceptions."
msgstr ""
#: c-api/unicode.rst:192
msgid ""
"Return the character *ch* converted to a single digit integer. Return ``-1`` "
"if this is not possible. This macro does not raise exceptions."
msgstr ""
#: c-api/unicode.rst:198
msgid ""
"Return the character *ch* converted to a double. Return ``-1.0`` if this is "
"not possible. This macro does not raise exceptions."
msgstr ""
#: c-api/unicode.rst:203
msgid "Plain Py_UNICODE"
msgstr ""
#: c-api/unicode.rst:205
msgid ""
"To create Unicode objects and access their basic sequence properties, use "
"these APIs:"
msgstr ""
#: c-api/unicode.rst:211
msgid ""
"Create a Unicode object from the Py_UNICODE buffer *u* of the given size. "
"*u* may be *NULL* which causes the contents to be undefined. It is the "
"user's responsibility to fill in the needed data. The buffer is copied into "
"the new object. If the buffer is not *NULL*, the return value might be a "
"shared object. Therefore, modification of the resulting Unicode object is "
"only allowed when *u* is *NULL*."
msgstr ""
#: c-api/unicode.rst:225
msgid ""
"Create a Unicode object from the char buffer *u*. The bytes will be "
"interpreted as being UTF-8 encoded. *u* may also be *NULL* which causes the "
"contents to be undefined. It is the user's responsibility to fill in the "
"needed data. The buffer is copied into the new object. If the buffer is not "
"*NULL*, the return value might be a shared object. Therefore, modification "
"of the resulting Unicode object is only allowed when *u* is *NULL*."
msgstr ""
#: c-api/unicode.rst:237
msgid ""
"Create a Unicode object from an UTF-8 encoded null-terminated char buffer "
"*u*."
msgstr ""
#: c-api/unicode.rst:245
msgid ""
"Take a C :c:func:`printf`\\ -style *format* string and a variable number of "
"arguments, calculate the size of the resulting Python unicode string and "
"return a string with the values formatted into it. The variable arguments "
"must be C types and must correspond exactly to the format characters in the "
"*format* string. The following format characters are allowed:"
msgstr ""
#: c-api/unicode.rst:300
msgid ":attr:`%U`"
msgstr ""
#: c-api/unicode.rst:300 c-api/unicode.rst:309 c-api/unicode.rst:312
msgid "PyObject\\*"
msgstr "PyObject\\*"
#: c-api/unicode.rst:300
#, fuzzy
msgid "A unicode object."
msgstr "Objets Code"
#: c-api/unicode.rst:302
msgid ":attr:`%V`"
msgstr ""
#: c-api/unicode.rst:302
msgid "PyObject\\*, char \\*"
msgstr ""
#: c-api/unicode.rst:302
msgid ""
"A unicode object (which may be *NULL*) and a null-terminated C character "
"array as a second parameter (which will be used, if the first parameter is "
"*NULL*)."
msgstr ""
#: c-api/unicode.rst:309
msgid ":attr:`%S`"
msgstr ""
#: c-api/unicode.rst:309
msgid "The result of calling :func:`PyObject_Unicode`."
msgstr ""
#: c-api/unicode.rst:312
msgid ":attr:`%R`"
msgstr ""
#: c-api/unicode.rst:312
msgid "The result of calling :func:`PyObject_Repr`."
msgstr ""
#: c-api/unicode.rst:324
msgid ""
"Identical to :func:`PyUnicode_FromFormat` except that it takes exactly two "
"arguments."
msgstr ""
#: c-api/unicode.rst:332
msgid ""
"Return a read-only pointer to the Unicode object's internal :c:type:"
"`Py_UNICODE` buffer, *NULL* if *unicode* is not a Unicode object. Note that "
"the resulting :c:type:`Py_UNICODE*` string may contain embedded null "
"characters, which would cause the string to be truncated when used in most C "
"functions."
msgstr ""
#: c-api/unicode.rst:341
msgid "Return the length of the Unicode object."
msgstr ""
#: c-api/unicode.rst:350
msgid ""
"Coerce an encoded object *obj* to an Unicode object and return a reference "
"with incremented refcount."
msgstr ""
#: c-api/unicode.rst:353
msgid ""
"String and other char buffer compatible objects are decoded according to the "
"given encoding and using the error handling defined by errors. Both can be "
"*NULL* to have the interface use the default values (see the next section "
"for details)."
msgstr ""
#: c-api/unicode.rst:358
msgid ""
"All other objects, including Unicode objects, cause a :exc:`TypeError` to be "
"set."
msgstr ""
#: c-api/unicode.rst:361
msgid ""
"The API returns *NULL* if there was an error. The caller is responsible for "
"decref'ing the returned objects."
msgstr ""
#: c-api/unicode.rst:367
msgid ""
"Shortcut for ``PyUnicode_FromEncodedObject(obj, NULL, \"strict\")`` which is "
"used throughout the interpreter whenever coercion to Unicode is needed."
msgstr ""
#: c-api/unicode.rst:370
msgid ""
"If the platform supports :c:type:`wchar_t` and provides a header file wchar."
"h, Python can interface directly to this type using the following functions. "
"Support is optimized if Python's own :c:type:`Py_UNICODE` type is identical "
"to the system's :c:type:`wchar_t`."
msgstr ""
#: c-api/unicode.rst:377
msgid "wchar_t Support"
msgstr ""
#: c-api/unicode.rst:379
msgid ":c:type:`wchar_t` support for platforms which support it:"
msgstr ""
#: c-api/unicode.rst:383
msgid ""
"Create a Unicode object from the :c:type:`wchar_t` buffer *w* of the given "
"*size*. Return *NULL* on failure."
msgstr ""
#: c-api/unicode.rst:393
msgid ""
"Copy the Unicode object contents into the :c:type:`wchar_t` buffer *w*. At "
"most *size* :c:type:`wchar_t` characters are copied (excluding a possibly "
"trailing 0-termination character). Return the number of :c:type:`wchar_t` "
"characters copied or -1 in case of an error. Note that the resulting :c:"
"type:`wchar_t` string may or may not be 0-terminated. It is the "
"responsibility of the caller to make sure that the :c:type:`wchar_t` string "
"is 0-terminated in case this is required by the application. Also, note that "
"the :c:type:`wchar_t*` string might contain null characters, which would "
"cause the string to be truncated when used with most C functions."
msgstr ""
#: c-api/unicode.rst:403
msgid ""
"This function returned an :c:type:`int` type and used an :c:type:`int` type "
"for *size*. This might require changes in your code for properly supporting "
"64-bit systems."
msgstr ""
#: c-api/unicode.rst:412
msgid "Built-in Codecs"
msgstr ""
#: c-api/unicode.rst:414
msgid ""
"Python provides a set of built-in codecs which are written in C for speed. "
"All of these codecs are directly usable via the following functions."
msgstr ""
#: c-api/unicode.rst:417
msgid ""
"Many of the following APIs take two arguments encoding and errors, and they "
"have the same semantics as the ones of the built-in :func:`unicode` Unicode "
"object constructor."
msgstr ""
#: c-api/unicode.rst:421
msgid ""
"Setting encoding to *NULL* causes the default encoding to be used which is "
"ASCII. The file system calls should use :c:data:"
"`Py_FileSystemDefaultEncoding` as the encoding for file names. This variable "
"should be treated as read-only: on some systems, it will be a pointer to a "
"static string, on others, it will change at run-time (such as when the "
"application invokes setlocale)."
msgstr ""
#: c-api/unicode.rst:427
msgid ""
"Error handling is set by errors which may also be set to *NULL* meaning to "
"use the default handling defined for the codec. Default error handling for "
"all built-in codecs is \"strict\" (:exc:`ValueError` is raised)."
msgstr ""
#: c-api/unicode.rst:431
msgid ""
"The codecs all use a similar interface. Only deviation from the following "
"generic ones are documented for simplicity."
msgstr ""
#: c-api/unicode.rst:436
msgid "Generic Codecs"
msgstr ""
#: c-api/unicode.rst:438
msgid "These are the generic codec APIs:"
msgstr ""
#: c-api/unicode.rst:443
msgid ""
"Create a Unicode object by decoding *size* bytes of the encoded string *s*. "
"*encoding* and *errors* have the same meaning as the parameters of the same "
"name in the :func:`unicode` built-in function. The codec to be used is "
"looked up using the Python codec registry. Return *NULL* if an exception "
"was raised by the codec."
msgstr ""
#: c-api/unicode.rst:456
msgid ""
"Encode the :c:type:`Py_UNICODE` buffer *s* of the given *size* and return a "
"Python string object. *encoding* and *errors* have the same meaning as the "
"parameters of the same name in the Unicode :meth:`~unicode.encode` method. "
"The codec to be used is looked up using the Python codec registry. Return "
"*NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:469
msgid ""
"Encode a Unicode object and return the result as Python string object. "
"*encoding* and *errors* have the same meaning as the parameters of the same "
"name in the Unicode :meth:`encode` method. The codec to be used is looked up "
"using the Python codec registry. Return *NULL* if an exception was raised by "
"the codec."
msgstr ""
#: c-api/unicode.rst:477
msgid "UTF-8 Codecs"
msgstr ""
#: c-api/unicode.rst:479
msgid "These are the UTF-8 codec APIs:"
msgstr ""
#: c-api/unicode.rst:484
msgid ""
"Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string "
"*s*. Return *NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:494
msgid ""
"If *consumed* is *NULL*, behave like :c:func:`PyUnicode_DecodeUTF8`. If "
"*consumed* is not *NULL*, trailing incomplete UTF-8 byte sequences will not "
"be treated as an error. Those bytes will not be decoded and the number of "
"bytes that have been decoded will be stored in *consumed*."
msgstr ""
#: c-api/unicode.rst:508
msgid ""
"Encode the :c:type:`Py_UNICODE` buffer *s* of the given *size* using UTF-8 "
"and return a Python string object. Return *NULL* if an exception was raised "
"by the codec."
msgstr ""
#: c-api/unicode.rst:518
msgid ""
"Encode a Unicode object using UTF-8 and return the result as Python string "
"object. Error handling is \"strict\". Return *NULL* if an exception was "
"raised by the codec."
msgstr ""
#: c-api/unicode.rst:524
msgid "UTF-32 Codecs"
msgstr ""
#: c-api/unicode.rst:526
msgid "These are the UTF-32 codec APIs:"
msgstr ""
#: c-api/unicode.rst:531
msgid ""
"Decode *size* bytes from a UTF-32 encoded buffer string and return the "
"corresponding Unicode object. *errors* (if non-*NULL*) defines the error "
"handling. It defaults to \"strict\"."
msgstr ""
#: c-api/unicode.rst:535 c-api/unicode.rst:611
msgid ""
"If *byteorder* is non-*NULL*, the decoder starts decoding using the given "
"byte order::"
msgstr ""
#: c-api/unicode.rst:542
msgid ""
"If ``*byteorder`` is zero, and the first four bytes of the input data are a "
"byte order mark (BOM), the decoder switches to this byte order and the BOM "
"is not copied into the resulting Unicode string. If ``*byteorder`` is "
"``-1`` or ``1``, any byte order mark is copied to the output."
msgstr ""
#: c-api/unicode.rst:547 c-api/unicode.rst:624
msgid ""
"After completion, *\\*byteorder* is set to the current byte order at the end "
"of input data."
msgstr ""
#: c-api/unicode.rst:550
msgid ""
"In a narrow build code points outside the BMP will be decoded as surrogate "
"pairs."
msgstr ""
#: c-api/unicode.rst:552 c-api/unicode.rst:627
msgid "If *byteorder* is *NULL*, the codec starts in native order mode."
msgstr ""
#: c-api/unicode.rst:554 c-api/unicode.rst:585 c-api/unicode.rst:629
#: c-api/unicode.rst:668
msgid "Return *NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:561
msgid ""
"If *consumed* is *NULL*, behave like :c:func:`PyUnicode_DecodeUTF32`. If "
"*consumed* is not *NULL*, :c:func:`PyUnicode_DecodeUTF32Stateful` will not "
"treat trailing incomplete UTF-32 byte sequences (such as a number of bytes "
"not divisible by four) as an error. Those bytes will not be decoded and the "
"number of bytes that have been decoded will be stored in *consumed*."
msgstr ""
#: c-api/unicode.rst:572
msgid ""
"Return a Python bytes object holding the UTF-32 encoded value of the Unicode "
"data in *s*. Output is written according to the following byte order::"
msgstr ""
#: c-api/unicode.rst:579 c-api/unicode.rst:661
msgid ""
"If byteorder is ``0``, the output string will always start with the Unicode "
"BOM mark (U+FEFF). In the other two modes, no BOM mark is prepended."
msgstr ""
#: c-api/unicode.rst:582
msgid ""
"If *Py_UNICODE_WIDE* is not defined, surrogate pairs will be output as a "
"single code point."
msgstr ""
#: c-api/unicode.rst:592
msgid ""
"Return a Python string using the UTF-32 encoding in native byte order. The "
"string always starts with a BOM mark. Error handling is \"strict\". Return "
"*NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:600
msgid "UTF-16 Codecs"
msgstr ""
#: c-api/unicode.rst:602
msgid "These are the UTF-16 codec APIs:"
msgstr ""
#: c-api/unicode.rst:607
msgid ""
"Decode *size* bytes from a UTF-16 encoded buffer string and return the "
"corresponding Unicode object. *errors* (if non-*NULL*) defines the error "
"handling. It defaults to \"strict\"."
msgstr ""
#: c-api/unicode.rst:618
msgid ""
"If ``*byteorder`` is zero, and the first two bytes of the input data are a "
"byte order mark (BOM), the decoder switches to this byte order and the BOM "
"is not copied into the resulting Unicode string. If ``*byteorder`` is "
"``-1`` or ``1``, any byte order mark is copied to the output (where it will "
"result in either a ``\\ufeff`` or a ``\\ufffe`` character)."
msgstr ""
#: c-api/unicode.rst:638
msgid ""
"If *consumed* is *NULL*, behave like :c:func:`PyUnicode_DecodeUTF16`. If "
"*consumed* is not *NULL*, :c:func:`PyUnicode_DecodeUTF16Stateful` will not "
"treat trailing incomplete UTF-16 byte sequences (such as an odd number of "
"bytes or a split surrogate pair) as an error. Those bytes will not be "
"decoded and the number of bytes that have been decoded will be stored in "
"*consumed*."
msgstr ""
#: c-api/unicode.rst:646
msgid ""
"This function used an :c:type:`int` type for *size* and an :c:type:`int *` "
"type for *consumed*. This might require changes in your code for properly "
"supporting 64-bit systems."
msgstr ""
#: c-api/unicode.rst:654
msgid ""
"Return a Python string object holding the UTF-16 encoded value of the "
"Unicode data in *s*. Output is written according to the following byte "
"order::"
msgstr ""
#: c-api/unicode.rst:664
msgid ""
"If *Py_UNICODE_WIDE* is defined, a single :c:type:`Py_UNICODE` value may get "
"represented as a surrogate pair. If it is not defined, each :c:type:"
"`Py_UNICODE` values is interpreted as an UCS-2 character."
msgstr ""
#: c-api/unicode.rst:677
msgid ""
"Return a Python string using the UTF-16 encoding in native byte order. The "
"string always starts with a BOM mark. Error handling is \"strict\". Return "
"*NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:683
msgid "UTF-7 Codecs"
msgstr ""
#: c-api/unicode.rst:685
msgid "These are the UTF-7 codec APIs:"
msgstr ""
#: c-api/unicode.rst:690
msgid ""
"Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string "
"*s*. Return *NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:696
msgid ""
"If *consumed* is *NULL*, behave like :c:func:`PyUnicode_DecodeUTF7`. If "
"*consumed* is not *NULL*, trailing incomplete UTF-7 base-64 sections will "
"not be treated as an error. Those bytes will not be decoded and the number "
"of bytes that have been decoded will be stored in *consumed*."
msgstr ""
#: c-api/unicode.rst:704
msgid ""
"Encode the :c:type:`Py_UNICODE` buffer of the given size using UTF-7 and "
"return a Python bytes object. Return *NULL* if an exception was raised by "
"the codec."
msgstr ""
#: c-api/unicode.rst:708
msgid ""
"If *base64SetO* is nonzero, \"Set O\" (punctuation that has no otherwise "
"special meaning) will be encoded in base-64. If *base64WhiteSpace* is "
"nonzero, whitespace will be encoded in base-64. Both are set to zero for "
"the Python \"utf-7\" codec."
msgstr ""
#: c-api/unicode.rst:715
msgid "Unicode-Escape Codecs"
msgstr ""
#: c-api/unicode.rst:717
msgid "These are the \"Unicode Escape\" codec APIs:"
msgstr ""
#: c-api/unicode.rst:722
msgid ""
"Create a Unicode object by decoding *size* bytes of the Unicode-Escape "
"encoded string *s*. Return *NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:732
msgid ""
"Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Unicode-"
"Escape and return a Python string object. Return *NULL* if an exception was "
"raised by the codec."
msgstr ""
#: c-api/unicode.rst:743
msgid ""
"Encode a Unicode object using Unicode-Escape and return the result as Python "
"string object. Error handling is \"strict\". Return *NULL* if an exception "
"was raised by the codec."
msgstr ""
#: c-api/unicode.rst:749
msgid "Raw-Unicode-Escape Codecs"
msgstr ""
#: c-api/unicode.rst:751
msgid "These are the \"Raw Unicode Escape\" codec APIs:"
msgstr ""
#: c-api/unicode.rst:756
msgid ""
"Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape "
"encoded string *s*. Return *NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:766
msgid ""
"Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Raw-Unicode-"
"Escape and return a Python string object. Return *NULL* if an exception was "
"raised by the codec."
msgstr ""
#: c-api/unicode.rst:777
msgid ""
"Encode a Unicode object using Raw-Unicode-Escape and return the result as "
"Python string object. Error handling is \"strict\". Return *NULL* if an "
"exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:783
msgid "Latin-1 Codecs"
msgstr ""
#: c-api/unicode.rst:785
msgid ""
"These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 "
"Unicode ordinals and only these are accepted by the codecs during encoding."
msgstr ""
#: c-api/unicode.rst:791
msgid ""
"Create a Unicode object by decoding *size* bytes of the Latin-1 encoded "
"string *s*. Return *NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:801
msgid ""
"Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Latin-1 and "
"return a Python string object. Return *NULL* if an exception was raised by "
"the codec."
msgstr ""
#: c-api/unicode.rst:811
msgid ""
"Encode a Unicode object using Latin-1 and return the result as Python string "
"object. Error handling is \"strict\". Return *NULL* if an exception was "
"raised by the codec."
msgstr ""
#: c-api/unicode.rst:817
msgid "ASCII Codecs"
msgstr ""
#: c-api/unicode.rst:819
msgid ""
"These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All "
"other codes generate errors."
msgstr ""
#: c-api/unicode.rst:825
msgid ""
"Create a Unicode object by decoding *size* bytes of the ASCII encoded string "
"*s*. Return *NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:835
msgid ""
"Encode the :c:type:`Py_UNICODE` buffer of the given *size* using ASCII and "
"return a Python string object. Return *NULL* if an exception was raised by "
"the codec."
msgstr ""
#: c-api/unicode.rst:845
msgid ""
"Encode a Unicode object using ASCII and return the result as Python string "
"object. Error handling is \"strict\". Return *NULL* if an exception was "
"raised by the codec."
msgstr ""
#: c-api/unicode.rst:851
msgid "Character Map Codecs"
msgstr ""
#: c-api/unicode.rst:853
msgid ""
"This codec is special in that it can be used to implement many different "
"codecs (and this is in fact what was done to obtain most of the standard "
"codecs included in the :mod:`encodings` package). The codec uses mapping to "
"encode and decode characters."
msgstr ""
#: c-api/unicode.rst:858
msgid ""
"Decoding mappings must map single string characters to single Unicode "
"characters, integers (which are then interpreted as Unicode ordinals) or "
"None (meaning \"undefined mapping\" and causing an error)."
msgstr ""
#: c-api/unicode.rst:862
msgid ""
"Encoding mappings must map single Unicode characters to single string "
"characters, integers (which are then interpreted as Latin-1 ordinals) or "
"None (meaning \"undefined mapping\" and causing an error)."
msgstr ""
#: c-api/unicode.rst:866
msgid ""
"The mapping objects provided must only support the __getitem__ mapping "
"interface."
msgstr ""
#: c-api/unicode.rst:869
msgid ""
"If a character lookup fails with a LookupError, the character is copied as-"
"is meaning that its ordinal value will be interpreted as Unicode or Latin-1 "
"ordinal resp. Because of this, mappings only need to contain those mappings "
"which map characters to different code points."
msgstr ""
#: c-api/unicode.rst:874
msgid "These are the mapping codec APIs:"
msgstr ""
#: c-api/unicode.rst:878
msgid ""
"Create a Unicode object by decoding *size* bytes of the encoded string *s* "
"using the given *mapping* object. Return *NULL* if an exception was raised "
"by the codec. If *mapping* is *NULL* latin-1 decoding will be done. Else it "
"can be a dictionary mapping byte or a unicode string, which is treated as a "
"lookup table. Byte values greater that the length of the string and U+FFFE "
"\"characters\" are treated as \"undefined mapping\"."
msgstr ""
#: c-api/unicode.rst:885
msgid "Allowed unicode string as mapping argument."
msgstr ""
#: c-api/unicode.rst:895
msgid ""
"Encode the :c:type:`Py_UNICODE` buffer of the given *size* using the given "
"*mapping* object and return a Python string object. Return *NULL* if an "
"exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:906
msgid ""
"Encode a Unicode object using the given *mapping* object and return the "
"result as Python string object. Error handling is \"strict\". Return "
"*NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:910
msgid "The following codec API is special in that maps Unicode to Unicode."
msgstr ""
#: c-api/unicode.rst:915
msgid ""
"Translate a :c:type:`Py_UNICODE` buffer of the given *size* by applying a "
"character mapping *table* to it and return the resulting Unicode object. "
"Return *NULL* when an exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:919
msgid ""
"The *mapping* table must map Unicode ordinal integers to Unicode ordinal "
"integers or None (causing deletion of the character)."
msgstr ""
#: c-api/unicode.rst:922 c-api/unicode.rst:1024
msgid ""
"Mapping tables need only provide the :meth:`__getitem__` interface; "
"dictionaries and sequences work well. Unmapped character ordinals (ones "
"which cause a :exc:`LookupError`) are left untouched and are copied as-is."
msgstr ""
#: c-api/unicode.rst:932
msgid "MBCS codecs for Windows"
msgstr ""
#: c-api/unicode.rst:934
msgid ""
"These are the MBCS codec APIs. They are currently only available on Windows "
"and use the Win32 MBCS converters to implement the conversions. Note that "
"MBCS (or DBCS) is a class of encodings, not just one. The target encoding "
"is defined by the user settings on the machine running the codec."
msgstr ""
#: c-api/unicode.rst:942
msgid ""
"Create a Unicode object by decoding *size* bytes of the MBCS encoded string "
"*s*. Return *NULL* if an exception was raised by the codec."
msgstr ""
#: c-api/unicode.rst:952
msgid ""
"If *consumed* is *NULL*, behave like :c:func:`PyUnicode_DecodeMBCS`. If "
"*consumed* is not *NULL*, :c:func:`PyUnicode_DecodeMBCSStateful` will not "
"decode trailing lead byte and the number of bytes that have been decoded "
"will be stored in *consumed*."
msgstr ""
#: c-api/unicode.rst:962
msgid ""
"Encode the :c:type:`Py_UNICODE` buffer of the given *size* using MBCS and "
"return a Python string object. Return *NULL* if an exception was raised by "
"the codec."
msgstr ""
#: c-api/unicode.rst:972
msgid ""
"Encode a Unicode object using MBCS and return the result as Python string "
"object. Error handling is \"strict\". Return *NULL* if an exception was "
"raised by the codec."
msgstr ""
#: c-api/unicode.rst:978
msgid "Methods & Slots"
msgstr ""
#: c-api/unicode.rst:983
msgid "Methods and Slot Functions"
msgstr ""
#: c-api/unicode.rst:985
msgid ""
"The following APIs are capable of handling Unicode objects and strings on "
"input (we refer to them as strings in the descriptions) and return Unicode "
"objects or integers as appropriate."
msgstr ""
#: c-api/unicode.rst:989
msgid "They all return *NULL* or ``-1`` if an exception occurs."
msgstr ""
#: c-api/unicode.rst:994
msgid "Concat two strings giving a new Unicode string."
msgstr ""
#: c-api/unicode.rst:999
msgid ""
"Split a string giving a list of Unicode strings. If *sep* is *NULL*, "
"splitting will be done at all whitespace substrings. Otherwise, splits "
"occur at the given separator. At most *maxsplit* splits will be done. If "
"negative, no limit is set. Separators are not included in the resulting "
"list."
msgstr ""
#: c-api/unicode.rst:1004
msgid ""
"This function used an :c:type:`int` type for *maxsplit*. This might require "
"changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/unicode.rst:1011
msgid ""
"Split a Unicode string at line breaks, returning a list of Unicode strings. "
"CRLF is considered to be one line break. If *keepend* is 0, the Line break "
"characters are not included in the resulting strings."
msgstr ""
#: c-api/unicode.rst:1018
msgid ""
"Translate a string by applying a character mapping table to it and return "
"the resulting Unicode object."
msgstr ""
#: c-api/unicode.rst:1021
msgid ""
"The mapping table must map Unicode ordinal integers to Unicode ordinal "
"integers or None (causing deletion of the character)."
msgstr ""
#: c-api/unicode.rst:1028
msgid ""
"*errors* has the usual meaning for codecs. It may be *NULL* which indicates "
"to use the default error handling."
msgstr ""
#: c-api/unicode.rst:1034
msgid ""
"Join a sequence of strings using the given *separator* and return the "
"resulting Unicode string."
msgstr ""
#: c-api/unicode.rst:1040
msgid ""
"Return 1 if *substr* matches ``str[start:end]`` at the given tail end "
"(*direction* == -1 means to do a prefix match, *direction* == 1 a suffix "
"match), 0 otherwise. Return ``-1`` if an error occurred."
msgstr ""
#: c-api/unicode.rst:1044 c-api/unicode.rst:1058
msgid ""
"This function used an :c:type:`int` type for *start* and *end*. This might "
"require changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/unicode.rst:1052
msgid ""
"Return the first position of *substr* in ``str[start:end]`` using the given "
"*direction* (*direction* == 1 means to do a forward search, *direction* == "
"-1 a backward search). The return value is the index of the first match; a "
"value of ``-1`` indicates that no match was found, and ``-2`` indicates that "
"an error occurred and an exception has been set."
msgstr ""
#: c-api/unicode.rst:1066
msgid ""
"Return the number of non-overlapping occurrences of *substr* in ``str[start:"
"end]``. Return ``-1`` if an error occurred."
msgstr ""
#: c-api/unicode.rst:1069
msgid ""
"This function returned an :c:type:`int` type and used an :c:type:`int` type "
"for *start* and *end*. This might require changes in your code for properly "
"supporting 64-bit systems."
msgstr ""
#: c-api/unicode.rst:1077
msgid ""
"Replace at most *maxcount* occurrences of *substr* in *str* with *replstr* "
"and return the resulting Unicode object. *maxcount* == -1 means replace all "
"occurrences."
msgstr ""
#: c-api/unicode.rst:1081
msgid ""
"This function used an :c:type:`int` type for *maxcount*. This might require "
"changes in your code for properly supporting 64-bit systems."
msgstr ""
#: c-api/unicode.rst:1088
msgid ""
"Compare two strings and return -1, 0, 1 for less than, equal, and greater "
"than, respectively."
msgstr ""
#: c-api/unicode.rst:1094
msgid "Rich compare two unicode strings and return one of the following:"
msgstr ""
#: c-api/unicode.rst:1096
msgid "``NULL`` in case an exception was raised"
msgstr ""
#: c-api/unicode.rst:1097
msgid ":const:`Py_True` or :const:`Py_False` for successful comparisons"
msgstr ""
#: c-api/unicode.rst:1098
msgid ":const:`Py_NotImplemented` in case the type combination is unknown"
msgstr ""
#: c-api/unicode.rst:1100
msgid ""
"Note that :const:`Py_EQ` and :const:`Py_NE` comparisons can cause a :exc:"
"`UnicodeWarning` in case the conversion of the arguments to Unicode fails "
"with a :exc:`UnicodeDecodeError`."
msgstr ""
#: c-api/unicode.rst:1104
msgid ""
"Possible values for *op* are :const:`Py_GT`, :const:`Py_GE`, :const:"
"`Py_EQ`, :const:`Py_NE`, :const:`Py_LT`, and :const:`Py_LE`."
msgstr ""
#: c-api/unicode.rst:1110
msgid ""
"Return a new string object from *format* and *args*; this is analogous to "
"``format % args``."
msgstr ""
#: c-api/unicode.rst:1116
msgid ""
"Check whether *element* is contained in *container* and return true or false "
"accordingly."
msgstr ""
#: c-api/unicode.rst:1119
msgid ""
"*element* has to coerce to a one element Unicode string. ``-1`` is returned "
"if there was an error."
msgstr ""
#: c-api/utilities.rst:8
msgid "Utilities"
msgstr "Utilitaires"
#: c-api/utilities.rst:10
msgid ""
"The functions in this chapter perform various utility tasks, ranging from "
"helping C code be more portable across platforms, using Python modules from "
"C, and parsing function arguments and constructing Python values from C "
"values."
msgstr ""
#: c-api/veryhigh.rst:8
msgid "The Very High Level Layer"
msgstr ""
#: c-api/veryhigh.rst:10
msgid ""
"The functions in this chapter will let you execute Python source code given "
"in a file or a buffer, but they will not let you interact in a more detailed "
"way with the interpreter."
msgstr ""
#: c-api/veryhigh.rst:14
msgid ""
"Several of these functions accept a start symbol from the grammar as a "
"parameter. The available start symbols are :const:`Py_eval_input`, :const:"
"`Py_file_input`, and :const:`Py_single_input`. These are described "
"following the functions which accept them as parameters."
msgstr ""
#: c-api/veryhigh.rst:19
msgid ""
"Note also that several of these functions take :c:type:`FILE\\*` "
"parameters. One particular issue which needs to be handled carefully is "
"that the :c:type:`FILE` structure for different C libraries can be different "
"and incompatible. Under Windows (at least), it is possible for dynamically "
"linked extensions to actually use different libraries, so care should be "
"taken that :c:type:`FILE\\*` parameters are only passed to these functions "
"if it is certain that they were created by the same library that the Python "
"runtime is using."
msgstr ""
#: c-api/veryhigh.rst:30
msgid ""
"The main program for the standard interpreter. This is made available for "
"programs which embed Python. The *argc* and *argv* parameters should be "
"prepared exactly as those which are passed to a C program's :c:func:`main` "
"function. It is important to note that the argument list may be modified "
"(but the contents of the strings pointed to by the argument list are not). "
"The return value will be ``0`` if the interpreter exits normally (ie, "
"without an exception), ``1`` if the interpreter exits due to an exception, "
"or ``2`` if the parameter list does not represent a valid Python command "
"line."
msgstr ""
#: c-api/veryhigh.rst:39
msgid ""
"Note that if an otherwise unhandled :exc:`SystemExit` is raised, this "
"function will not return ``1``, but exit the process, as long as "
"``Py_InspectFlag`` is not set."
msgstr ""
#: c-api/veryhigh.rst:46
msgid ""
"This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, "
"leaving *closeit* set to ``0`` and *flags* set to *NULL*."
msgstr ""
#: c-api/veryhigh.rst:52
msgid ""
"This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, "
"leaving the *closeit* argument set to ``0``."
msgstr ""
#: c-api/veryhigh.rst:58
msgid ""
"This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, "
"leaving the *flags* argument set to *NULL*."
msgstr ""
#: c-api/veryhigh.rst:64
msgid ""
"If *fp* refers to a file associated with an interactive device (console or "
"terminal input or Unix pseudo-terminal), return the value of :c:func:"
"`PyRun_InteractiveLoop`, otherwise return the result of :c:func:"
"`PyRun_SimpleFile`. If *filename* is *NULL*, this function uses ``\"???\"`` "
"as the filename."
msgstr ""
#: c-api/veryhigh.rst:73
msgid ""
"This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below, "
"leaving the *PyCompilerFlags\\** argument set to NULL."
msgstr ""
#: c-api/veryhigh.rst:79
msgid ""
"Executes the Python source code from *command* in the :mod:`__main__` module "
"according to the *flags* argument. If :mod:`__main__` does not already "
"exist, it is created. Returns ``0`` on success or ``-1`` if an exception "
"was raised. If there was an error, there is no way to get the exception "
"information. For the meaning of *flags*, see below."
msgstr ""
#: c-api/veryhigh.rst:85
msgid ""
"Note that if an otherwise unhandled :exc:`SystemExit` is raised, this "
"function will not return ``-1``, but exit the process, as long as "
"``Py_InspectFlag`` is not set."
msgstr ""
#: c-api/veryhigh.rst:92
msgid ""
"This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, "
"leaving *closeit* set to ``0`` and *flags* set to *NULL*."
msgstr ""
#: c-api/veryhigh.rst:98
msgid ""
"This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, "
"leaving *closeit* set to ``0``."
msgstr ""
#: c-api/veryhigh.rst:104
msgid ""
"This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, "
"leaving *flags* set to *NULL*."
msgstr ""
#: c-api/veryhigh.rst:110
msgid ""
"Similar to :c:func:`PyRun_SimpleStringFlags`, but the Python source code is "
"read from *fp* instead of an in-memory string. *filename* should be the name "
"of the file. If *closeit* is true, the file is closed before "
"PyRun_SimpleFileExFlags returns."
msgstr ""
#: c-api/veryhigh.rst:118
msgid ""
"This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below, "
"leaving *flags* set to *NULL*."
msgstr ""
#: c-api/veryhigh.rst:124
msgid ""
"Read and execute a single statement from a file associated with an "
"interactive device according to the *flags* argument. The user will be "
"prompted using ``sys.ps1`` and ``sys.ps2``. Returns ``0`` when the input "
"was executed successfully, ``-1`` if there was an exception, or an error "
"code from the :file:`errcode.h` include file distributed as part of Python "
"if there was a parse error. (Note that :file:`errcode.h` is not included "
"by :file:`Python.h`, so must be included specifically if needed.)"
msgstr ""
#: c-api/veryhigh.rst:135
msgid ""
"This is a simplified interface to :c:func:`PyRun_InteractiveLoopFlags` "
"below, leaving *flags* set to *NULL*."
msgstr ""
#: c-api/veryhigh.rst:141
msgid ""
"Read and execute statements from a file associated with an interactive "
"device until EOF is reached. The user will be prompted using ``sys.ps1`` "
"and ``sys.ps2``. Returns ``0`` at EOF."
msgstr ""
#: c-api/veryhigh.rst:148
msgid ""
"This is a simplified interface to :c:func:"
"`PyParser_SimpleParseStringFlagsFilename` below, leaving *filename* set to "
"*NULL* and *flags* set to ``0``."
msgstr ""
#: c-api/veryhigh.rst:155
msgid ""
"This is a simplified interface to :c:func:"
"`PyParser_SimpleParseStringFlagsFilename` below, leaving *filename* set to "
"*NULL*."
msgstr ""
#: c-api/veryhigh.rst:162
msgid ""
"Parse Python source code from *str* using the start token *start* according "
"to the *flags* argument. The result can be used to create a code object "
"which can be evaluated efficiently. This is useful if a code fragment must "
"be evaluated many times."
msgstr ""
#: c-api/veryhigh.rst:170
msgid ""
"This is a simplified interface to :c:func:`PyParser_SimpleParseFileFlags` "
"below, leaving *flags* set to ``0``."
msgstr ""
#: c-api/veryhigh.rst:176
msgid ""
"Similar to :c:func:`PyParser_SimpleParseStringFlagsFilename`, but the Python "
"source code is read from *fp* instead of an in-memory string."
msgstr ""
#: c-api/veryhigh.rst:182
msgid ""
"This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving "
"*flags* set to *NULL*."
msgstr ""
#: c-api/veryhigh.rst:188
msgid ""
"Execute Python source code from *str* in the context specified by the "
"dictionaries *globals* and *locals* with the compiler flags specified by "
"*flags*. The parameter *start* specifies the start token that should be "
"used to parse the source code."
msgstr ""
#: c-api/veryhigh.rst:193
msgid ""
"Returns the result of executing the code as a Python object, or *NULL* if an "
"exception was raised."
msgstr ""
#: c-api/veryhigh.rst:199
msgid ""
"This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving "
"*closeit* set to ``0`` and *flags* set to *NULL*."
msgstr ""
#: c-api/veryhigh.rst:205
msgid ""
"This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving "
"*flags* set to *NULL*."
msgstr ""
#: c-api/veryhigh.rst:211
msgid ""
"This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving "
"*closeit* set to ``0``."
msgstr ""
#: c-api/veryhigh.rst:217
msgid ""
"Similar to :c:func:`PyRun_StringFlags`, but the Python source code is read "
"from *fp* instead of an in-memory string. *filename* should be the name of "
"the file. If *closeit* is true, the file is closed before :c:func:"
"`PyRun_FileExFlags` returns."
msgstr ""
#: c-api/veryhigh.rst:225
msgid ""
"This is a simplified interface to :c:func:`Py_CompileStringFlags` below, "
"leaving *flags* set to *NULL*."
msgstr ""
#: c-api/veryhigh.rst:231
msgid ""
"Parse and compile the Python source code in *str*, returning the resulting "
"code object. The start token is given by *start*; this can be used to "
"constrain the code which can be compiled and should be :const:"
"`Py_eval_input`, :const:`Py_file_input`, or :const:`Py_single_input`. The "
"filename specified by *filename* is used to construct the code object and "
"may appear in tracebacks or :exc:`SyntaxError` exception messages. This "
"returns *NULL* if the code cannot be parsed or compiled."
msgstr ""
#: c-api/veryhigh.rst:242
msgid ""
"This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just the "
"code object, and the dictionaries of global and local variables. The other "
"arguments are set to *NULL*."
msgstr ""
#: c-api/veryhigh.rst:249
msgid ""
"Evaluate a precompiled code object, given a particular environment for its "
"evaluation. This environment consists of dictionaries of global and local "
"variables, arrays of arguments, keywords and defaults, and a closure tuple "
"of cells."
msgstr ""
#: c-api/veryhigh.rst:257
msgid ""
"Evaluate an execution frame. This is a simplified interface to "
"PyEval_EvalFrameEx, for backward compatibility."
msgstr ""
#: c-api/veryhigh.rst:263
msgid ""
"This is the main, unvarnished function of Python interpretation. It is "
"literally 2000 lines long. The code object associated with the execution "
"frame *f* is executed, interpreting bytecode and executing calls as needed. "
"The additional *throwflag* parameter can mostly be ignored - if true, then "
"it causes an exception to immediately be thrown; this is used for the :meth:"
"`~generator.throw` methods of generator objects."
msgstr ""
#: c-api/veryhigh.rst:273
msgid ""
"This function changes the flags of the current evaluation frame, and returns "
"true on success, false on failure."
msgstr ""
#: c-api/veryhigh.rst:281
msgid ""
"The start symbol from the Python grammar for isolated expressions; for use "
"with :c:func:`Py_CompileString`."
msgstr ""
#: c-api/veryhigh.rst:289
msgid ""
"The start symbol from the Python grammar for sequences of statements as read "
"from a file or other source; for use with :c:func:`Py_CompileString`. This "
"is the symbol to use when compiling arbitrarily long Python source code."
msgstr ""
#: c-api/veryhigh.rst:298
msgid ""
"The start symbol from the Python grammar for a single statement; for use "
"with :c:func:`Py_CompileString`. This is the symbol used for the interactive "
"interpreter loop."
msgstr ""
#: c-api/veryhigh.rst:305
msgid ""
"This is the structure used to hold compiler flags. In cases where code is "
"only being compiled, it is passed as ``int flags``, and in cases where code "
"is being executed, it is passed as ``PyCompilerFlags *flags``. In this "
"case, ``from __future__ import`` can modify *flags*."
msgstr ""
#: c-api/veryhigh.rst:310
msgid ""
"Whenever ``PyCompilerFlags *flags`` is *NULL*, :attr:`cf_flags` is treated "
"as equal to ``0``, and any modification due to ``from __future__ import`` is "
"discarded. ::"
msgstr ""
#: c-api/veryhigh.rst:321
msgid ""
"This bit can be set in *flags* to cause division operator ``/`` to be "
"interpreted as \"true division\" according to :pep:`238`."
msgstr ""
#: c-api/weakref.rst:6
msgid "Weak Reference Objects"
msgstr ""
#: c-api/weakref.rst:8
msgid ""
"Python supports *weak references* as first-class objects. There are two "
"specific object types which directly implement weak references. The first "
"is a simple reference object, and the second acts as a proxy for the "
"original object as much as it can."
msgstr ""
#: c-api/weakref.rst:16
msgid "Return true if *ob* is either a reference or proxy object."
msgstr ""
#: c-api/weakref.rst:23
msgid "Return true if *ob* is a reference object."
msgstr ""
#: c-api/weakref.rst:30
msgid "Return true if *ob* is a proxy object."
msgstr ""
#: c-api/weakref.rst:37
msgid ""
"Return a weak reference object for the object *ob*. This will always return "
"a new reference, but is not guaranteed to create a new object; an existing "
"reference object may be returned. The second parameter, *callback*, can be "
"a callable object that receives notification when *ob* is garbage collected; "
"it should accept a single parameter, which will be the weak reference object "
"itself. *callback* may also be ``None`` or *NULL*. If *ob* is not a weakly-"
"referencable object, or if *callback* is not callable, ``None``, or *NULL*, "
"this will return *NULL* and raise :exc:`TypeError`."
msgstr ""
#: c-api/weakref.rst:51
msgid ""
"Return a weak reference proxy object for the object *ob*. This will always "
"return a new reference, but is not guaranteed to create a new object; an "
"existing proxy object may be returned. The second parameter, *callback*, "
"can be a callable object that receives notification when *ob* is garbage "
"collected; it should accept a single parameter, which will be the weak "
"reference object itself. *callback* may also be ``None`` or *NULL*. If *ob* "
"is not a weakly-referencable object, or if *callback* is not callable, "
"``None``, or *NULL*, this will return *NULL* and raise :exc:`TypeError`."
msgstr ""
#: c-api/weakref.rst:65
msgid ""
"Return the referenced object from a weak reference, *ref*. If the referent "
"is no longer live, returns :const:`Py_None`."
msgstr ""
#: c-api/weakref.rst:72
msgid ""
"This function returns a **borrowed reference** to the referenced object. "
"This means that you should always call :c:func:`Py_INCREF` on the object "
"except if you know that it cannot be destroyed while you are still using it."
msgstr ""
#: c-api/weakref.rst:80
msgid ""
"Similar to :c:func:`PyWeakref_GetObject`, but implemented as a macro that "
"does no error checking."
msgstr ""
#~ msgid "See also"
#~ msgstr "Voir aussi"
#~ msgid "To allocate and create extension modules."
#~ msgstr "Allouer et créer des modules d'extension."
#~ msgid "Parsing arguments"
#~ msgstr "Analyse des arguments"
#~ msgid "Strings and buffers"
#~ msgstr "Chaînes et tampons"
#~ msgid "Unless otherwise stated, buffers are not NUL-terminated."
#~ msgstr "Sauf indication contraire, les tampons ne se terminent pas par NUL."
#~ msgid ""
#~ "This format does not accept bytes-like objects. If you want to accept "
#~ "filesystem paths and convert them to C character strings, it is "
#~ "preferrable to use the ``O&`` format with :cfunc:`PyUnicode_FSConverter` "
#~ "as *converter*."
#~ msgstr ""
#~ "Ce format n'accepte pas les objets de type octets. Si vous voulez "
#~ "accepter des chemins de fichiers et les convertir en chaînes de "
#~ "caractères C, il vaut mieux utiliser le format ``O&`` avec :cfunc:"
#~ "`PyUnicode_FSConverter` comme *convertisseur*."
#~ msgid ""
#~ "This format accepts Unicode objects as well as objects supporting the "
#~ "buffer protocol. It fills a :ctype:`Py_buffer` structure provided by the "
#~ "caller. In this case the resulting C string may contain embedded NUL "
#~ "bytes. Unicode objects are converted to C strings using ``'utf-8'`` "
#~ "encoding."
#~ msgstr ""
#~ "Ce format accepte aussi bien les objets Unicode que des objets supportant "
#~ "le protocole de mémoire tampon.Il remplit une structure :ctype:"
#~ "`Py_buffer` fournie par l'appelant. Dans ce cas, La chaîne C qui en "
#~ "résulte peut contenir des octets NUL. Les objets Unicode sont convertis "
#~ "en chaînes C en utilisant un encodage ``'utf-8' ``."
#~ msgid ""
#~ "Like ``s*``, except that it doesn't accept mutable buffer-like objects "
#~ "such as :class:`bytearray`. The result is stored into two C variables, "
#~ "the first one a pointer to a C string, the second one its length. The "
#~ "string may contain embedded null bytes. Unicode objects are converted to "
#~ "C strings using ``'utf-8'`` encoding."
#~ msgstr ""
#~ "Comme ``s*``, excepté qu'il n'accepte pas d'objets de type tampons "
#~ "mutables, comme :class:`bytearray`. Le résultat est stocké dans deux "
#~ "variables C, la première étant un pointeur sur une chaîne de caractères "
#~ "C, la seconde étant sa longueur. La chaîne de caractère peut contenir des "
#~ "octets nuls. Les objets Unicode sont convertis en chaînes de caractères C "
#~ "avec l'encodage ``'utf-8'``."
#~ msgid ""
#~ "Like ``s*``, but the Python object may also be ``None``, in which case "
#~ "the ``buf`` member of the :ctype:`Py_buffer` structure is set to *NULL*."
#~ msgstr ""
#~ "Comme ``s*``, mais l'objet Python peut aussi être ``None``, dans ce cas "
#~ "le champ ``buf`` de la structure :ctype:`Py_buffer` est définie à *NULL*."
#~ msgid ""
#~ "Like ``s#``, but the Python object may also be ``None``, in which case "
#~ "the C pointer is set to *NULL*."
#~ msgstr ""
#~ "Comme ``s#``, mais l'objet Python peut également être ``None``, dans ce "
#~ "cas le pointeur C est définie à *NULL*."
#~ msgid ""
#~ "This format converts a bytes-like object to a C pointer to a character "
#~ "string; it does not accept Unicode objects. The bytes buffer must not "
#~ "contain embedded NUL bytes; if it does, a :exc:`TypeError` exception is "
#~ "raised."
#~ msgstr ""
#~ "Ce format converti un objet contenant des octets en un pointeur C sur une "
#~ "chaîne de caractères, il n'accepte pas d'objets Unicode. Le buffer ne "
#~ "doit pas contenir d'octets NUL ; s'il en contient, une exception :exc:"
#~ "`TypeError` sera levée."
#~ msgid ""
#~ "This variant on ``s*`` doesn't accept Unicode objects, only objects "
#~ "supporting the buffer protocol. **This is the recommended way to accept "
#~ "binary data.**"
#~ msgstr ""
#~ "Cette variante sur ``s*`` n'accepte pas d'objets Unicode, seulement des "
#~ "objets supportant le protocole buffer. **C'est le moyen recommandé pour "
#~ "accepter des données binaires.**"
#~ msgid ""
#~ "This variant on ``s#`` doesn't accept Unicode objects, only bytes-like "
#~ "objects."
#~ msgstr ""
#~ "Cette variante de ``s#`` n'accepte pas les objets Unicode, uniquement des "
#~ "objets assimilés à des octets."
#~ msgid ""
#~ "Requires that the Python object is a :class:`bytes` object, without "
#~ "attempting any conversion. Raises :exc:`TypeError` if the object is not "
#~ "a bytes object. The C variable may also be declared as :ctype:`PyObject"
#~ "\\*`."
#~ msgstr ""
#~ "Nécessite que l'objet Python soit un objet class:`bytes`, sans tenter de "
#~ "faire aucune conversion au préalable. Si l'objet n'est pas un objet de "
#~ "type octets, une exception :exc:`TypeError` sera levée. La variable C "
#~ "peut également être de type :ctype:`PyObject\\*`."
#~ msgid ""
#~ "Requires that the Python object is a :class:`bytearray` object, without "
#~ "attempting any conversion. Raises :exc:`TypeError` if the object is not "
#~ "a :class:`bytearray` object. The C variable may also be declared as :"
#~ "ctype:`PyObject\\*`."
#~ msgstr ""
#~ "Nécessite que l'objet Python soit un objet :class:`bytearray`, sans "
#~ "tenter de faire aucune conversion. Si l'objet n'est pas un objet de type :"
#~ "class:`bytearray`, une exception :exc:`TypeError` sera levée. La variable "
#~ "C peut aussi être de type :ctype:`PyObject\\*`."
#~ msgid ""
#~ "Convert a Python Unicode object to a C pointer to a NUL-terminated buffer "
#~ "of Unicode characters. You must pass the address of a :ctype:"
#~ "`Py_UNICODE` pointer variable, which will be filled with the pointer to "
#~ "an existing Unicode buffer. Please note that the width of a :ctype:"
#~ "`Py_UNICODE` character depends on compilation options (it is either 16 or "
#~ "32 bits). The Python string must not contain embedded NUL characters; if "
#~ "it does, a :exc:`TypeError` exception is raised."
#~ msgstr ""
#~ "Converti un objet Python Unicode en un pointeur C sur un tampon terminé "
#~ "par NUL de caractères Unicode. Vous devez fournir l'adresse d'une "
#~ "variable pointant sur un :ctype:`Py_UNICODE`, qui sera rempli avec le "
#~ "pointeur sur un tampon Unicode existant. Notez que la taille d'un "
#~ "caractère :ctype:`Py_UNICODE` dépend des options choisies à la "
#~ "compilation (16 ou 32 bits). La chaîne de caractères Python ne doit pas "
#~ "contenir de caractères NUL, sinon une exception :exc:`TypeError` sera "
#~ "levée."
#~ msgid ""
#~ "Since ``u`` doesn't give you back the length of the string, and it may "
#~ "contain embedded NUL characters, it is recommended to use ``u#`` or ``U`` "
#~ "instead."
#~ msgstr ""
#~ "Comme ``u`` ne vous donne pas en retour la longueur de la chaîne, et "
#~ "comme il peut contenir des caractères NUL, il est recommandé d'utiliser à "
#~ "la place ``u#`` ou ``U``."
#~ msgid ""
#~ "Like ``u``, but the Python object may also be ``None``, in which case "
#~ "the :ctype:`Py_UNICODE` pointer is set to *NULL*."
#~ msgstr ""
#~ "Comme ``u``, mais l'objet Python peut aussi être ``None``, auquel cas le "
#~ "pointeur :ctype:`Py_UNICODE` est fixé à *NULL*."
#~ msgid ""
#~ "Like ``u#``, but the Python object may also be ``None``, in which case "
#~ "the :ctype:`Py_UNICODE` pointer is set to *NULL*."
#~ msgstr ""
#~ "Comme ``u#``, mais l'objet Python peut également être ``None``, auquel "
#~ "cas le pointeur :ctype:`Py_UNICODE` est fixé à *NULL*."
#~ msgid ""
#~ "This format accepts any object which implements the read-write buffer "
#~ "interface. It fills a :ctype:`Py_buffer` structure provided by the "
#~ "caller. The buffer may contain embedded null bytes. The caller have to "
#~ "call :cfunc:`PyBuffer_Release` when it is done with the buffer."
#~ msgstr ""
#~ "Ce format accepte n'importe quel objet qui implémente l'interface de "
#~ "mémoire tampon en lecture/écriture. Il remplit une structure :ctype:"
#~ "`Py_buffer` fournie par l'appelant. Le tampon peut contenir des octets "
#~ "nuls. L'appelant doit appeler :cfunc:`PyBuffer_Release` quand il n'a plus "
#~ "l'usage du tampon."
#~ msgid ""
#~ "Convert a Python byte, represented as a :class:`bytes` object of length "
#~ "1, to a C :ctype:`char`."
#~ msgstr ""
#~ "Convertit un octet Python, représenté comme un objet :class:`bytes` de "
#~ "longueur 1, en un type C :ctype:`char`."
#~ msgid "status = converter(object, address);"
#~ msgstr "status = conversion(objet, adresse);"
#~ msgid ""
#~ "If the *converter* returns Py_CLEANUP_SUPPORTED, it may get called a "
#~ "second time if the argument parsing eventually fails, giving the "
#~ "converter a chance to release any memory that it had already allocated. "
#~ "In this second call, the *object* parameter will be NULL; *address* will "
#~ "have the same value as in the original call."
#~ msgstr ""
#~ "Si la fonction de *conversion* retourne Py_CLEANUP_SUPPORTED, elle peut "
#~ "être appelée une seconde fois si l'analyse des arguments échoue, donnant "
#~ "ainsi à la fonction de conversion la possibilité de libérer la mémoire "
#~ "qu'elle avait allouée précédemment. Dans ce second appel, le paramètre "
#~ "correspondant à l'*objet* sera NULL; *adresse* aura la même valeur que "
#~ "dans le premier appel."
#~ msgid "Building values"
#~ msgstr "Construction des valeurs"
#~ msgid "Buffer Objects"
#~ msgstr "Les objets tampons"