|
Original |
Translation |
|
64
|
|
|
|
65
|
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*.
|
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*.
|
|
66
|
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 :ctype:`PyObject\*`) into which the object pointer is stored. If the Python object does not have the required type, :exc:`TypeError` is raised.
|
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.
|
|
67
|
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 :ctype:`void \*`. The *converter* function in turn is called as follows::
|
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 :
|
|
68
|
status = converter(object, address);
|
status = conversion(objet, adresse);
|
|
69
|
|
70
|
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.
|
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.
|
|
71
|
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.
|
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.
|
|
72
|
It is possible to pass "long" integers (integers whose value exceeds the platform's :const:`LONG_MAX`) 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).
|
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).
|
|
73
|
A few other characters have a meaning in a format string. These may not occur inside nested parentheses. They are:
|
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 :
|