Backport from 3.8

This commit is contained in:
Julien Palard 2019-12-06 14:20:08 +01:00
parent 6773f3a655
commit 39b024f83c
48 changed files with 4814 additions and 602 deletions

View File

@ -529,7 +529,7 @@ msgstr ""
#: ../Doc/c-api/buffer.rst:321 #: ../Doc/c-api/buffer.rst:321
msgid "format" msgid "format"
msgstr "" msgstr "format"
#: ../Doc/c-api/buffer.rst:323 ../Doc/c-api/buffer.rst:325 #: ../Doc/c-api/buffer.rst:323 ../Doc/c-api/buffer.rst:325
#: ../Doc/c-api/buffer.rst:327 ../Doc/c-api/buffer.rst:329 #: ../Doc/c-api/buffer.rst:327 ../Doc/c-api/buffer.rst:329

View File

@ -18,7 +18,7 @@ msgstr ""
#: ../Doc/distutils/packageindex.rst:9 #: ../Doc/distutils/packageindex.rst:9
msgid "The Python Package Index (PyPI)" msgid "The Python Package Index (PyPI)"
msgstr "" msgstr "L'index de paquets Python (*Python Package Index* : PyPI)"
#: ../Doc/distutils/packageindex.rst:11 #: ../Doc/distutils/packageindex.rst:11
msgid "" msgid ""

View File

@ -380,7 +380,7 @@ msgstr ""
#: ../Doc/distutils/setupscript.rst:335 #: ../Doc/distutils/setupscript.rst:335
msgid "Other options" msgid "Other options"
msgstr "" msgstr "Autres options"
#: ../Doc/distutils/setupscript.rst:337 #: ../Doc/distutils/setupscript.rst:337
msgid "" msgid ""

View File

@ -563,13 +563,16 @@ msgstr ""
#: ../Doc/extending/extending.rst:305 #: ../Doc/extending/extending.rst:305
msgid "The Module's Method Table and Initialization Function" msgid "The Module's Method Table and Initialization Function"
msgstr "" msgstr "La fonction d'initialisation et le tableau des méthodes du module"
#: ../Doc/extending/extending.rst:307 #: ../Doc/extending/extending.rst:307
msgid "" msgid ""
"I promised to show how :c:func:`spam_system` is called from Python programs. " "I promised to show how :c:func:`spam_system` is called from Python programs. "
"First, we need to list its name and address in a \"method table\"::" "First, we need to list its name and address in a \"method table\"::"
msgstr "" msgstr ""
"Nous avons promis de montrer comment :c:func:`spam_system` est appelée "
"depuis les programmes Python. D'abord, nous avons besoin d'avoir son nom et "
"son adresse dans un « tableau des méthodes » ::"
#: ../Doc/extending/extending.rst:318 #: ../Doc/extending/extending.rst:318
msgid "" msgid ""
@ -579,6 +582,11 @@ msgid ""
"value of ``0`` means that an obsolete variant of :c:func:`PyArg_ParseTuple` " "value of ``0`` means that an obsolete variant of :c:func:`PyArg_ParseTuple` "
"is used." "is used."
msgstr "" msgstr ""
"Notez la troisième entrée (``METH_VARARGS``). C'est un indicateur du type de "
"convention à utiliser pour la fonction C, à destination de l'interpréteur. "
"Il doit valoir normalement ``METH_VARARGS`` ou ``METH_VARARGS | "
"METH_KEYWORDS`` ; la valeur ``0`` indique qu'une variante obsolète de :c:"
"func:`PyArg_ParseTuple` est utilisée."
#: ../Doc/extending/extending.rst:323 #: ../Doc/extending/extending.rst:323
msgid "" msgid ""
@ -586,6 +594,10 @@ msgid ""
"level parameters to be passed in as a tuple acceptable for parsing via :c:" "level parameters to be passed in as a tuple acceptable for parsing via :c:"
"func:`PyArg_ParseTuple`; more information on this function is provided below." "func:`PyArg_ParseTuple`; more information on this function is provided below."
msgstr "" msgstr ""
"Si seulement ``METH_VARARGS`` est utilisé, la fonction s'attend à ce que les "
"paramètres Python soient passés comme un n-uplet que l'on peut analyser "
"*via* :c:func:`PyArg_ParseTuple` ; des informations supplémentaires sont "
"fournies plus bas."
#: ../Doc/extending/extending.rst:327 #: ../Doc/extending/extending.rst:327
msgid "" msgid ""
@ -595,11 +607,18 @@ msgid ""
"keywords. Use :c:func:`PyArg_ParseTupleAndKeywords` to parse the arguments " "keywords. Use :c:func:`PyArg_ParseTupleAndKeywords` to parse the arguments "
"to such a function." "to such a function."
msgstr "" msgstr ""
"Le bit :const:`METH_KEYWORDS` peut être mis à un dans le troisième champ si "
"des arguments par mot-clés doivent être passés à la fonction. Dans ce cas, "
"la fonction C doit accepter un troisième paramètre ``PyObject *`` qui est un "
"dictionnaire des mots-clés. Utilisez :c:func:`PyArg_ParseTupleAndKeywords` "
"pour analyser les arguments d'une telle fonction."
#: ../Doc/extending/extending.rst:333 #: ../Doc/extending/extending.rst:333
msgid "" msgid ""
"The method table must be referenced in the module definition structure::" "The method table must be referenced in the module definition structure::"
msgstr "" msgstr ""
"Le tableau des méthodes doit être référencé dans la structure de définition "
"du module ::"
#: ../Doc/extending/extending.rst:344 #: ../Doc/extending/extending.rst:344
msgid "" msgid ""

View File

@ -30,10 +30,15 @@ msgid ""
"exceptions and even new types in C. This is explained in the document :ref:" "exceptions and even new types in C. This is explained in the document :ref:"
"`extending-index`." "`extending-index`."
msgstr "" msgstr ""
"Oui, vous pouvez créer des modules intégrés contenant des fonctions, des "
"variables, des exceptions et même de nouveaux types en C. Ceci est expliqué "
"dans le document :ref:`extending-index`."
#: ../Doc/faq/extending.rst:22 #: ../Doc/faq/extending.rst:22
msgid "Most intermediate or advanced Python books will also cover this topic." msgid "Most intermediate or advanced Python books will also cover this topic."
msgstr "" msgstr ""
"La plupart des livres Python intermédiaires ou avancés couvrent également ce "
"sujet."
#: ../Doc/faq/extending.rst:26 #: ../Doc/faq/extending.rst:26
msgid "Can I create my own functions in C++?" msgid "Can I create my own functions in C++?"
@ -72,6 +77,11 @@ msgid ""
"Cython and Pyrex make it possible to write an extension without having to " "Cython and Pyrex make it possible to write an extension without having to "
"learn Python's C API." "learn Python's C API."
msgstr "" msgstr ""
"`Cython <http://cython.org>`_ et son cousin `Pyrex <https://www.cosc."
"canterbury.ac.nz/greg.ewing/python/Pyrex/>`_ sont des compilateurs qui "
"acceptent une forme légèrement modifiée de Python et produisent du code C "
"correspondant. Cython et Pyrex permettent d'écrire une extension sans avoir "
"à connaître l'API C de Python."
#: ../Doc/faq/extending.rst:50 #: ../Doc/faq/extending.rst:50
msgid "" msgid ""
@ -87,6 +97,7 @@ msgstr ""
#: ../Doc/faq/extending.rst:61 #: ../Doc/faq/extending.rst:61
msgid "How can I execute arbitrary Python statements from C?" msgid "How can I execute arbitrary Python statements from C?"
msgstr "" msgstr ""
"Comment puis-je exécuter des instructions quelconques Python à partir de C ?"
#: ../Doc/faq/extending.rst:63 #: ../Doc/faq/extending.rst:63
msgid "" msgid ""
@ -101,6 +112,7 @@ msgstr ""
#: ../Doc/faq/extending.rst:72 #: ../Doc/faq/extending.rst:72
msgid "How can I evaluate an arbitrary Python expression from C?" msgid "How can I evaluate an arbitrary Python expression from C?"
msgstr "" msgstr ""
"Comment puis-je évaluer une expression quelconque de Python à partir de C ?"
#: ../Doc/faq/extending.rst:74 #: ../Doc/faq/extending.rst:74
msgid "" msgid ""
@ -108,10 +120,13 @@ msgid ""
"start symbol :c:data:`Py_eval_input`; it parses an expression, evaluates it " "start symbol :c:data:`Py_eval_input`; it parses an expression, evaluates it "
"and returns its value." "and returns its value."
msgstr "" msgstr ""
"Appelez la fonction :c:func:`PyRun_String` de la question précédente avec le "
"symbole de départ :c:data:`Py_eval_input` ; il analyse une expression, "
"l'évalue et renvoie sa valeur."
#: ../Doc/faq/extending.rst:80 #: ../Doc/faq/extending.rst:80
msgid "How do I extract C values from a Python object?" msgid "How do I extract C values from a Python object?"
msgstr "" msgstr "Comment puis-je extraire des donnés en C d'un objet Python ?"
#: ../Doc/faq/extending.rst:82 #: ../Doc/faq/extending.rst:82
msgid "" msgid ""
@ -120,6 +135,10 @@ msgid ""
"specified index. Lists have similar functions, :c:func:`PyListSize` and :c:" "specified index. Lists have similar functions, :c:func:`PyListSize` and :c:"
"func:`PyList_GetItem`." "func:`PyList_GetItem`."
msgstr "" msgstr ""
"Cela dépend du type d'objet. Si c'est un tuple, :c:func:`PyTuple_Size` "
"renvoie sa longueur et :c:func:`PyTuple_GetItem` renvoie l'élément à l'index "
"spécifié. Les listes ont des fonctions similaires, :c:func:`PyListSize` et :"
"c:func:`PyList_GetItem`."
#: ../Doc/faq/extending.rst:87 #: ../Doc/faq/extending.rst:87
msgid "" msgid ""
@ -128,6 +147,10 @@ msgid ""
"Note that Python bytes objects may contain null bytes so C's :c:func:" "Note that Python bytes objects may contain null bytes so C's :c:func:"
"`strlen` should not be used." "`strlen` should not be used."
msgstr "" msgstr ""
"Pour les bytes, :c:func:`PyBytes_Size` renvoie sa longueur et :c:func:"
"`PyBytes_AsStringAndSize` fournit un pointeur vers sa valeur et sa longueur. "
"Notez que les objets bytes en Python peuvent contenir des valeurs nulles, "
"c'est pourquoi il ne faut pas utiliser la fonction C :c:func:`strlen`."
#: ../Doc/faq/extending.rst:92 #: ../Doc/faq/extending.rst:92
msgid "" msgid ""
@ -145,18 +168,26 @@ msgid ""
"as many other useful protocols such as numbers (:c:func:`PyNumber_Index` et " "as many other useful protocols such as numbers (:c:func:`PyNumber_Index` et "
"al.) and mappings in the PyMapping APIs." "al.) and mappings in the PyMapping APIs."
msgstr "" msgstr ""
"Il y a aussi une API de haut niveau pour les objets Python qui est fournie "
"par l'interface dite « abstraite » — voir ``Include/abstract.h`` pour plus "
"de détails. Elle permet l'interfaçage avec tout type de séquence Python en "
"utilisant des appels tels que :c:func:`PySequence_Length`, :c:func:"
"`PySequence_GetItem`, etc. ainsi que de nombreux autres protocoles utiles "
"tels que les nombres (:c:func:`PyNumber_Index` et autres) et les "
"correspondances dans les APIs PyMapping."
#: ../Doc/faq/extending.rst:104 #: ../Doc/faq/extending.rst:104
msgid "How do I use Py_BuildValue() to create a tuple of arbitrary length?" msgid "How do I use Py_BuildValue() to create a tuple of arbitrary length?"
msgstr "" msgstr ""
"Comment utiliser Py_BuildValue() pour créer un tuple de longueur définie ?"
#: ../Doc/faq/extending.rst:106 #: ../Doc/faq/extending.rst:106
msgid "You can't. Use :c:func:`PyTuple_Pack` instead." msgid "You can't. Use :c:func:`PyTuple_Pack` instead."
msgstr "" msgstr "Vous ne pouvez pas. Utilisez :c:func:`PyTuple_Pack` à la place."
#: ../Doc/faq/extending.rst:110 #: ../Doc/faq/extending.rst:110
msgid "How do I call an object's method from C?" msgid "How do I call an object's method from C?"
msgstr "" msgstr "Comment puis-je appeler la méthode d'un objet à partir de C ?"
#: ../Doc/faq/extending.rst:112 #: ../Doc/faq/extending.rst:112
msgid "" msgid ""
@ -165,6 +196,10 @@ msgid ""
"to call, a format string like that used with :c:func:`Py_BuildValue`, and " "to call, a format string like that used with :c:func:`Py_BuildValue`, and "
"the argument values::" "the argument values::"
msgstr "" msgstr ""
"La fonction :c:func:`PyObject_CallMethod` peut être utilisée pour appeler la "
"méthode d'un objet. Les paramètres sont l'objet, le nom de la méthode à "
"appeler, une chaîne de caractères comme celle utilisée pour :c:func:"
"`Py_BuildValue` et les valeurs des arguments ::"
#: ../Doc/faq/extending.rst:121 #: ../Doc/faq/extending.rst:121
msgid "" msgid ""
@ -172,12 +207,17 @@ msgid ""
"defined. You are responsible for eventually :c:func:`Py_DECREF`\\ 'ing the " "defined. You are responsible for eventually :c:func:`Py_DECREF`\\ 'ing the "
"return value." "return value."
msgstr "" msgstr ""
"Cela fonctionne pour tous les objets qui ont des méthodes — qu'elles soient "
"intégrées ou définies par l'utilisateur. Vous êtes responsable de « :c:func:"
"`Py_DECREF`\\ *er* » la valeur de retour à la fin."
#: ../Doc/faq/extending.rst:124 #: ../Doc/faq/extending.rst:124
msgid "" msgid ""
"To call, e.g., a file object's \"seek\" method with arguments 10, 0 " "To call, e.g., a file object's \"seek\" method with arguments 10, 0 "
"(assuming the file object pointer is \"f\")::" "(assuming the file object pointer is \"f\")::"
msgstr "" msgstr ""
"Pour appeler, p. ex., la méthode *seek* d'un objet *file* avec les arguments "
"10, 0 (en supposant que le pointeur de l'objet fichier est *f*) ::"
#: ../Doc/faq/extending.rst:135 #: ../Doc/faq/extending.rst:135
msgid "" msgid ""
@ -186,12 +226,18 @@ msgid ""
"format, and to call a function with one argument, surround the argument in " "format, and to call a function with one argument, surround the argument in "
"parentheses, e.g. \"(i)\"." "parentheses, e.g. \"(i)\"."
msgstr "" msgstr ""
"Notez que :c:func:`PyObject_CallObject` veut *toujours* un tuple comme liste "
"d'arguments. Aussi, pour appeler une fonction sans arguments, utilisez "
"\"()\" pour être conforme au type et, pour appeler une fonction avec un "
"paramètre, entourez-le de parenthèses, p. ex. \"(i)\"."
#: ../Doc/faq/extending.rst:142 #: ../Doc/faq/extending.rst:142
msgid "" msgid ""
"How do I catch the output from PyErr_Print() (or anything that prints to " "How do I catch the output from PyErr_Print() (or anything that prints to "
"stdout/stderr)?" "stdout/stderr)?"
msgstr "" msgstr ""
"Comment puis-je récupérer la sortie de ``PyErr_Print()`` (ou tout ce qui "
"s'affiche sur *stdout*/*stderr*) ?"
#: ../Doc/faq/extending.rst:144 #: ../Doc/faq/extending.rst:144
msgid "" msgid ""
@ -200,22 +246,29 @@ msgid ""
"print_error, or just allow the standard traceback mechanism to work. Then, " "print_error, or just allow the standard traceback mechanism to work. Then, "
"the output will go wherever your ``write()`` method sends it." "the output will go wherever your ``write()`` method sends it."
msgstr "" msgstr ""
"Dans le code Python, définissez un objet qui possède la méthode ``write()``. "
"Affectez cet objet à :data:`sys.stdout` et :data:`sys.stderr`. Appelez "
"*print_error* ou faites simplement en sorte que le mécanisme standard de "
"remontée des erreurs fonctionne. Ensuite, la sortie sera dirigée vers "
"l'endroit où votre méthode ``write()`` écrit."
#: ../Doc/faq/extending.rst:149 #: ../Doc/faq/extending.rst:149
msgid "The easiest way to do this is to use the :class:`io.StringIO` class:" msgid "The easiest way to do this is to use the :class:`io.StringIO` class:"
msgstr "" msgstr ""
"La façon la plus simple consiste à utiliser la classe :class:`io.StringIO` :"
#: ../Doc/faq/extending.rst:161 #: ../Doc/faq/extending.rst:161
msgid "A custom object to do the same would look like this:" msgid "A custom object to do the same would look like this:"
msgstr "" msgstr ""
"Le code d'un objet à la fonctionnalité similaire ressemblerait à ceci :"
#: ../Doc/faq/extending.rst:182 #: ../Doc/faq/extending.rst:182
msgid "How do I access a module written in Python from C?" msgid "How do I access a module written in Python from C?"
msgstr "" msgstr "Comment accéder à un module écrit en Python à partir de C ?"
#: ../Doc/faq/extending.rst:184 #: ../Doc/faq/extending.rst:184
msgid "You can get a pointer to the module object as follows::" msgid "You can get a pointer to the module object as follows::"
msgstr "" msgstr "Vous pouvez obtenir un pointeur sur l'objet module comme suit ::"
#: ../Doc/faq/extending.rst:188 #: ../Doc/faq/extending.rst:188
msgid "" msgid ""
@ -225,22 +278,32 @@ msgid ""
"module into any namespace -- it only ensures it has been initialized and is " "module into any namespace -- it only ensures it has been initialized and is "
"stored in :data:`sys.modules`." "stored in :data:`sys.modules`."
msgstr "" msgstr ""
"Si le module n'a pas encore été importé (c.-à-d. qu'il n'est pas encore "
"présent dans :data:`sys.modules`), cela initialise le module ; sinon il "
"renvoie simplement la valeur de ``sys.modules[\"<modulename>\"]``. Notez "
"qu'il n'inscrit le module dans aucun espace de nommage — il s'assure "
"seulement qu'il a été initialisé et qu'il est stocké dans :data:`sys."
"modules`."
#: ../Doc/faq/extending.rst:194 #: ../Doc/faq/extending.rst:194
msgid "" msgid ""
"You can then access the module's attributes (i.e. any name defined in the " "You can then access the module's attributes (i.e. any name defined in the "
"module) as follows::" "module) as follows::"
msgstr "" msgstr ""
"Vous pouvez alors accéder aux attributs du module (c.-à-d. à tout nom défini "
"dans le module) comme suit ::"
#: ../Doc/faq/extending.rst:199 #: ../Doc/faq/extending.rst:199
msgid "" msgid ""
"Calling :c:func:`PyObject_SetAttrString` to assign to variables in the " "Calling :c:func:`PyObject_SetAttrString` to assign to variables in the "
"module also works." "module also works."
msgstr "" msgstr ""
"Appeler :c:func:`PyObject_SetAttrString` pour assigner des valeurs aux "
"variables du module fonctionne également."
#: ../Doc/faq/extending.rst:204 #: ../Doc/faq/extending.rst:204
msgid "How do I interface to C++ objects from Python?" msgid "How do I interface to C++ objects from Python?"
msgstr "" msgstr "Comment s'interfacer avec les objets C++ depuis Python ?"
#: ../Doc/faq/extending.rst:206 #: ../Doc/faq/extending.rst:206
msgid "" msgid ""
@ -251,14 +314,22 @@ msgid ""
"building a new Python type around a C structure (pointer) type will also " "building a new Python type around a C structure (pointer) type will also "
"work for C++ objects." "work for C++ objects."
msgstr "" msgstr ""
"Selon vos besoins, de nombreuses approches sont possibles. Pour le faire "
"manuellement, commencez par lire :ref:`le document \"Extension et intégration"
"\" <extending-index>`. Sachez que pour le système d'exécution Python, il n'y "
"a pas beaucoup de différence entre C et C++ — donc la méthode pour "
"construire un nouveau type Python à partir d'une structure C (pointeur) "
"fonctionne également avec des objets en C++."
#: ../Doc/faq/extending.rst:212 #: ../Doc/faq/extending.rst:212
msgid "For C++ libraries, see :ref:`c-wrapper-software`." msgid "For C++ libraries, see :ref:`c-wrapper-software`."
msgstr "" msgstr "Pour les bibliothèques C++, voir :ref:`c-wrapper-software`."
#: ../Doc/faq/extending.rst:216 #: ../Doc/faq/extending.rst:216
msgid "I added a module using the Setup file and the make fails; why?" msgid "I added a module using the Setup file and the make fails; why?"
msgstr "" msgstr ""
"J'ai ajouté un module en utilisant le fichier *Setup* et la compilation "
"échoue ; pourquoi ?"
#: ../Doc/faq/extending.rst:218 #: ../Doc/faq/extending.rst:218
msgid "" msgid ""
@ -266,30 +337,40 @@ msgid ""
"fails. (Fixing this requires some ugly shell script hackery, and this bug " "fails. (Fixing this requires some ugly shell script hackery, and this bug "
"is so minor that it doesn't seem worth the effort.)" "is so minor that it doesn't seem worth the effort.)"
msgstr "" msgstr ""
"Le fichier *Setup* doit se terminer par une ligne vide, s'il n'y a pas de "
"ligne vide, le processus de compilation échoue (ce problème peut se régler "
"en bidouillant un script shell, et ce bogue est si mineur qu'il ne mérite "
"pas qu'on s'y attarde)."
#: ../Doc/faq/extending.rst:224 #: ../Doc/faq/extending.rst:224
msgid "How do I debug an extension?" msgid "How do I debug an extension?"
msgstr "" msgstr "Comment déboguer une extension ?"
#: ../Doc/faq/extending.rst:226 #: ../Doc/faq/extending.rst:226
msgid "" msgid ""
"When using GDB with dynamically loaded extensions, you can't set a " "When using GDB with dynamically loaded extensions, you can't set a "
"breakpoint in your extension until your extension is loaded." "breakpoint in your extension until your extension is loaded."
msgstr "" msgstr ""
"Lorsque vous utilisez GDB avec des extensions chargées dynamiquement, vous "
"ne pouvez pas placer de point d'arrêt dans votre extension tant que celle-ci "
"n'est pas chargée."
#: ../Doc/faq/extending.rst:229 #: ../Doc/faq/extending.rst:229
msgid "In your ``.gdbinit`` file (or interactively), add the command:" msgid "In your ``.gdbinit`` file (or interactively), add the command:"
msgstr "" msgstr ""
"Dans votre fichier ``.gdbinit`` (ou manuellement), ajoutez la commande :"
#: ../Doc/faq/extending.rst:235 #: ../Doc/faq/extending.rst:235
msgid "Then, when you run GDB:" msgid "Then, when you run GDB:"
msgstr "" msgstr "Ensuite, lorsque vous exécutez GDB :"
#: ../Doc/faq/extending.rst:247 #: ../Doc/faq/extending.rst:247
msgid "" msgid ""
"I want to compile a Python module on my Linux system, but some files are " "I want to compile a Python module on my Linux system, but some files are "
"missing. Why?" "missing. Why?"
msgstr "" msgstr ""
"Je veux compiler un module Python sur mon système Linux, mais il manque "
"certains fichiers. Pourquoi ?"
#: ../Doc/faq/extending.rst:249 #: ../Doc/faq/extending.rst:249
msgid "" msgid ""
@ -297,18 +378,25 @@ msgid ""
"{x}/config/` directory, which contains various files required for compiling " "{x}/config/` directory, which contains various files required for compiling "
"Python extensions." "Python extensions."
msgstr "" msgstr ""
"La plupart des versions pré-compilées de Python n'incluent pas le "
"répertoire :file:`/usr/lib/python2.{x}/config/`, qui contient les différents "
"fichiers nécessaires à la compilation des extensions Python."
#: ../Doc/faq/extending.rst:253 #: ../Doc/faq/extending.rst:253
msgid "For Red Hat, install the python-devel RPM to get the necessary files." msgid "For Red Hat, install the python-devel RPM to get the necessary files."
msgstr "" msgstr ""
"Pour Red Hat, installez le RPM *python-devel* pour obtenir les fichiers "
"nécessaires."
#: ../Doc/faq/extending.rst:255 #: ../Doc/faq/extending.rst:255
msgid "For Debian, run ``apt-get install python-dev``." msgid "For Debian, run ``apt-get install python-dev``."
msgstr "" msgstr "Pour Debian, exécutez ``apt-get install python-dev``."
#: ../Doc/faq/extending.rst:259 #: ../Doc/faq/extending.rst:259
msgid "How do I tell \"incomplete input\" from \"invalid input\"?" msgid "How do I tell \"incomplete input\" from \"invalid input\"?"
msgstr "" msgstr ""
"Comment distinguer une « entrée incomplète » (*incomplete input*) d'une "
 entrée invalide » (*invalid input*) ?"
#: ../Doc/faq/extending.rst:261 #: ../Doc/faq/extending.rst:261
msgid "" msgid ""
@ -318,12 +406,19 @@ msgid ""
"parentheses or triple string quotes), but it gives you a syntax error " "parentheses or triple string quotes), but it gives you a syntax error "
"message immediately when the input is invalid." "message immediately when the input is invalid."
msgstr "" msgstr ""
"Parfois vous souhaitez émuler le comportement de l'interpréteur interactif "
"Python, quand il vous donne une invite de continuation lorsque l'entrée est "
"incomplète (par exemple, vous avez tapé le début d'une instruction \"if\" ou "
"vous n'avez pas fermé vos parenthèses ou triple guillemets) mais il vous "
"renvoie immédiatement une erreur syntaxique quand la saisie est incorrecte."
#: ../Doc/faq/extending.rst:267 #: ../Doc/faq/extending.rst:267
msgid "" msgid ""
"In Python you can use the :mod:`codeop` module, which approximates the " "In Python you can use the :mod:`codeop` module, which approximates the "
"parser's behavior sufficiently. IDLE uses this, for example." "parser's behavior sufficiently. IDLE uses this, for example."
msgstr "" msgstr ""
"En Python, vous pouvez utiliser le module :mod:`codeop`, qui se rapproche "
"assez du comportement de l'analyseur. Par exemple, IDLE l'utilise."
#: ../Doc/faq/extending.rst:270 #: ../Doc/faq/extending.rst:270
msgid "" msgid ""
@ -333,6 +428,12 @@ msgid ""
"to point at your custom input function. See ``Modules/readline.c`` and " "to point at your custom input function. See ``Modules/readline.c`` and "
"``Parser/myreadline.c`` for more hints." "``Parser/myreadline.c`` for more hints."
msgstr "" msgstr ""
"La façon la plus simple de le faire en C est d'appeler :c:func:"
"`PyRun_InteractiveLoop` (peut-être dans un autre fil d'exécution) et laisser "
"l'interpréteur Python gérer l'entrée pour vous. Vous pouvez également "
"définir :c:func:`PyOS_ReadlineFunctionPointer` pour pointer vers votre "
"fonction d'entrée personnalisée. Voir ``Modules/readline.c`` et ``Parser/"
"myreadline.c`` pour plus de conseils."
#: ../Doc/faq/extending.rst:276 #: ../Doc/faq/extending.rst:276
msgid "" msgid ""
@ -355,10 +456,21 @@ msgid ""
"\". Here is a complete example using the GNU readline library (you may want " "\". Here is a complete example using the GNU readline library (you may want "
"to ignore **SIGINT** while calling readline())::" "to ignore **SIGINT** while calling readline())::"
msgstr "" msgstr ""
"Une autre solution est d'essayer de compiler la chaîne reçue avec :c:func:"
"`Py_CompileString`. Si cela se compile sans erreur, essayez d'exécuter "
"l'objet code renvoyé en appelant :c:func:`PyEval_EvalCode`. Sinon, "
"enregistrez l'entrée pour plus tard. Si la compilation échoue, vérifiez s'il "
"s'agit d'une erreur ou s'il faut juste plus de données — en extrayant la "
"chaîne de message du tuple d'exception et en la comparant à la chaîne *"
"\"unexpected EOF while parsing\"*. Voici un exemple complet d'utilisation de "
"la bibliothèque *readline* de GNU (il vous est possible d'ignorer **SIGINT** "
"lors de l'appel à ``readline()``) ::"
#: ../Doc/faq/extending.rst:430 #: ../Doc/faq/extending.rst:430
msgid "How do I find undefined g++ symbols __builtin_new or __pure_virtual?" msgid "How do I find undefined g++ symbols __builtin_new or __pure_virtual?"
msgstr "" msgstr ""
"Comment puis-je trouver les symboles g++ indéfinis ``__builtin_new`` ou "
"``__pure_virtual`` ?"
#: ../Doc/faq/extending.rst:432 #: ../Doc/faq/extending.rst:432
msgid "" msgid ""
@ -366,18 +478,27 @@ msgid ""
"it using g++ (change LINKCC in the Python Modules Makefile), and link your " "it using g++ (change LINKCC in the Python Modules Makefile), and link your "
"extension module using g++ (e.g., ``g++ -shared -o mymodule.so mymodule.o``)." "extension module using g++ (e.g., ``g++ -shared -o mymodule.so mymodule.o``)."
msgstr "" msgstr ""
"Pour charger dynamiquement les modules d'extension g++, vous devez "
"recompiler Python, effectuer l'édition de liens en utilisant g++ (modifiez "
"*LINKCC* dans le *Python Modules Makefile*), et effectuer l'édition de liens "
"de votre module d'extension avec g++ (par exemple, ``g++ -shared -o mymodule."
"so mymodule.o``)."
#: ../Doc/faq/extending.rst:438 #: ../Doc/faq/extending.rst:438
msgid "" msgid ""
"Can I create an object class with some methods implemented in C and others " "Can I create an object class with some methods implemented in C and others "
"in Python (e.g. through inheritance)?" "in Python (e.g. through inheritance)?"
msgstr "" msgstr ""
"Puis-je créer une classe d'objets avec certaines méthodes implémentées en C "
"et d'autres en Python (p. ex. en utilisant l'héritage) ?"
#: ../Doc/faq/extending.rst:440 #: ../Doc/faq/extending.rst:440
msgid "" msgid ""
"Yes, you can inherit from built-in classes such as :class:`int`, :class:" "Yes, you can inherit from built-in classes such as :class:`int`, :class:"
"`list`, :class:`dict`, etc." "`list`, :class:`dict`, etc."
msgstr "" msgstr ""
"Oui, vous pouvez hériter de classes intégrées telles que :class:`int`, :"
"class:`list`, :class:`dict`, etc."
#: ../Doc/faq/extending.rst:443 #: ../Doc/faq/extending.rst:443
msgid "" msgid ""
@ -385,3 +506,6 @@ msgid ""
"html) provides a way of doing this from C++ (i.e. you can inherit from an " "html) provides a way of doing this from C++ (i.e. you can inherit from an "
"extension class written in C++ using the BPL)." "extension class written in C++ using the BPL)."
msgstr "" msgstr ""
"La bibliothèque *Boost Python Library* (BPL, http://www.boost.org/libs/"
"python/doc/index.html) fournit un moyen de le faire depuis C++ (c.-à-d. que "
"vous pouvez hériter d'une classe d'extension écrite en C++ en utilisant BPL)."

View File

@ -52,6 +52,14 @@ msgid ""
"tk>`_. Tcl/Tk is fully portable to the Mac OS X, Windows, and Unix " "tk>`_. Tcl/Tk is fully portable to the Mac OS X, Windows, and Unix "
"platforms." "platforms."
msgstr "" msgstr ""
"Les versions standards de Python incluent une interface orientée objet pour "
"le jeu d'objets graphiques *Tcl/Tk*, appelée :ref:`tkinter <Tkinter>`. "
"C'est probablement la plus facile à installer (puisqu'elle est incluse avec "
"la plupart des `distributions binaires <https://www.python.org/downloads/>`_ "
"de Python) et à utiliser. Pour plus d'informations sur *Tk*, y compris les "
"liens vers les sources, voir la page d'accueil `Tcl/Tk <https://www.tcl."
"tk>`_. *Tcl/Tk* est entièrement portable sur les plates-formes Mac OS X, "
"Windows et Unix."
#: ../Doc/faq/gui.rst:38 #: ../Doc/faq/gui.rst:38
msgid "wxWidgets" msgid "wxWidgets"
@ -65,6 +73,11 @@ msgid ""
"targets. Language bindings are available for a number of languages " "targets. Language bindings are available for a number of languages "
"including Python, Perl, Ruby, etc." "including Python, Perl, Ruby, etc."
msgstr "" msgstr ""
"`wxWidgets` (https://www.wxwidgets.org) est une librairie de classe IUG "
"portable et gratuite écrite en C++ qui fournit une apparence native sur un "
"certain nombre de plates-formes, elle est notamment en version stable pour "
"Windows, Mac OS X, GTK et X11. Des clients sont disponibles pour un certain "
"nombre de langages, y compris Python, Perl, Ruby, etc."
#: ../Doc/faq/gui.rst:46 #: ../Doc/faq/gui.rst:46
msgid "" msgid ""
@ -86,10 +99,14 @@ msgid ""
"licences that allow their use in commercial products as well as in freeware " "licences that allow their use in commercial products as well as in freeware "
"or shareware." "or shareware."
msgstr "" msgstr ""
"*wxWidgets* et *wxPython* sont tous deux des logiciels libres, open source, "
"avec des licences permissives qui permettent leur utilisation dans des "
"produits commerciaux ainsi que dans des logiciels gratuits ou contributifs "
"(*shareware*)."
#: ../Doc/faq/gui.rst:58 #: ../Doc/faq/gui.rst:58
msgid "Qt" msgid "Qt"
msgstr "" msgstr "*Qt*"
#: ../Doc/faq/gui.rst:60 #: ../Doc/faq/gui.rst:60
msgid "" msgid ""
@ -101,16 +118,26 @@ msgid ""
"com/commercial/license-faq>`_ if you want to write proprietary " "com/commercial/license-faq>`_ if you want to write proprietary "
"applications. PySide is free for all applications." "applications. PySide is free for all applications."
msgstr "" msgstr ""
"Il existe des liens disponibles pour la boîte à outils *Qt* (en utilisant "
"soit `PyQt <https://riverbankcomputing.com/software/pyqt/intro>`_ ou `PySide "
"<https://wiki.qt.io/PySide>`_) et pour *KDE* (`PyKDE4 <https://techbase.kde."
"org/Languages/Python/Using_PyKDE_4>`__). *PyQt* est actuellement plus mûre "
"que *PySide*, mais*PyQt* nécessite d'acheter une licence de `Riverbank "
"Computing <https://www.riverbankcomputing.com/commercial/license-faq>`_ si "
"vous voulez écrire des applications propriétaires. *PySide* est gratuit "
"pour toutes les applications."
#: ../Doc/faq/gui.rst:67 #: ../Doc/faq/gui.rst:67
msgid "" msgid ""
"Qt 4.5 upwards is licensed under the LGPL license; also, commercial licenses " "Qt 4.5 upwards is licensed under the LGPL license; also, commercial licenses "
"are available from `The Qt Company <https://www.qt.io/licensing/>`_." "are available from `The Qt Company <https://www.qt.io/licensing/>`_."
msgstr "" msgstr ""
"*Qt >= 4.5* est sous licence LGPL ; de plus, des licences commerciales sont "
"disponibles auprès de `The Qt Company <https://www.qt.io/licensing/>`_."
#: ../Doc/faq/gui.rst:71 #: ../Doc/faq/gui.rst:71
msgid "Gtk+" msgid "Gtk+"
msgstr "" msgstr "*Gtk+*"
#: ../Doc/faq/gui.rst:73 #: ../Doc/faq/gui.rst:73
msgid "" msgid ""
@ -128,7 +155,7 @@ msgstr ""
#: ../Doc/faq/gui.rst:81 #: ../Doc/faq/gui.rst:81
msgid "FLTK" msgid "FLTK"
msgstr "" msgstr "*FLTK*"
#: ../Doc/faq/gui.rst:83 #: ../Doc/faq/gui.rst:83
msgid "" msgid ""
@ -136,6 +163,9 @@ msgid ""
"powerful and mature cross-platform windowing system, are available from `the " "powerful and mature cross-platform windowing system, are available from `the "
"PyFLTK project <http://pyfltk.sourceforge.net>`_." "PyFLTK project <http://pyfltk.sourceforge.net>`_."
msgstr "" msgstr ""
"Les liaisons Python pour `the FLTK toolkit <http://www.fltk.org>`_, un "
"système de fenêtrage multi-plateformes simple mais puissant et mûr, sont "
"disponibles auprès de `the PyFLTK project <http://pyfltk.sourceforge.net>`_."
#: ../Doc/faq/gui.rst:89 #: ../Doc/faq/gui.rst:89
msgid "FOX" msgid "FOX"
@ -150,15 +180,18 @@ msgstr ""
#: ../Doc/faq/gui.rst:97 #: ../Doc/faq/gui.rst:97
msgid "OpenGL" msgid "OpenGL"
msgstr "" msgstr "*OpenGL*"
#: ../Doc/faq/gui.rst:99 #: ../Doc/faq/gui.rst:99
msgid "For OpenGL bindings, see `PyOpenGL <http://pyopengl.sourceforge.net>`_." msgid "For OpenGL bindings, see `PyOpenGL <http://pyopengl.sourceforge.net>`_."
msgstr "" msgstr ""
"Pour les clients OpenGL, voir `PyOpenGL <http://pyopengl.sourceforge.net>`_."
#: ../Doc/faq/gui.rst:103 #: ../Doc/faq/gui.rst:103
msgid "What platform-specific GUI toolkits exist for Python?" msgid "What platform-specific GUI toolkits exist for Python?"
msgstr "" msgstr ""
"Quelles boîtes à outils IUG spécifiques à la plate-forme existent pour "
"Python ?"
#: ../Doc/faq/gui.rst:105 #: ../Doc/faq/gui.rst:105
msgid "" msgid ""
@ -172,14 +205,17 @@ msgid ""
"Microsoft Foundation Classes and a Python programming environment that's " "Microsoft Foundation Classes and a Python programming environment that's "
"written mostly in Python using the MFC classes." "written mostly in Python using the MFC classes."
msgstr "" msgstr ""
":ref:`Pythonwin <windows-faq>` de Mark Hammond inclut une interface vers les "
"classes `Microsoft Foundation Classes` et un environnement de programmation "
"Python qui est écrit principalement en Python utilisant les classes *MFC*."
#: ../Doc/faq/gui.rst:115 #: ../Doc/faq/gui.rst:115
msgid "Tkinter questions" msgid "Tkinter questions"
msgstr "" msgstr "Questions à propos de *Tkinter*"
#: ../Doc/faq/gui.rst:118 #: ../Doc/faq/gui.rst:118
msgid "How do I freeze Tkinter applications?" msgid "How do I freeze Tkinter applications?"
msgstr "" msgstr "Comment puis-je geler (*freezer*) les applications *Tkinter* ?"
#: ../Doc/faq/gui.rst:120 #: ../Doc/faq/gui.rst:120
msgid "" msgid ""
@ -187,6 +223,10 @@ msgid ""
"applications, the applications will not be truly stand-alone, as the " "applications, the applications will not be truly stand-alone, as the "
"application will still need the Tcl and Tk libraries." "application will still need the Tcl and Tk libraries."
msgstr "" msgstr ""
"*Freeze* est un outil pour créer des applications autonomes. Lors du "
"*freezage* des applications Tkinter, les applications ne seront pas vraiment "
"autonomes, car l'application aura toujours besoin des bibliothèques Tcl et "
"Tk."
#: ../Doc/faq/gui.rst:124 #: ../Doc/faq/gui.rst:124
msgid "" msgid ""
@ -194,6 +234,9 @@ msgid ""
"point to them at run-time using the :envvar:`TCL_LIBRARY` and :envvar:" "point to them at run-time using the :envvar:`TCL_LIBRARY` and :envvar:"
"`TK_LIBRARY` environment variables." "`TK_LIBRARY` environment variables."
msgstr "" msgstr ""
"Une solution consiste à empaqueter les bibliothèques *Tcl* et *Tk* dans "
"l'application et de les retrouver à l'exécution en utilisant les variables "
"d'environnement :envvar:`TCL_LIBRARY` et :envvar:`TK_LIBRARY`."
#: ../Doc/faq/gui.rst:128 #: ../Doc/faq/gui.rst:128
msgid "" msgid ""
@ -202,6 +245,10 @@ msgid ""
"is SAM (stand-alone modules), which is part of the Tix distribution (http://" "is SAM (stand-alone modules), which is part of the Tix distribution (http://"
"tix.sourceforge.net/)." "tix.sourceforge.net/)."
msgstr "" msgstr ""
"Pour obtenir des applications vraiment autonomes, les scripts *Tcl* qui "
"forment la bibliothèque doivent également être intégrés dans l'application. "
"Un outil supportant cela est *SAM* (modules autonomes), qui fait partie de "
"la distribution *Tix* (http://tix.sourceforge.net/)."
#: ../Doc/faq/gui.rst:133 #: ../Doc/faq/gui.rst:133
msgid "" msgid ""
@ -209,10 +256,14 @@ msgid ""
"`Tclsam_init`, etc. inside Python's :file:`Modules/tkappinit.c`, and link " "`Tclsam_init`, etc. inside Python's :file:`Modules/tkappinit.c`, and link "
"with libtclsam and libtksam (you might include the Tix libraries as well)." "with libtclsam and libtksam (you might include the Tix libraries as well)."
msgstr "" msgstr ""
"Compilez Tix avec SAM activé, exécutez l'appel approprié à :c:func:"
"`Tclsam_init`, etc. dans le fichier :file:`Modules/tkappinit.c` de Python, "
"et liez avec *libtclsam* et *libtksam* (il est également possible d'inclure "
"les bibliothèques *Tix*)."
#: ../Doc/faq/gui.rst:140 #: ../Doc/faq/gui.rst:140
msgid "Can I have Tk events handled while waiting for I/O?" msgid "Can I have Tk events handled while waiting for I/O?"
msgstr "" msgstr "Puis-je modifier des événements *Tk* pendant l'écoute des *E/S* ?"
#: ../Doc/faq/gui.rst:142 #: ../Doc/faq/gui.rst:142
msgid "" msgid ""
@ -222,10 +273,18 @@ msgid ""
"function which will be called from the Tk mainloop when I/O is possible on a " "function which will be called from the Tk mainloop when I/O is possible on a "
"file descriptor. See :ref:`tkinter-file-handlers`." "file descriptor. See :ref:`tkinter-file-handlers`."
msgstr "" msgstr ""
"Sur d'autres plates-formes que Windows, oui, et vous n'avez même pas besoin "
"de fils d'exécution multiples ! Mais vous devrez restructurer un peu votre "
"code *E/S*. *Tk* possède l'équivalent de l'appel :c:func:`XtAddInput()` de "
"*Xt*, qui vous permet d'enregistrer une fonction de *callback* qui sera "
"appelée par la boucle principale *Tk* lorsque des *E/S* sont disponibles sur "
"un descripteur de fichier. Voir :ref:`tkinter-file-handlers`."
#: ../Doc/faq/gui.rst:150 #: ../Doc/faq/gui.rst:150
msgid "I can't get key bindings to work in Tkinter: why?" msgid "I can't get key bindings to work in Tkinter: why?"
msgstr "" msgstr ""
"Je n'arrive pas à faire fonctionner les raccourcis clavier dans *Tkinter* : "
"pourquoi ?"
#: ../Doc/faq/gui.rst:152 #: ../Doc/faq/gui.rst:152
msgid "" msgid ""
@ -233,6 +292,9 @@ msgid ""
"meth:`bind` method don't get handled even when the appropriate key is " "meth:`bind` method don't get handled even when the appropriate key is "
"pressed." "pressed."
msgstr "" msgstr ""
"Une raison récurrente est que les gestionnaires dévènements liés à des "
"évènements avec la méthode :meth:`bind` ne sont pas pris en charge même "
"lorsque la touche appropriée est activée."
#: ../Doc/faq/gui.rst:155 #: ../Doc/faq/gui.rst:155
msgid "" msgid ""
@ -241,3 +303,8 @@ msgid ""
"focus command. Usually a widget is given the keyboard focus by clicking in " "focus command. Usually a widget is given the keyboard focus by clicking in "
"it (but not for labels; see the takefocus option)." "it (but not for labels; see the takefocus option)."
msgstr "" msgstr ""
"La cause la plus fréquente est que l'objet graphique auquel s'applique la "
"liaison n'a pas de « focus clavier ». Consultez la documentation *Tk* pour "
"la commande *focus*. Habituellement, un objet graphique reçoit le focus du "
"clavier en cliquant dessus (mais pas pour les étiquettes ; voir l'option "
"*takefocus*)."

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -293,6 +293,13 @@ msgid ""
"``PyInit_foo()`` to initialize it. You do not link your .exe with foo.lib, " "``PyInit_foo()`` to initialize it. You do not link your .exe with foo.lib, "
"as that would cause Windows to require the DLL to be present." "as that would cause Windows to require the DLL to be present."
msgstr "" msgstr ""
"Oui, les fichiers *.pyd* sont des fichiers *dll*, mais il y a quelques "
"différences. Si vous avez une *DLL* ``foo.pyd``, celle-ci doit posséder une "
"fonction ``PyInit_foo()``. Vous pouvez alors écrire en Python « *import "
"foo* » et Python recherchera le fichier *foo.pyd* (ainsi que *foo.py* et "
"*foo.pyc*); s'il le trouve, il tentera d'appeler ``PyInit_foo()`` pour "
"l'initialiser. Ne liez pas votre *.exe* avec *foo.lib* car dans ce cas "
"Windows aura besoin de la DLL."
#: ../Doc/faq/windows.rst:190 #: ../Doc/faq/windows.rst:190
msgid "" msgid ""
@ -304,16 +311,26 @@ msgid ""
"``__declspec(dllexport)``. In a .pyd, linkage is defined in a list of " "``__declspec(dllexport)``. In a .pyd, linkage is defined in a list of "
"available functions." "available functions."
msgstr "" msgstr ""
"Notez que le chemin de recherche pour *foo.pyd* est *PYTHONPATH*, il est "
"différent de celui qu'utilise Windows pour rechercher *foo.dll*. De plus, "
"*foo.pyd* n'a pas besoin d'être présent pour que votre programme s'exécute "
"alors que si vous avez lié votre programme avec une *dll* celle-ci est "
"requise. Bien sûr *foo.pyd* est nécessaire si vous écrivez ``import foo``. "
"Dans une *DLL* le lien est déclaré dans le code source avec "
"``__declspec(dllexport)``. Dans un *.pyd* la liaison est définie dans une "
"liste de fonctions disponibles."
#: ../Doc/faq/windows.rst:199 #: ../Doc/faq/windows.rst:199
msgid "How can I embed Python into a Windows application?" msgid "How can I embed Python into a Windows application?"
msgstr "" msgstr "Comment puis-je intégrer Python dans une application Windows ?"
#: ../Doc/faq/windows.rst:201 #: ../Doc/faq/windows.rst:201
msgid "" msgid ""
"Embedding the Python interpreter in a Windows app can be summarized as " "Embedding the Python interpreter in a Windows app can be summarized as "
"follows:" "follows:"
msgstr "" msgstr ""
"L'intégration de l'interpréteur Python dans une application Windows peut se "
"résumer comme suit :"
#: ../Doc/faq/windows.rst:203 #: ../Doc/faq/windows.rst:203
msgid "" msgid ""
@ -323,6 +340,12 @@ msgid ""
"it is typically installed in ``C:\\Windows\\System``. *NN* is the Python " "it is typically installed in ``C:\\Windows\\System``. *NN* is the Python "
"version, a number such as \"33\" for Python 3.3." "version, a number such as \"33\" for Python 3.3."
msgstr "" msgstr ""
"Ne compilez _pas_ Python directement dans votre fichier *.exe*. Sous "
"Windows, Python doit être une DLL pour pouvoir importer des modules qui sont "
"eux-mêmes des DLL (ceci constitue une information de première importance non "
"documentée). Au lieu de cela faites un lien vers :file:`python{NN}.dll` qui "
"est généralement placé dans ``C:\\Windows\\System``. *NN* étant la version "
"Python, par exemple « 33 » pour Python 3.3."
#: ../Doc/faq/windows.rst:209 #: ../Doc/faq/windows.rst:209
msgid "" msgid ""
@ -332,6 +355,12 @@ msgid ""
"the so-called \"import lib\" corresponding to :file:`python{NN}.dll`. It " "the so-called \"import lib\" corresponding to :file:`python{NN}.dll`. It "
"merely defines symbols for the linker.)" "merely defines symbols for the linker.)"
msgstr "" msgstr ""
"Vous pouvez créer un lien vers Python de deux manières différentes. Un lien "
"au moment du chargement signifie pointer vers :file:`python{NN}.lib`, tandis "
"qu'un lien au moment de l'exécution signifie pointer vers :file:`python{NN}."
"dll`. (Note générale : :file:`python{NN}.lib` est le soi-disant « *import "
"lib* » correspondant à :file:`python{NN}.dll`. Il définit simplement des "
"liens symboliques pour l'éditeur de liens.)"
#: ../Doc/faq/windows.rst:215 #: ../Doc/faq/windows.rst:215
msgid "" msgid ""
@ -343,12 +372,22 @@ msgid ""
"these pointers transparent to any C code that calls routines in Python's C " "these pointers transparent to any C code that calls routines in Python's C "
"API." "API."
msgstr "" msgstr ""
"La liaison en temps réel simplifie grandement les options de liaison ; tout "
"se passe au moment de l'exécution. Votre code doit charger :file:"
"`python{NN}.dll` en utilisant la routine Windows ``LoadLibraryEx()``. Le "
"code doit aussi utiliser des routines d'accès et des données dans :file:"
"`python{NN}.dll` (c'est-à-dire les API C de Python) en utilisant des "
"pointeurs obtenus par la routine Windows ``GetProcAddress()``. Les macros "
"peuvent rendre l'utilisation de ces pointeurs transparente à tout code C qui "
"appelle des routines dans l'API C de Python."
#: ../Doc/faq/windows.rst:222 #: ../Doc/faq/windows.rst:222
msgid "" msgid ""
"Borland note: convert :file:`python{NN}.lib` to OMF format using Coff2Omf." "Borland note: convert :file:`python{NN}.lib` to OMF format using Coff2Omf."
"exe first." "exe first."
msgstr "" msgstr ""
"Note Borland : convertir :file:`python{NN}.lib` au format OMF en utilisant "
"*Coff2Omf.exe* en premier."
#: ../Doc/faq/windows.rst:227 #: ../Doc/faq/windows.rst:227
msgid "" msgid ""
@ -358,6 +397,12 @@ msgid ""
"link *into* your .exe file (!) You do _not_ have to create a DLL file, and " "link *into* your .exe file (!) You do _not_ have to create a DLL file, and "
"this also simplifies linking." "this also simplifies linking."
msgstr "" msgstr ""
"Si vous utilisez SWIG, il est facile de créer un « module d'extension » "
"Python qui rendra les données et les méthodes de l'application disponibles "
"pour Python. SWIG s'occupera de tous les détails ennuyeux pour vous. Le "
"résultat est du code C que vous liez *dans* votre *fichier.exe* (!) Vous "
"n'avez _pas_ besoin de créer un fichier DLL, et cela simplifie également la "
"liaison."
#: ../Doc/faq/windows.rst:233 #: ../Doc/faq/windows.rst:233
msgid "" msgid ""
@ -367,6 +412,12 @@ msgid ""
"classes, as you should, the init function will be called initleoc(). This " "classes, as you should, the init function will be called initleoc(). This "
"initializes a mostly hidden helper class used by the shadow class." "initializes a mostly hidden helper class used by the shadow class."
msgstr "" msgstr ""
"SWIG va créer une fonction d'initialisation (fonction en C) dont le nom "
"dépend du nom du module d'extension. Par exemple, si le nom du module est "
"*leo*, la fonction *init* sera appelée *initleo()*. Si vous utilisez des "
"classes *shadow* SWIG, comme vous le devriez, la fonction *init* sera "
"appelée *initleoc()*. Ceci initialise une classe auxiliaire invisible "
"utilisée par la classe *shadow*."
#: ../Doc/faq/windows.rst:239 #: ../Doc/faq/windows.rst:239
msgid "" msgid ""
@ -374,18 +425,26 @@ msgid ""
"calling the initialization function is equivalent to importing the module " "calling the initialization function is equivalent to importing the module "
"into Python! (This is the second key undocumented fact.)" "into Python! (This is the second key undocumented fact.)"
msgstr "" msgstr ""
"La raison pour laquelle vous pouvez lier le code C à l'étape 2 dans votre "
"*fichier.exe* est que l'appel de la fonction d'initialisation équivaut à "
"importer le module dans Python ! (C'est le deuxième fait clé non documenté.)"
#: ../Doc/faq/windows.rst:243 #: ../Doc/faq/windows.rst:243
msgid "" msgid ""
"In short, you can use the following code to initialize the Python " "In short, you can use the following code to initialize the Python "
"interpreter with your extension module." "interpreter with your extension module."
msgstr "" msgstr ""
"En bref, vous pouvez utiliser le code suivant pour initialiser "
"l'interpréteur Python avec votre module d'extension."
#: ../Doc/faq/windows.rst:254 #: ../Doc/faq/windows.rst:254
msgid "" msgid ""
"There are two problems with Python's C API which will become apparent if you " "There are two problems with Python's C API which will become apparent if you "
"use a compiler other than MSVC, the compiler used to build pythonNN.dll." "use a compiler other than MSVC, the compiler used to build pythonNN.dll."
msgstr "" msgstr ""
"Il y a deux problèmes avec l'API C de Python qui apparaîtront si vous "
"utilisez un compilateur autre que MSVC, le compilateur utilisé pour "
"construire *pythonNN.dll*."
#: ../Doc/faq/windows.rst:257 #: ../Doc/faq/windows.rst:257
msgid "" msgid ""
@ -394,12 +453,19 @@ msgid ""
"compiler's notion of a struct FILE will be different. From an " "compiler's notion of a struct FILE will be different. From an "
"implementation standpoint these are very _low_ level functions." "implementation standpoint these are very _low_ level functions."
msgstr "" msgstr ""
"Problème 1 : Les fonctions dites de \"Très Haut Niveau\" qui prennent les "
"arguments FILE * ne fonctionneront pas dans un environnement multi-"
"compilateur car chaque compilateur aura une notion différente de la "
"structure de FILE. Du point de vue de l'implémentation, il s'agit de "
"fonctions de très bas niveau."
#: ../Doc/faq/windows.rst:262 #: ../Doc/faq/windows.rst:262
msgid "" msgid ""
"Problem 2: SWIG generates the following code when generating wrappers to " "Problem 2: SWIG generates the following code when generating wrappers to "
"void functions:" "void functions:"
msgstr "" msgstr ""
"Problème 2 : SWIG génère le code suivant lors de la génération "
"*d'encapsuleurs* pour annuler les fonctions :"
#: ../Doc/faq/windows.rst:271 #: ../Doc/faq/windows.rst:271
msgid "" msgid ""
@ -407,6 +473,10 @@ msgid ""
"structure called _Py_NoneStruct inside pythonNN.dll. Again, this code will " "structure called _Py_NoneStruct inside pythonNN.dll. Again, this code will "
"fail in a mult-compiler environment. Replace such code by:" "fail in a mult-compiler environment. Replace such code by:"
msgstr "" msgstr ""
"Hélas, *Py_None* est une macro qui se développe en référence à une structure "
"de données complexe appelée *_Py_NoneStruct* dans *pythonNN.dll*. Encore "
"une fois, ce code échouera dans un environnement multi-compilateur. "
"Remplacez ce code par :"
#: ../Doc/faq/windows.rst:279 #: ../Doc/faq/windows.rst:279
msgid "" msgid ""
@ -414,6 +484,9 @@ msgid ""
"automatically, though I have not been able to get this to work (I'm a " "automatically, though I have not been able to get this to work (I'm a "
"complete SWIG newbie)." "complete SWIG newbie)."
msgstr "" msgstr ""
"Il est possible d'utiliser la commande ``%typemap`` de SWIG pour effectuer "
"le changement automatiquement, bien que je n'ai pas réussi à le faire "
"fonctionner (je suis un débutant complet avec SWIG)."
#: ../Doc/faq/windows.rst:283 #: ../Doc/faq/windows.rst:283
msgid "" msgid ""
@ -426,6 +499,15 @@ msgid ""
"is a Python object (defined in your extension module) that contains read() " "is a Python object (defined in your extension module) that contains read() "
"and write() methods." "and write() methods."
msgstr "" msgstr ""
"Utiliser un script shell Python pour créer une fenêtre d'interpréteur Python "
"depuis votre application Windows n'est pas une bonne idée ; la fenêtre "
"résultante sera indépendante du système de fenêtrage de votre application. "
"Vous (ou la classe *wxPythonWindow*) devriez plutôt créer une fenêtre "
"d'interpréteur « native ». Il est facile de connecter cette fenêtre à "
"l'interpréteur Python. Vous pouvez rediriger l'entrée/sortie de Python vers "
"*n'importe quel* objet qui supporte la lecture et l'écriture, donc tout ce "
"dont vous avez besoin est un objet Python (défini dans votre module "
"d'extension) qui contient les méthodes *read()* et *write()*."
#: ../Doc/faq/windows.rst:292 #: ../Doc/faq/windows.rst:292
msgid "How do I keep editors from inserting tabs into my Python source?" msgid "How do I keep editors from inserting tabs into my Python source?"

View File

@ -18,7 +18,7 @@ msgstr ""
#: ../Doc/howto/cporting.rst:7 #: ../Doc/howto/cporting.rst:7
msgid "Porting Extension Modules to Python 3" msgid "Porting Extension Modules to Python 3"
msgstr "" msgstr "Portage des modules d'extension vers Python 3"
#: ../Doc/howto/cporting.rst:9 #: ../Doc/howto/cporting.rst:9
msgid "Benjamin Peterson" msgid "Benjamin Peterson"
@ -36,6 +36,12 @@ msgid ""
"obvious on the C level. This document endeavors to document " "obvious on the C level. This document endeavors to document "
"incompatibilities and how they can be worked around." "incompatibilities and how they can be worked around."
msgstr "" msgstr ""
"Changer l'API C n'était pas l'un des objectifs de Python 3, cependant les "
"nombreux changements au niveau Python ont rendu impossible de garder l'API "
"de Python 2 comme elle était. Certains changements tels que l'unification "
"de :func:`int` et :func:`long` sont plus apparents au niveau C. Ce document "
"s'efforce de documenter les incompatibilités et la façon dont elles peuvent "
"être contournées."
#: ../Doc/howto/cporting.rst:23 #: ../Doc/howto/cporting.rst:23
msgid "Conditional compilation" msgid "Conditional compilation"
@ -46,26 +52,33 @@ msgid ""
"The easiest way to compile only some code for Python 3 is to check if :c:" "The easiest way to compile only some code for Python 3 is to check if :c:"
"macro:`PY_MAJOR_VERSION` is greater than or equal to 3. ::" "macro:`PY_MAJOR_VERSION` is greater than or equal to 3. ::"
msgstr "" msgstr ""
"La façon la plus simple de compiler seulement une section de code pour "
"Python 3 est de vérifier si :c:macro:`PY_MAJOR_VERSION` est supérieur ou "
"égal à 3. ::"
#: ../Doc/howto/cporting.rst:32 #: ../Doc/howto/cporting.rst:32
msgid "" msgid ""
"API functions that are not present can be aliased to their equivalents " "API functions that are not present can be aliased to their equivalents "
"within conditional blocks." "within conditional blocks."
msgstr "" msgstr ""
"Les fonctions manquantes dans l'API peuvent être remplacées par des alias à "
"leurs équivalents dans des blocs conditionnels."
#: ../Doc/howto/cporting.rst:37 #: ../Doc/howto/cporting.rst:37
msgid "Changes to Object APIs" msgid "Changes to Object APIs"
msgstr "" msgstr "Modifications apportées aux API des objets"
#: ../Doc/howto/cporting.rst:39 #: ../Doc/howto/cporting.rst:39
msgid "" msgid ""
"Python 3 merged together some types with similar functions while cleanly " "Python 3 merged together some types with similar functions while cleanly "
"separating others." "separating others."
msgstr "" msgstr ""
"Python 3 a fusionné certains types avec des fonctions identiques tout en "
"séparant de façon propre, d'autres."
#: ../Doc/howto/cporting.rst:44 #: ../Doc/howto/cporting.rst:44
msgid "str/unicode Unification" msgid "str/unicode Unification"
msgstr "" msgstr "Unification de *str* et *unicode*"
#: ../Doc/howto/cporting.rst:46 #: ../Doc/howto/cporting.rst:46
msgid "" msgid ""
@ -81,10 +94,23 @@ msgid ""
"shows best practices with regards to :c:type:`PyUnicode`, :c:type:" "shows best practices with regards to :c:type:`PyUnicode`, :c:type:"
"`PyString`, and :c:type:`PyBytes`. ::" "`PyString`, and :c:type:`PyBytes`. ::"
msgstr "" msgstr ""
"Le type :func:`str` de Python 3 est l'équivalent de :func:`unicode` sous "
"Python 2 ; Les fonctions C sont appelées ``PyUnicode_*`` pour les deux "
"versions. L'ancien type de chaîne de caractères de 8 bits est devenue :func:"
"`bytes`, avec des fonctions C nommées ``PyBytes_*``. Python 2.6 et toutes "
"les versions supérieures fournissent un en-tête de compatibilité, :file:"
"`bytesobject.h`, faisant correspondre les noms ``PyBytes`` aux ``PyString``. "
"Pour une meilleure compatibilité avec Python 3, :c:type:`PyUnicode` doit "
"être utilisé seulement pour des données textuelles et :c:type:`PyBytes` pour "
"des données binaires. Il est important de noter que :c:type:`PyBytes` et :c:"
"type:`PyUnicode` en Python 3 ne sont pas remplaçables contrairement à :c:"
"type:`PyString` et :c:type:`PyUnicode` dans Python 2. L'exemple suivant "
"montre l'utilisation optimale de :c:type:`PyUnicode`, :c:type:`PyString`, "
"et :c:type:`PyBytes`. ::"
#: ../Doc/howto/cporting.rst:95 #: ../Doc/howto/cporting.rst:95
msgid "long/int Unification" msgid "long/int Unification"
msgstr "" msgstr "Unification de *long* et *int*"
#: ../Doc/howto/cporting.rst:97 #: ../Doc/howto/cporting.rst:97
msgid "" msgid ""
@ -96,7 +122,7 @@ msgstr ""
#: ../Doc/howto/cporting.rst:104 #: ../Doc/howto/cporting.rst:104
msgid "Module initialization and state" msgid "Module initialization and state"
msgstr "" msgstr "Initialisation et état du module"
#: ../Doc/howto/cporting.rst:106 #: ../Doc/howto/cporting.rst:106
msgid "" msgid ""
@ -106,10 +132,16 @@ msgid ""
"in both Python 2 and Python 3 is tricky. The following simple example " "in both Python 2 and Python 3 is tricky. The following simple example "
"demonstrates how. ::" "demonstrates how. ::"
msgstr "" msgstr ""
"Python 3 a remanié son système d'initialisation des modules d'extension "
"(Voir :pep:`3121`.). Au lieu de stocker les états de module dans les "
"variables globales, les états doivent être stockés dans une structure "
"spécifique à l'interpréteur. Créer des modules qui ont un fonctionnement "
"correct en Python 2 et Python 3 est délicat. L'exemple suivant montre "
"comment. ::"
#: ../Doc/howto/cporting.rst:197 #: ../Doc/howto/cporting.rst:197
msgid "CObject replaced with Capsule" msgid "CObject replaced with Capsule"
msgstr "" msgstr "CObject remplacé par Capsule"
#: ../Doc/howto/cporting.rst:199 #: ../Doc/howto/cporting.rst:199
msgid "" msgid ""
@ -120,6 +152,13 @@ msgid ""
"APIs relied on undefined behavior in C. (For further reading on the " "APIs relied on undefined behavior in C. (For further reading on the "
"rationale behind Capsules, please see :issue:`5630`.)" "rationale behind Capsules, please see :issue:`5630`.)"
msgstr "" msgstr ""
"L'objet :c:type:`Capsule` a été introduit dans Python 3.1 et 2.7 pour "
"remplacer :c:type:`CObject`. Le type :c:type:`CObject` était utile, mais son "
"API posait des soucis : elle ne permettait pas la distinction entre les "
"objets C valides, ce qui permettait aux objets C assortis incorrectement de "
"planter l'interpréteur, et certaines des API s'appuyaient sur un "
"comportement indéfini en C. (Pour plus de détails sur la logique de "
"Capsules, veuillez consulter :issue:`5630`)."
#: ../Doc/howto/cporting.rst:206 #: ../Doc/howto/cporting.rst:206
msgid "" msgid ""
@ -131,6 +170,14 @@ msgid ""
"support both CObjects and Capsules. (Note that Python 3.0 is no longer " "support both CObjects and Capsules. (Note that Python 3.0 is no longer "
"supported, and it is not recommended for production use.)" "supported, and it is not recommended for production use.)"
msgstr "" msgstr ""
"Si vous utilisez actuellement CObjects et que vous voulez migrer vers la "
"version 3.1 ou plus récente, vous devrez passer à Capsules. :c:type:"
"`CObject` est déprécié dans 3.1 et 2.7 et est supprimé dans Python 3.2. Si "
"vous ne gérez que les versions 2.7, ou 3.1 et supérieures, vous pouvez "
"simplement passer à :c:type:`Capsule`. Si vous avez besoin de gérer Python "
"3.0, ou des versions de Python antérieures à 2.7, vous devez gérer CObjects "
"et Capsules. (Notez que Python 3.0 n'est plus maintenu, et qu'il n'est pas "
"recommandé pour une utilisation en production)."
#: ../Doc/howto/cporting.rst:216 #: ../Doc/howto/cporting.rst:216
msgid "" msgid ""
@ -140,6 +187,11 @@ msgid ""
"automatically use Capsules in versions of Python with Capsules, and switch " "automatically use Capsules in versions of Python with Capsules, and switch "
"to CObjects when Capsules are unavailable." "to CObjects when Capsules are unavailable."
msgstr "" msgstr ""
"L'exemple suivant d'en-tête de fichier :file:`capsulethunk.h` peut résoudre "
"le problème. Il suffit d'écrire votre code dans l'API :c:type:`Capsule` et "
"d'inclure ce fichier d'en-tête après :file:`Python.h`. Votre code utilisera "
"automatiquement Capsules dans les versions de Python avec Capsules, et "
"passera à CObjects lorsque les Capsules ne sont pas disponibles."
#: ../Doc/howto/cporting.rst:223 #: ../Doc/howto/cporting.rst:223
msgid "" msgid ""
@ -148,10 +200,15 @@ msgid ""
"the simulated :c:type:`Capsule` objects created by :file:`capsulethunk.h` " "the simulated :c:type:`Capsule` objects created by :file:`capsulethunk.h` "
"behave slightly differently from real Capsules. Specifically:" "behave slightly differently from real Capsules. Specifically:"
msgstr "" msgstr ""
":file:`capsulethunk.h` reproduit le fonctionnement de Capsules en utilisant "
"CObjects. Cependant, :c:type:`CObject` ne permet pas de stocker le \"nom\" "
"de la capsule. Les objets simulés :c:type:`Capsule` créés par :file:"
"`capsulethunk.h` se comportent légèrement différemment des véritables "
"Capsules. Ainsi :"
#: ../Doc/howto/cporting.rst:228 #: ../Doc/howto/cporting.rst:228
msgid "The name parameter passed in to :c:func:`PyCapsule_New` is ignored." msgid "The name parameter passed in to :c:func:`PyCapsule_New` is ignored."
msgstr "" msgstr "Le paramètre *name* passé à :c:func:`PyCapsule_New` est ignoré."
#: ../Doc/howto/cporting.rst:230 #: ../Doc/howto/cporting.rst:230
msgid "" msgid ""
@ -159,10 +216,13 @@ msgid ""
"`PyCapsule_GetPointer` is ignored, and no error checking of the name is " "`PyCapsule_GetPointer` is ignored, and no error checking of the name is "
"performed." "performed."
msgstr "" msgstr ""
"Le paramètre *name* passé à :c:func:`PyCapsule_IsValid` et :c:func:"
"`PyCapsule_GetPointer` est ignoré et il n'y a pas de vérification d'erreur "
"du nom."
#: ../Doc/howto/cporting.rst:234 #: ../Doc/howto/cporting.rst:234
msgid ":c:func:`PyCapsule_GetName` always returns NULL." msgid ":c:func:`PyCapsule_GetName` always returns NULL."
msgstr "" msgstr ":c:func:`PyCapsule_GetName` renvoie toujours un NULL."
#: ../Doc/howto/cporting.rst:236 #: ../Doc/howto/cporting.rst:236
msgid "" msgid ""
@ -171,6 +231,11 @@ msgid ""
"`PyCapsule_SetName` was deemed preferable to silent failure here. If this " "`PyCapsule_SetName` was deemed preferable to silent failure here. If this "
"is inconvenient, feel free to modify your local copy as you see fit.)" "is inconvenient, feel free to modify your local copy as you see fit.)"
msgstr "" msgstr ""
":c:func:`PyCapsule_SetName` lève toujours une exception et renvoie un échec. "
"Note : Puisqu'il n'y a aucun moyen de stocker un nom dans un CObject, "
"l'échec verbeux de :c:func:`PyCapsule_SetName` a été jugé préférable à un "
"échec non-verbeux dans ce cas. Si cela ne vous convenait pas, vous pouvez "
"modifier votre copie locale selon vos besoins."
#: ../Doc/howto/cporting.rst:243 #: ../Doc/howto/cporting.rst:243
msgid "" msgid ""
@ -178,10 +243,13 @@ msgid ""
"source:`Doc/includes/capsulethunk.h`. We also include it here for your " "source:`Doc/includes/capsulethunk.h`. We also include it here for your "
"convenience:" "convenience:"
msgstr "" msgstr ""
"Vous pouvez trouver :file:`capsulethunk.h` dans la distribution source de "
"Python comme :source:`Doc/includes/capsulethunk.h`. Nous l'incluons ici pour "
"votre confort :"
#: ../Doc/howto/cporting.rst:252 #: ../Doc/howto/cporting.rst:252
msgid "Other options" msgid "Other options"
msgstr "" msgstr "Autres options"
#: ../Doc/howto/cporting.rst:254 #: ../Doc/howto/cporting.rst:254
msgid "" msgid ""
@ -189,3 +257,7 @@ msgid ""
"<http://cython.org/>`_. It translates a Python-like language to C. The " "<http://cython.org/>`_. It translates a Python-like language to C. The "
"extension modules it creates are compatible with Python 3 and Python 2." "extension modules it creates are compatible with Python 3 and Python 2."
msgstr "" msgstr ""
"Si vous écrivez un nouveau module d'extension, vous pouvez envisager "
"d'utiliser `Cython <http://cython.org/>`_. Il traduit un langage de type "
"Python en C. Les modules d'extension qu'il crée sont compatibles avec Python "
"3 et Python 2."

File diff suppressed because it is too large Load Diff

View File

@ -1092,6 +1092,8 @@ msgid ""
"Creating a logging config file and reading it using the :func:`fileConfig` " "Creating a logging config file and reading it using the :func:`fileConfig` "
"function." "function."
msgstr "" msgstr ""
"Créer un fichier de configuration de `logging` et le lire en employant la "
"fonction :func:`fileConfig`."
#: ../Doc/howto/logging.rst:568 #: ../Doc/howto/logging.rst:568
msgid "" msgid ""
@ -1351,6 +1353,15 @@ msgid ""
"library *foo* is done using loggers with names matching 'foo.x', 'foo.x.y', " "library *foo* is done using loggers with names matching 'foo.x', 'foo.x.y', "
"etc. then the code::" "etc. then the code::"
msgstr "" msgstr ""
"Un gestionnaire *ne-fait-rien* est inclus dans le paquet de "
"journalisation : :class:`~logging.NullHandler` (depuis Python 3.1). Une "
"instance de ce gestionnaire peut être ajoutée à l'enregistreur de niveau "
"supérieur de l'espace de nommage de journalisation utilisé par la "
"bibliothèque (*si* vous souhaitez empêcher la copie de la journalisation de "
"votre bibliothèque dans ``sys.stderr`` en l'absence de configuration de "
"journalisation). Si toute la journalisation par une bibliothèque *foo* est "
"effectuée en utilisant des enregistreurs avec des noms correspondant à *foo."
"x*, *foo.x.y*, etc., alors le code ::"
#: ../Doc/howto/logging.rst:802 #: ../Doc/howto/logging.rst:802
msgid "" msgid ""
@ -1592,6 +1603,9 @@ msgid ""
":class:`~handlers.TimedRotatingFileHandler` instances send messages to disk " ":class:`~handlers.TimedRotatingFileHandler` instances send messages to disk "
"files, rotating the log file at certain timed intervals." "files, rotating the log file at certain timed intervals."
msgstr "" msgstr ""
"Les instances de :class:`~handlers.TimedRotatingFileHandler` envoient des "
"messages aux fichiers de disque, en permutant le fichier journal à "
"intervalles réguliers."
#: ../Doc/howto/logging.rst:911 #: ../Doc/howto/logging.rst:911
msgid "" msgid ""

View File

@ -18,11 +18,11 @@ msgstr ""
#: ../Doc/howto/pyporting.rst:5 #: ../Doc/howto/pyporting.rst:5
msgid "Porting Python 2 Code to Python 3" msgid "Porting Python 2 Code to Python 3"
msgstr "" msgstr "Portage de code Python 2 vers Python 3"
#: ../Doc/howto/pyporting.rst:7 #: ../Doc/howto/pyporting.rst:7
msgid "Brett Cannon" msgid "Brett Cannon"
msgstr "" msgstr "Brett Cannon"
#: ../Doc/howto/pyporting.rst:0 #: ../Doc/howto/pyporting.rst:0
msgid "Abstract" msgid "Abstract"
@ -35,12 +35,18 @@ msgid ""
"Python. This guide is meant to help you figure out how best to support both " "Python. This guide is meant to help you figure out how best to support both "
"Python 2 & 3 simultaneously." "Python 2 & 3 simultaneously."
msgstr "" msgstr ""
"Python 3 étant le futur de Python tandis que Python 2 est encore activement "
"utilisé, il est préférable de faire en sorte que votre projet soit "
"disponible pour les deux versions majeures de Python. Ce guide est destiné à "
"vous aider à comprendre comment gérer simultanément Python 2 & 3."
#: ../Doc/howto/pyporting.rst:16 #: ../Doc/howto/pyporting.rst:16
msgid "" msgid ""
"If you are looking to port an extension module instead of pure Python code, " "If you are looking to port an extension module instead of pure Python code, "
"please see :ref:`cporting-howto`." "please see :ref:`cporting-howto`."
msgstr "" msgstr ""
"Si vous cherchez à porter un module d'extension plutôt que du pur Python, "
"veuillez consulter :ref:`cporting-howto`."
#: ../Doc/howto/pyporting.rst:19 #: ../Doc/howto/pyporting.rst:19
msgid "" msgid ""
@ -53,31 +59,37 @@ msgid ""
"For help with porting, you can email the python-porting_ mailing list with " "For help with porting, you can email the python-porting_ mailing list with "
"questions." "questions."
msgstr "" msgstr ""
"Vous pouvez solliciter par courriel l'aide de la liste de diffusion python-"
"porting_ pour vos questions liées au portage."
#: ../Doc/howto/pyporting.rst:26 #: ../Doc/howto/pyporting.rst:26
msgid "The Short Explanation" msgid "The Short Explanation"
msgstr "" msgstr "La version courte"
#: ../Doc/howto/pyporting.rst:28 #: ../Doc/howto/pyporting.rst:28
msgid "" msgid ""
"To make your project be single-source Python 2/3 compatible, the basic steps " "To make your project be single-source Python 2/3 compatible, the basic steps "
"are:" "are:"
msgstr "" msgstr ""
"Afin de rendre votre projet compatible Python 2/3 avec le même code source, "
"les étapes de base sont :"
#: ../Doc/howto/pyporting.rst:31 #: ../Doc/howto/pyporting.rst:31
msgid "Only worry about supporting Python 2.7" msgid "Only worry about supporting Python 2.7"
msgstr "" msgstr "Ne se préoccuper que du support de Python 2.7"
#: ../Doc/howto/pyporting.rst:32 #: ../Doc/howto/pyporting.rst:32
msgid "" msgid ""
"Make sure you have good test coverage (coverage.py_ can help; ``pip install " "Make sure you have good test coverage (coverage.py_ can help; ``pip install "
"coverage``)" "coverage``)"
msgstr "" msgstr ""
"S'assurer d'une bonne couverture des tests (coverage.py_ peut aider ; ``pip "
"install coverage``)"
#: ../Doc/howto/pyporting.rst:34 ../Doc/howto/pyporting.rst:114 #: ../Doc/howto/pyporting.rst:34 ../Doc/howto/pyporting.rst:114
#: ../Doc/howto/pyporting.rst:415 #: ../Doc/howto/pyporting.rst:415
msgid "Learn the differences between Python 2 & 3" msgid "Learn the differences between Python 2 & 3"
msgstr "" msgstr "Apprendre les différences entre Python 2 et 3"
#: ../Doc/howto/pyporting.rst:35 #: ../Doc/howto/pyporting.rst:35
msgid "" msgid ""
@ -90,12 +102,17 @@ msgid ""
"Use Pylint_ to help make sure you don't regress on your Python 3 support " "Use Pylint_ to help make sure you don't regress on your Python 3 support "
"(``pip install pylint``)" "(``pip install pylint``)"
msgstr "" msgstr ""
"Utilisez Pylint_ pour vous assurer que vous ne régressez pas sur votre prise "
"en charge de Python 3 (``pip install pylint``)"
#: ../Doc/howto/pyporting.rst:39 #: ../Doc/howto/pyporting.rst:39
msgid "" msgid ""
"Use caniusepython3_ to find out which of your dependencies are blocking your " "Use caniusepython3_ to find out which of your dependencies are blocking your "
"use of Python 3 (``pip install caniusepython3``)" "use of Python 3 (``pip install caniusepython3``)"
msgstr "" msgstr ""
"Utiliser caniusepython3_ pour déterminer quelles sont, parmi les dépendances "
"que vous utilisez, celles qui bloquent votre utilisation de Python 3 (``pip "
"install caniusepython3``)"
#: ../Doc/howto/pyporting.rst:41 #: ../Doc/howto/pyporting.rst:41
msgid "" msgid ""
@ -103,6 +120,10 @@ msgid ""
"integration to make sure you stay compatible with Python 2 & 3 (tox_ can " "integration to make sure you stay compatible with Python 2 & 3 (tox_ can "
"help test against multiple versions of Python; ``pip install tox``)" "help test against multiple versions of Python; ``pip install tox``)"
msgstr "" msgstr ""
"Une fois que vos dépendances ne sont plus un obstacle, utiliser "
"l'intégration continue pour s'assurer que votre code demeure compatible "
"Python 2 & 3 (tox_ peut aider à tester la comptabilité de sources avec "
"plusieurs versions de Python; ``pip install tox``)"
#: ../Doc/howto/pyporting.rst:45 #: ../Doc/howto/pyporting.rst:45
msgid "" msgid ""
@ -132,16 +153,25 @@ msgid ""
"lower-level work is now mostly done for you and thus can at least benefit " "lower-level work is now mostly done for you and thus can at least benefit "
"from the automated changes immediately." "from the automated changes immediately."
msgstr "" msgstr ""
"Un autre point important est que la modernisation de votre code Python 2 "
"pour le rendre compatible Python 3 est pratiquement automatique. Bien qu'il "
"soit possible d'avoir à effectuer des changements d'API compte-tenu de la "
"clarification de la gestion des données textuelles et binaires dans Python "
"3, le travail de bas niveau est en grande partie fait pour vous et vous "
"pouvez ainsi bénéficiez de ces modifications automatiques immédiatement."
#: ../Doc/howto/pyporting.rst:65 #: ../Doc/howto/pyporting.rst:65
msgid "" msgid ""
"Keep those key points in mind while you read on about the details of porting " "Keep those key points in mind while you read on about the details of porting "
"your code to support Python 2 & 3 simultaneously." "your code to support Python 2 & 3 simultaneously."
msgstr "" msgstr ""
"Gardez ces points-clés en tête pendant que vous lisez les détails ci-dessous "
"concernant le portage de votre code vers une compatibilité simultanée Python "
"2 et 3."
#: ../Doc/howto/pyporting.rst:70 #: ../Doc/howto/pyporting.rst:70
msgid "Drop support for Python 2.6 and older" msgid "Drop support for Python 2.6 and older"
msgstr "" msgstr "Abandon de la compatibilité Python 2.6 et antérieures"
#: ../Doc/howto/pyporting.rst:72 #: ../Doc/howto/pyporting.rst:72
msgid "" msgid ""
@ -151,6 +181,12 @@ msgid ""
"simultaneously (``pip install six``). Do realize, though, that nearly all " "simultaneously (``pip install six``). Do realize, though, that nearly all "
"the projects listed in this HOWTO will not be available to you." "the projects listed in this HOWTO will not be available to you."
msgstr "" msgstr ""
"Bien qu'il soit possible de rendre Python 2.5 compatible avec Python 3, il "
"est **beaucoup** plus simple de n'avoir qu'à travailler avec Python 2.7. Si "
"abandonner Python 2.5 n'est pas une option, alors le projet six_ peut vous "
"aider à gérer simultanément Python 2.5 et 3 (``pip install six``). "
"Néanmoins, soyez conscient que la quasi-totalité des projets listés dans ce "
"guide pratique ne seront pas applicables à votre situation."
#: ../Doc/howto/pyporting.rst:78 #: ../Doc/howto/pyporting.rst:78
msgid "" msgid ""
@ -160,6 +196,12 @@ msgid ""
"or have to import a function instead of using a built-in one, but otherwise " "or have to import a function instead of using a built-in one, but otherwise "
"the overall transformation should not feel foreign to you." "the overall transformation should not feel foreign to you."
msgstr "" msgstr ""
"Si vous pouvez ignorer Python 2.5 et antérieur, les changements nécessaires "
"à appliquer à votre code devraient encore ressembler à vos yeux à du code "
"Python idiomatique. Dans le pire cas, vous devrez utiliser une fonction "
"plutôt qu'une méthode dans certains cas, ou bien vous devrez importer une "
"fonction plutôt qu'utiliser une fonction native, mais le reste du temps le "
"code transformé devrait vous rester familier."
#: ../Doc/howto/pyporting.rst:84 #: ../Doc/howto/pyporting.rst:84
msgid "" msgid ""
@ -176,6 +218,8 @@ msgstr ""
msgid "" msgid ""
"Make sure you specify the proper version support in your ``setup.py`` file" "Make sure you specify the proper version support in your ``setup.py`` file"
msgstr "" msgstr ""
"Assurez vous de spécifier la bonne version supportée dans le fichier ``setup."
"py``"
#: ../Doc/howto/pyporting.rst:94 #: ../Doc/howto/pyporting.rst:94
msgid "" msgid ""
@ -186,10 +230,16 @@ msgid ""
"minor version of Python that you do support, e.g. ``Programming Language :: " "minor version of Python that you do support, e.g. ``Programming Language :: "
"Python :: 2.7``." "Python :: 2.7``."
msgstr "" msgstr ""
"Votre fichier ``setup.py`` devrait contenir le bon `trove classifier`_ "
"spécifiant les versions de Python avec lesquelles vous êtes compatible. "
"Comme votre projet ne supporte pas encore Python 3, vous devriez au moins "
"spécifier ``Programming Language :: Python :: 2 :: Only``. Dans l'idéal vous "
"devriez indiquer chaque version majeure/mineure de Python que vous gérez, "
"par exemple ``Programming Language :: Python :: 2.7``."
#: ../Doc/howto/pyporting.rst:102 #: ../Doc/howto/pyporting.rst:102
msgid "Have good test coverage" msgid "Have good test coverage"
msgstr "" msgstr "Obtenir une bonne couverture de code"
#: ../Doc/howto/pyporting.rst:104 #: ../Doc/howto/pyporting.rst:104
msgid "" msgid ""
@ -213,10 +263,18 @@ msgid ""
"and the `Porting to Python 3`_ book (which is free online). There is also a " "and the `Porting to Python 3`_ book (which is free online). There is also a "
"handy `cheat sheet`_ from the Python-Future project." "handy `cheat sheet`_ from the Python-Future project."
msgstr "" msgstr ""
"Une fois que votre code est bien testé, vous êtes prêt à démarrer votre "
"portage vers Python 3 ! Mais afin de comprendre comment votre code va "
"changer et à quoi s'intéresser spécifiquement pendant que vous codez, vous "
"aurez sûrement envie de découvrir quels sont les changements introduits par "
"Python 3 par rapport à Python 2. Pour atteindre cet objectif, les deux "
"meilleurs moyens sont de lire le document `\"What's New\"`_ de chaque "
"version de Python 3 et le livre `Porting to Python 3`_ (gratuit en ligne). "
"Il y a également une `cheat sheet`_ très pratique du projet Python-Future."
#: ../Doc/howto/pyporting.rst:126 #: ../Doc/howto/pyporting.rst:126
msgid "Update your code" msgid "Update your code"
msgstr "" msgstr "Mettre à jour votre code"
#: ../Doc/howto/pyporting.rst:128 #: ../Doc/howto/pyporting.rst:128
msgid "" msgid ""
@ -242,6 +300,16 @@ msgid ""
"transform your application code knowing that any tests which fail is a " "transform your application code knowing that any tests which fail is a "
"translation failure." "translation failure."
msgstr "" msgstr ""
"Indépendamment de l'outil sur lequel se porte votre choix, celui-ci mettra à "
"jour votre code afin qu'il puisse être exécuté par Python 3 tout en "
"maintenant sa compatibilité avec la version de Python 2 dont vous êtes "
"parti. En fonction du niveau de prudence que vous visez, vous pouvez "
"exécuter l'outil sur votre suite de test d'abord puis inspecter visuellement "
"la différence afin de vous assurer que la transformation est exacte. Après "
"avoir transformé votre suite de test et vérifié que tous les tests "
"s'exécutent comme attendu, vous pouvez transformer le code de votre "
"application avec l'assurance que chaque test qui échoue correspond à un "
"échec de traduction."
#: ../Doc/howto/pyporting.rst:146 #: ../Doc/howto/pyporting.rst:146
msgid "" msgid ""
@ -256,6 +324,18 @@ msgid ""
"watch out for which can be considered large issues that may be hard to debug " "watch out for which can be considered large issues that may be hard to debug "
"if not watched for." "if not watched for."
msgstr "" msgstr ""
"Malheureusement les outils ne peuvent pas automatiser tous les changements "
"requis pour permettre à votre code de s'exécuter sous Python 3 et il y a "
"donc quelques points sur lesquels vous devrez travailler manuellement afin "
"d'atteindre la compatibilité totale Python 3 (les étapes nécessaires peuvent "
"varier en fonction de l'outil utilisé). Lisez la documentation de l'outil "
"que vous avez choisi afin d'identifier ce qu'il corrige par défaut et ce qui "
"peut être appliqué de façon optionnelle afin de savoir ce qui sera (ou non) "
"corrigé pour vous ou ce que vous devrez modifier vous-même (par exemple, le "
"remplacement ``io.open()`` plutôt que la fonction native ``open()`` est "
"inactif par défaut dans *Modernize*). Heureusement, il n'y a que quelques "
"points à surveiller qui peuvent réellement être considérés comme des "
"problèmes difficiles à déboguer si vous n'y prêtez pas attention."
#: ../Doc/howto/pyporting.rst:157 #: ../Doc/howto/pyporting.rst:157
msgid "Division" msgid "Division"
@ -271,16 +351,27 @@ msgid ""
"Q`` flag. If you have not been doing this then you will need to go through " "Q`` flag. If you have not been doing this then you will need to go through "
"your code and do two things:" "your code and do two things:"
msgstr "" msgstr ""
"Dans Python 3, ``5 / 2 == 2.5`` et non ``2``; toutes les divisions entre des "
"valeurs ``int`` renvoient un ``float``. Ce changement était en réalité "
"planifié depuis Python 2.2, publié en 2002. Depuis cette date, les "
"utilisateurs ont été encouragés à ajouter ``from __future__ import "
"division`` à tous les fichiers utilisant les opérateurs ``/`` et ``//`` ou à "
"exécuter l'interpréteur avec l'option ``-Q``. Si vous n'avez pas suivi cette "
"recommandation, vous devrez manuellement modifier votre code et effectuer "
"deux changements :"
#: ../Doc/howto/pyporting.rst:167 #: ../Doc/howto/pyporting.rst:167
msgid "Add ``from __future__ import division`` to your files" msgid "Add ``from __future__ import division`` to your files"
msgstr "" msgstr "Ajouter ``from __future__ import division`` à vos fichiers"
#: ../Doc/howto/pyporting.rst:168 #: ../Doc/howto/pyporting.rst:168
msgid "" msgid ""
"Update any division operator as necessary to either use ``//`` to use floor " "Update any division operator as necessary to either use ``//`` to use floor "
"division or continue using ``/`` and expect a float" "division or continue using ``/`` and expect a float"
msgstr "" msgstr ""
"Remplacer tous les opérateurs de division par ``//`` pour la division "
"entière, le cas échant, ou utiliser ``/`` et vous attendre à un résultat "
"flottant"
#: ../Doc/howto/pyporting.rst:171 #: ../Doc/howto/pyporting.rst:171
msgid "" msgid ""
@ -289,10 +380,16 @@ msgid ""
"then your code would begin to fail (e.g. a user-defined class that uses ``/" "then your code would begin to fail (e.g. a user-defined class that uses ``/"
"`` to signify some operation but not ``//`` for the same thing or at all)." "`` to signify some operation but not ``//`` for the same thing or at all)."
msgstr "" msgstr ""
"La raison pour laquelle ``/`` n'est pas simplement remplacé par ``//`` "
"automatiquement est que si un objet définit une méthode ``__truediv__`` mais "
"pas de méthode ``__floordiv__``, alors votre code pourrait produire une "
"erreur (par exemple, une classe définie par l'utilisateur qui utilise ``/`` "
"pour définir une opération quelconque mais pour laquelle ``//`` n'a pas du "
"tout la même signification, voire n'est pas utilisé du tout)."
#: ../Doc/howto/pyporting.rst:177 #: ../Doc/howto/pyporting.rst:177
msgid "Text versus binary data" msgid "Text versus binary data"
msgstr "" msgstr "Texte et données binaires"
#: ../Doc/howto/pyporting.rst:179 #: ../Doc/howto/pyporting.rst:179
msgid "" msgid ""
@ -305,6 +402,16 @@ msgid ""
"supporting multiple languages as APIs wouldn't bother explicitly supporting " "supporting multiple languages as APIs wouldn't bother explicitly supporting "
"``unicode`` when they claimed text data support." "``unicode`` when they claimed text data support."
msgstr "" msgstr ""
"Dans Python 2, il était possible d'utiliser le type ``str`` pour du texte et "
"pour des données binaires. Malheureusement cet amalgame entre deux concepts "
"différents peut conduire à du code fragile pouvant parfois fonctionner pour "
"les deux types de données et parfois non. Cela a également conduit à des API "
"confuses si les auteurs ne déclaraient pas explicitement que quelque chose "
"qui acceptait ``str`` était compatible avec du texte ou des données binaires "
"et pas un seul des deux types. Cela a compliqué la situation pour les "
"personnes devant gérer plusieurs langages avec des API qui ne se "
"préoccupaient pas de la gestion de ``unicode`` lorsqu'elles affirmaient être "
"compatibles avec des données au format texte."
#: ../Doc/howto/pyporting.rst:188 #: ../Doc/howto/pyporting.rst:188
msgid "" msgid ""
@ -340,35 +447,35 @@ msgstr ""
#: ../Doc/howto/pyporting.rst:214 #: ../Doc/howto/pyporting.rst:214
msgid "**Text data**" msgid "**Text data**"
msgstr "" msgstr "**Format texte**"
#: ../Doc/howto/pyporting.rst:214 #: ../Doc/howto/pyporting.rst:214
msgid "**Binary data**" msgid "**Binary data**"
msgstr "" msgstr "**Format binaire**"
#: ../Doc/howto/pyporting.rst:216 #: ../Doc/howto/pyporting.rst:216
msgid "\\" msgid "\\"
msgstr "" msgstr "\\"
#: ../Doc/howto/pyporting.rst:216 #: ../Doc/howto/pyporting.rst:216
msgid "decode" msgid "decode"
msgstr "" msgstr "decode"
#: ../Doc/howto/pyporting.rst:218 #: ../Doc/howto/pyporting.rst:218
msgid "encode" msgid "encode"
msgstr "" msgstr "encode"
#: ../Doc/howto/pyporting.rst:220 #: ../Doc/howto/pyporting.rst:220
msgid "format" msgid "format"
msgstr "" msgstr "format"
#: ../Doc/howto/pyporting.rst:222 #: ../Doc/howto/pyporting.rst:222
msgid "isdecimal" msgid "isdecimal"
msgstr "" msgstr "isdecimal"
#: ../Doc/howto/pyporting.rst:224 #: ../Doc/howto/pyporting.rst:224
msgid "isnumeric" msgid "isnumeric"
msgstr "" msgstr "isnumeric"
#: ../Doc/howto/pyporting.rst:227 #: ../Doc/howto/pyporting.rst:227
msgid "" msgid ""
@ -379,6 +486,14 @@ msgid ""
"possible. This allows your code to work with only text internally and thus " "possible. This allows your code to work with only text internally and thus "
"eliminates having to keep track of what type of data you are working with." "eliminates having to keep track of what type of data you are working with."
msgstr "" msgstr ""
"Vous pouvez rendre le problème plus simple à gérer en réalisant les "
"opérations d'encodage et de décodage entre données binaires et texte aux "
"extrémités de votre code. Cela signifie que lorsque vous recevez du texte "
"dans un format binaire, vous devez immédiatement le décoder. À l'inverse si "
"votre code doit transmettre du texte sous forme binaire, encodez-le le plus "
"tard possible. Cela vous permet de ne manipuler que du texte à l'intérieur "
"de votre code et permet de ne pas se préoccuper du type des données sur "
"lesquelles vous travaillez."
#: ../Doc/howto/pyporting.rst:234 #: ../Doc/howto/pyporting.rst:234
msgid "" msgid ""
@ -417,6 +532,16 @@ msgid ""
"back: ``str(b'3') == b'3'``. But in Python 3 you get the string " "back: ``str(b'3') == b'3'``. But in Python 3 you get the string "
"representation of the bytes object: ``str(b'3') == \"b'3'\"``." "representation of the bytes object: ``str(b'3') == \"b'3'\"``."
msgstr "" msgstr ""
"Les constructeurs des types ``str`` et ``bytes`` possèdent une sémantique "
"différente pour les mêmes arguments sous Python 2 et 3. Passer un entier à "
"``bytes`` sous Python 2 produit une représentation de cet entier en chaîne "
"de caractères : ``bytes(3) == '3'``. Mais sous Python 3, fournir un argument "
"entier à ``bytes`` produit un objet *bytes* de la longueur de l'entier "
"spécifié, rempli par des octets nuls : ``bytes(3) == b'\\x00\\x00\\x00'``. "
"La même prudence est nécessaire lorsque vous passez un objet *bytes* à "
"``str``. En Python 2, vous récupérez simplement l'objet *bytes* initial : "
"``str(b'3') == b'3'``. Mais en Python 3, vous récupérez la représentation en "
"chaîne de caractères de l'objet *bytes* : ``str(b'3') == \"b'3'\"``."
#: ../Doc/howto/pyporting.rst:262 #: ../Doc/howto/pyporting.rst:262
msgid "" msgid ""
@ -429,14 +554,25 @@ msgid ""
"``six.indexbytes()`` which will return an integer like in Python 3: ``six." "``six.indexbytes()`` which will return an integer like in Python 3: ``six."
"indexbytes(b'123', 1)``." "indexbytes(b'123', 1)``."
msgstr "" msgstr ""
"Enfin, l'indiçage des données binaires exige une manipulation prudente (bien "
"que le découpage, ou *slicing* en anglais, ne nécessite pas d'attention "
"particulière). En Python 2, ``b'123'[1] == b'2'`` tandis qu'en Python 3 "
"``b'123'[1] == 50``. Puisque les données binaires ne sont simplement qu'une "
"collection de nombres en binaire, Python 3 renvoie la valeur entière de "
"l'octet indicé. Mais en Python 2, étant donné que ``bytes == str``, "
"l'indiçage renvoie une tranche de longueur 1 de *bytes*. Le projet six_ "
"dispose d'une fonction appelée ``six.indexbytes()`` qui renvoie un entier "
"comme en Python 3 : ``six.indexbytes(b'123', 1)``."
#: ../Doc/howto/pyporting.rst:271 #: ../Doc/howto/pyporting.rst:271
msgid "To summarize:" msgid "To summarize:"
msgstr "" msgstr "Pour résumer :"
#: ../Doc/howto/pyporting.rst:273 #: ../Doc/howto/pyporting.rst:273
msgid "Decide which of your APIs take text and which take binary data" msgid "Decide which of your APIs take text and which take binary data"
msgstr "" msgstr ""
"Décidez lesquelles de vos API travaillent sur du texte et lesquelles "
"travaillent sur des données binaires"
#: ../Doc/howto/pyporting.rst:274 #: ../Doc/howto/pyporting.rst:274
msgid "" msgid ""
@ -444,6 +580,10 @@ msgid ""
"and code for binary data works with ``bytes`` in Python 2 (see the table " "and code for binary data works with ``bytes`` in Python 2 (see the table "
"above for what methods you cannot use for each type)" "above for what methods you cannot use for each type)"
msgstr "" msgstr ""
"Assurez vous que votre code travaillant sur du texte fonctionne aussi avec "
"le type ``unicode`` et que le code travaillant sur du binaire fonctionne "
"avec le type ``bytes`` en Python 2 (voir le tableau ci-dessus pour la liste "
"des méthodes utilisables par chaque type)"
#: ../Doc/howto/pyporting.rst:277 #: ../Doc/howto/pyporting.rst:277
msgid "" msgid ""
@ -456,12 +596,16 @@ msgid ""
"Decode binary data to text as soon as possible, encode text as binary data " "Decode binary data to text as soon as possible, encode text as binary data "
"as late as possible" "as late as possible"
msgstr "" msgstr ""
"Décodez les données binaires en texte dès que possible, encodez votre texte "
"au format binaire le plus tard possible"
#: ../Doc/howto/pyporting.rst:281 #: ../Doc/howto/pyporting.rst:281
msgid "" msgid ""
"Open files using :func:`io.open` and make sure to specify the ``b`` mode " "Open files using :func:`io.open` and make sure to specify the ``b`` mode "
"when appropriate" "when appropriate"
msgstr "" msgstr ""
"Ouvrez les fichiers avec la fonction :func:`io.open` et assurez-vous de "
"spécifier le mode ``b`` le cas échéant"
#: ../Doc/howto/pyporting.rst:283 #: ../Doc/howto/pyporting.rst:283
msgid "Be careful when indexing binary data" msgid "Be careful when indexing binary data"
@ -470,6 +614,7 @@ msgstr ""
#: ../Doc/howto/pyporting.rst:287 #: ../Doc/howto/pyporting.rst:287
msgid "Use feature detection instead of version detection" msgid "Use feature detection instead of version detection"
msgstr "" msgstr ""
"Utilisez la détection de fonctionnalités plutôt que la détection de version"
#: ../Doc/howto/pyporting.rst:288 #: ../Doc/howto/pyporting.rst:288
msgid "" msgid ""
@ -488,6 +633,11 @@ msgid ""
"Python 2 through importlib2_ on PyPI. You might be tempted to write code to " "Python 2 through importlib2_ on PyPI. You might be tempted to write code to "
"access e.g. the ``importlib.abc`` module by doing the following::" "access e.g. the ``importlib.abc`` module by doing the following::"
msgstr "" msgstr ""
"Supposons que vous avez besoin d'accéder à une fonctionnalité de importlib_ "
"qui n'est disponible dans la bibliothèque standard de Python que depuis la "
"version 3.3 et est disponible pour Python 2 via le module importlib2_ sur "
"PyPI. Vous pourriez être tenté d'écrire un code qui accède, par exemple, au "
"module ``importlib.abc`` avec l'approche suivante : ::"
#: ../Doc/howto/pyporting.rst:307 #: ../Doc/howto/pyporting.rst:307
msgid "" msgid ""
@ -496,6 +646,10 @@ msgid ""
"assume that future Python versions will be more compatible with Python 3 " "assume that future Python versions will be more compatible with Python 3 "
"than Python 2::" "than Python 2::"
msgstr "" msgstr ""
"Le problème est le suivant : que se passe-t-il lorsque Python 4 est publié ? "
"Il serait préférable de traiter le cas Python 2 comme l'exception plutôt que "
"Python 3 et de supposer que les versions futures de Python 2 seront plus "
"compatibles avec Python 3 qu'avec Python 2 : ::"
#: ../Doc/howto/pyporting.rst:319 #: ../Doc/howto/pyporting.rst:319
msgid "" msgid ""
@ -503,10 +657,14 @@ msgid ""
"rely on feature detection. That avoids any potential issues of getting the " "rely on feature detection. That avoids any potential issues of getting the "
"version detection wrong and helps keep you future-compatible::" "version detection wrong and helps keep you future-compatible::"
msgstr "" msgstr ""
"Néanmoins la meilleure solution est de ne pas chercher à déterminer la "
"version de Python mais plutôt à détecter les fonctionnalités disponibles. "
"Cela évite les problèmes potentiels liés aux erreurs de détection de version "
"et facilite la compatibilité future : ::"
#: ../Doc/howto/pyporting.rst:330 #: ../Doc/howto/pyporting.rst:330
msgid "Prevent compatibility regressions" msgid "Prevent compatibility regressions"
msgstr "" msgstr "Prévenir les régressions de compatibilité"
#: ../Doc/howto/pyporting.rst:332 #: ../Doc/howto/pyporting.rst:332
msgid "" msgid ""
@ -515,12 +673,19 @@ msgid ""
"Python 3. This is especially true if you have a dependency which is blocking " "Python 3. This is especially true if you have a dependency which is blocking "
"you from actually running under Python 3 at the moment." "you from actually running under Python 3 at the moment."
msgstr "" msgstr ""
"Une fois votre code traduit pour être compatible avec Python 3, vous devez "
"vous assurer que votre code n'a pas régressé ou qu'il ne fonctionne pas sous "
"Python 3. Ceci est particulièrement important si une de vos dépendances vous "
"empêche de réellement exécuter le code sous Python 3 pour le moment."
#: ../Doc/howto/pyporting.rst:337 #: ../Doc/howto/pyporting.rst:337
msgid "" msgid ""
"To help with staying compatible, any new modules you create should have at " "To help with staying compatible, any new modules you create should have at "
"least the following block of code at the top of it::" "least the following block of code at the top of it::"
msgstr "" msgstr ""
"Afin de vous aider à maintenir la compatibilité, nous préconisons que tous "
"les nouveaux modules que vous créez aient au moins le bloc de code suivant "
"en en-tête : ::"
#: ../Doc/howto/pyporting.rst:345 #: ../Doc/howto/pyporting.rst:345
msgid "" msgid ""
@ -529,6 +694,11 @@ msgid ""
"warnings into errors with ``-Werror`` then you can make sure that you don't " "warnings into errors with ``-Werror`` then you can make sure that you don't "
"accidentally miss a warning." "accidentally miss a warning."
msgstr "" msgstr ""
"Vous pouvez également lancer Python 2 avec le paramètre ``-3`` afin d'être "
"alerté en cas de divers problèmes de compatibilité que votre code déclenche "
"durant son exécution. Si vous transformez les avertissements en erreur avec "
"``-Werror``, vous pouvez être certain que ne passez pas accidentellement à "
"côté d'un avertissement."
#: ../Doc/howto/pyporting.rst:351 #: ../Doc/howto/pyporting.rst:351
msgid "" msgid ""
@ -539,10 +709,17 @@ msgid ""
"does require you only support Python 2.7 and Python 3.4 or newer as that is " "does require you only support Python 2.7 and Python 3.4 or newer as that is "
"Pylint's minimum Python version support." "Pylint's minimum Python version support."
msgstr "" msgstr ""
"Vous pouvez également utiliser le projet Pylint_ et son option ``--py3k`` "
"afin de modifier votre code pour recevoir des avertissements lorsque celui-"
"ci dévie de la compatibilité Python 3. Cela vous évite par ailleurs "
"d'appliquer Modernize_ ou Futurize_ sur votre code régulièrement pour "
"détecter des régressions liées à la compatibilité. Cependant cela nécessite "
"de votre part le support de Python 2.7 et Python 3.4 ou ultérieur étant "
"donné qu'il s'agit de la version minimale gérée par Pylint."
#: ../Doc/howto/pyporting.rst:360 #: ../Doc/howto/pyporting.rst:360
msgid "Check which dependencies block your transition" msgid "Check which dependencies block your transition"
msgstr "" msgstr "Vérifier quelles dépendances empêchent la migration"
#: ../Doc/howto/pyporting.rst:362 #: ../Doc/howto/pyporting.rst:362
msgid "" msgid ""
@ -562,10 +739,17 @@ msgid ""
"manually check your dependencies and to be notified quickly when you can " "manually check your dependencies and to be notified quickly when you can "
"start running on Python 3." "start running on Python 3."
msgstr "" msgstr ""
"Le projet fournit également du code intégrable dans votre suite de test qui "
"déclenchera un échec de test lorsque plus aucune de vos dépendances n'est "
"bloquante pour l'utilisation de Python 3. Cela vous permet de ne pas avoir à "
"vérifier manuellement vos dépendances et d'être notifié rapidement quand "
"vous pouvez exécuter votre application avec Python 3."
#: ../Doc/howto/pyporting.rst:375 #: ../Doc/howto/pyporting.rst:375
msgid "Update your ``setup.py`` file to denote Python 3 compatibility" msgid "Update your ``setup.py`` file to denote Python 3 compatibility"
msgstr "" msgstr ""
"Mettre à jour votre fichier ``setup.py`` pour spécifier la compatibilité "
"avec Python 3"
#: ../Doc/howto/pyporting.rst:377 #: ../Doc/howto/pyporting.rst:377
msgid "" msgid ""
@ -575,10 +759,16 @@ msgid ""
"that you support Python 2 **and** 3. Ideally you will also want to add " "that you support Python 2 **and** 3. Ideally you will also want to add "
"classifiers for each major/minor version of Python you now support." "classifiers for each major/minor version of Python you now support."
msgstr "" msgstr ""
"Une fois que votre code fonctionne sous Python 3, vous devez mettre à jour "
"vos classeurs dans votre ``setup.py`` pour inclure ``Programming Language :: "
"Python :: 3`` et non seulement le support de Python 2. Cela signifiera à "
"quiconque utilise votre code que vous gérez Python 2 **et** 3. Dans l'idéal "
"vous devrez aussi ajouter une mention pour chaque version majeure/mineure de "
"Python que vous supportez désormais."
#: ../Doc/howto/pyporting.rst:385 #: ../Doc/howto/pyporting.rst:385
msgid "Use continuous integration to stay compatible" msgid "Use continuous integration to stay compatible"
msgstr "" msgstr "Utiliser l'intégration continue pour maintenir la compatibilité"
#: ../Doc/howto/pyporting.rst:387 #: ../Doc/howto/pyporting.rst:387
msgid "" msgid ""
@ -588,6 +778,12 @@ msgid ""
"integrate tox with your continuous integration system so that you never " "integrate tox with your continuous integration system so that you never "
"accidentally break Python 2 or 3 support." "accidentally break Python 2 or 3 support."
msgstr "" msgstr ""
"Une fois que vous êtes en mesure d'exécuter votre code sous Python 3, vous "
"devrez vous assurer que celui-ci fonctionne toujours pour Python 2 & 3. tox_ "
"est vraisemblablement le meilleur outil pour exécuter vos tests avec "
"plusieurs interpréteurs Python. Vous pouvez alors intégrer *tox* à votre "
"système d'intégration continue afin de ne jamais accidentellement casser "
"votre gestion de Python 2 ou 3."
#: ../Doc/howto/pyporting.rst:393 #: ../Doc/howto/pyporting.rst:393
msgid "" msgid ""
@ -600,6 +796,15 @@ msgid ""
"these kinds of comparisons occur, making the mistake much easier to track " "these kinds of comparisons occur, making the mistake much easier to track "
"down." "down."
msgstr "" msgstr ""
"Vous pouvez également utiliser l'option ``-bb`` de l'interpréteur Python 3 "
"afin de déclencher une exception lorsque vous comparez des *bytes* à des "
"chaînes de caractères ou à un entier (cette deuxième possibilité est "
"disponible à partir de Python 3.5). Par défaut, des comparaisons entre types "
"différents renvoient simplement ``False`` mais si vous avez fait une erreur "
"dans votre séparation de la gestion texte/données binaires ou votre indiçage "
"des *bytes*, vous ne trouverez pas facilement le bogue. Ce drapeau lève une "
"exception lorsque ce genre de comparaison apparaît, facilitant ainsi sa "
"identification et sa localisation."
#: ../Doc/howto/pyporting.rst:401 #: ../Doc/howto/pyporting.rst:401
msgid "" msgid ""
@ -608,6 +813,11 @@ msgid ""
"don't accidentally break Python 2 or 3 compatibility regardless of which " "don't accidentally break Python 2 or 3 compatibility regardless of which "
"version you typically run your tests under while developing." "version you typically run your tests under while developing."
msgstr "" msgstr ""
"Et c'est à peu près tout ! Une fois ceci fait, votre code source est "
"compatible avec Python 2 et 3 simultanément. Votre suite de test est "
"également en place de telle sorte que vous ne cassiez pas la compatibilité "
"Python 2 ou 3 indépendamment de la version que vous utilisez pendant le "
"développement."
#: ../Doc/howto/pyporting.rst:408 #: ../Doc/howto/pyporting.rst:408
msgid "Dropping Python 2 support completely" msgid "Dropping Python 2 support completely"

View File

@ -467,17 +467,19 @@ msgstr ""
#: ../Doc/howto/unicode.rst:231 #: ../Doc/howto/unicode.rst:231
msgid "Python's Unicode Support" msgid "Python's Unicode Support"
msgstr "" msgstr "Prise en charge Unicode de Python"
#: ../Doc/howto/unicode.rst:233 #: ../Doc/howto/unicode.rst:233
msgid "" msgid ""
"Now that you've learned the rudiments of Unicode, we can look at Python's " "Now that you've learned the rudiments of Unicode, we can look at Python's "
"Unicode features." "Unicode features."
msgstr "" msgstr ""
"Maintenant que vous avez appris les rudiments de l'Unicode, nous pouvons "
"regarder les fonctionnalités Unicode de Python."
#: ../Doc/howto/unicode.rst:237 #: ../Doc/howto/unicode.rst:237
msgid "The String Type" msgid "The String Type"
msgstr "" msgstr "Le type *String*"
#: ../Doc/howto/unicode.rst:239 #: ../Doc/howto/unicode.rst:239
msgid "" msgid ""
@ -492,6 +494,8 @@ msgid ""
"The default encoding for Python source code is UTF-8, so you can simply " "The default encoding for Python source code is UTF-8, so you can simply "
"include a Unicode character in a string literal::" "include a Unicode character in a string literal::"
msgstr "" msgstr ""
"L'encodage par défaut pour le code source Python est UTF-8, il est donc "
"facile d'inclure des caractères Unicode dans une chaîne littérale ::"
#: ../Doc/howto/unicode.rst:253 #: ../Doc/howto/unicode.rst:253
msgid "" msgid ""
@ -503,6 +507,7 @@ msgstr ""
msgid "" msgid ""
"Side note: Python 3 also supports using Unicode characters in identifiers::" "Side note: Python 3 also supports using Unicode characters in identifiers::"
msgstr "" msgstr ""
"Note : Python 3 sait gérer les caractères Unicode dans les identifiants ::"
#: ../Doc/howto/unicode.rst:264 #: ../Doc/howto/unicode.rst:264
msgid "" msgid ""
@ -511,6 +516,12 @@ msgid ""
"string literals. (Depending on your system, you may see the actual capital-" "string literals. (Depending on your system, you may see the actual capital-"
"delta glyph instead of a \\u escape.) ::" "delta glyph instead of a \\u escape.) ::"
msgstr "" msgstr ""
"Si vous ne pouvez pas entrer un caractère particulier dans votre éditeur ou "
"si vous voulez garder le code source uniquement en ASCII pour une raison "
"quelconque, vous pouvez également utiliser des séquences d'échappement dans "
"les littéraux de chaîne (en fonction de votre système, il se peut que vous "
"voyez le glyphe réel du *delta majuscule* au lieu d'une séquence "
"d'échappement ``\\u...``) ::"
#: ../Doc/howto/unicode.rst:276 #: ../Doc/howto/unicode.rst:276
msgid "" msgid ""
@ -518,6 +529,10 @@ msgid ""
"of :class:`bytes`. This method takes an *encoding* argument, such as " "of :class:`bytes`. This method takes an *encoding* argument, such as "
"``UTF-8``, and optionally an *errors* argument." "``UTF-8``, and optionally an *errors* argument."
msgstr "" msgstr ""
"De plus, une chaîne de caractères peut être créée en utilisant la méthode :"
"func:`~bytes.decode` de la classe :class:`bytes`. Cette méthode prend un "
"argument *encoding*, ``UTF-8`` par exemple, et optionnellement un argument "
"*errors*."
#: ../Doc/howto/unicode.rst:280 #: ../Doc/howto/unicode.rst:280
msgid "" msgid ""
@ -529,6 +544,14 @@ msgid ""
"``'backslashreplace'`` (inserts a ``\\xNN`` escape sequence). The following " "``'backslashreplace'`` (inserts a ``\\xNN`` escape sequence). The following "
"examples show the differences::" "examples show the differences::"
msgstr "" msgstr ""
"L'argument *errors* détermine la réponse lorsque la chaîne en entrée ne peut "
"pas être convertie selon les règles de l'encodage. Les valeurs autorisées "
"pour cet argument sont ``'strict'`` (« strict » : lève une exception :exc:"
"`UnicodeDecodeError`) , ``'replace'`` (« remplacer » : utilise ``U+FFFD``, "
"``REPLACEMENT CARACTER``), ``'ignore'`` (« ignorer » : n'inclut pas le "
"caractère dans le résultat Unicode) ou ``'backslashreplace'`` (« remplacer "
"avec antislash » : insère une séquence déchappement ``\\xNN``). Les "
"exemples suivants illustrent les différences ::"
#: ../Doc/howto/unicode.rst:300 #: ../Doc/howto/unicode.rst:300
msgid "" msgid ""
@ -547,10 +570,15 @@ msgid ""
"built-in :func:`ord` function that takes a one-character Unicode string and " "built-in :func:`ord` function that takes a one-character Unicode string and "
"returns the code point value::" "returns the code point value::"
msgstr "" msgstr ""
"Des chaînes Unicode à un caractère peuvent également être créées avec la "
"fonction native :func:`chr`, qui prend des entiers et renvoie une chaîne "
"Unicode de longueur 1 qui contient le point de code correspondant. "
"L'opération inverse est la fonction native :func:`ord` qui prend une chaîne "
"Unicode d'un caractère et renvoie la valeur du point de code ::"
#: ../Doc/howto/unicode.rst:318 #: ../Doc/howto/unicode.rst:318
msgid "Converting to Bytes" msgid "Converting to Bytes"
msgstr "" msgstr "Conversion en octets"
#: ../Doc/howto/unicode.rst:320 #: ../Doc/howto/unicode.rst:320
msgid "" msgid ""
@ -558,6 +586,9 @@ msgid ""
"returns a :class:`bytes` representation of the Unicode string, encoded in " "returns a :class:`bytes` representation of the Unicode string, encoded in "
"the requested *encoding*." "the requested *encoding*."
msgstr "" msgstr ""
"La méthode inverse de :meth:`bytes.decode` est :meth:`str.encode`, qui "
"renvoie une représentation :class:`bytes` de la chaîne Unicode, codée dans "
"lencodage *encoding* demandé."
#: ../Doc/howto/unicode.rst:324 #: ../Doc/howto/unicode.rst:324
msgid "" msgid ""
@ -569,10 +600,17 @@ msgid ""
"``backslashreplace`` (inserts a ``\\uNNNN`` escape sequence) and " "``backslashreplace`` (inserts a ``\\uNNNN`` escape sequence) and "
"``namereplace`` (inserts a ``\\N{...}`` escape sequence)." "``namereplace`` (inserts a ``\\N{...}`` escape sequence)."
msgstr "" msgstr ""
"Le paramètre *errors* est le même que le paramètre de la méthode :meth:"
"`~bytes.decode` mais possède quelques gestionnaires supplémentaires. En plus "
"de ``'strict'``, ``'ignore'`` et ``'remplace'`` (qui dans ce cas insère un "
"point d'interrogation au lieu du caractère non codable), il y a aussi "
"``'xmlcharrefreplace'`` (insère une référence XML), ``backslashreplace`` "
"(insère une séquence ``\\uNNNN``) et ``namereplace`` (insère une séquence ``"
"\\N{...}``)."
#: ../Doc/howto/unicode.rst:332 #: ../Doc/howto/unicode.rst:332
msgid "The following example shows the different results::" msgid "The following example shows the different results::"
msgstr "" msgstr "L'exemple suivant montre les différents résultats ::"
#: ../Doc/howto/unicode.rst:353 #: ../Doc/howto/unicode.rst:353
msgid "" msgid ""
@ -583,10 +621,17 @@ msgid ""
"is comfortable, and writing new encodings is a specialized task, so the " "is comfortable, and writing new encodings is a specialized task, so the "
"module won't be covered in this HOWTO." "module won't be covered in this HOWTO."
msgstr "" msgstr ""
"Les routines de bas niveau pour enregistrer et accéder aux encodages "
"disponibles se trouvent dans le module :mod:`codecs`. L'implémentation de "
"nouveaux encodages nécessite également de comprendre le module :mod:"
"`codecs`. Cependant, les fonctions d'encodage et de décodage renvoyées par "
"ce module sont généralement de bas-niveau pour être facilement utilisées et "
"l'écriture de nouveaux encodages est une tâche très spécialisée, donc le "
"module ne sera pas couvert dans ce HOWTO."
#: ../Doc/howto/unicode.rst:362 #: ../Doc/howto/unicode.rst:362
msgid "Unicode Literals in Python Source Code" msgid "Unicode Literals in Python Source Code"
msgstr "" msgstr "Littéraux Unicode dans le code source Python"
#: ../Doc/howto/unicode.rst:364 #: ../Doc/howto/unicode.rst:364
msgid "" msgid ""
@ -595,6 +640,10 @@ msgid ""
"code point. The ``\\U`` escape sequence is similar, but expects eight hex " "code point. The ``\\U`` escape sequence is similar, but expects eight hex "
"digits, not four::" "digits, not four::"
msgstr "" msgstr ""
"Dans le code source Python, des points de code Unicode spécifiques peuvent "
"être écrits en utilisant la séquence d'échappement ``\\u``, suivie de quatre "
"chiffres hexadécimaux donnant le point de code. La séquence d'échappement ``"
"\\U`` est similaire, mais attend huit chiffres hexadécimaux, pas quatre ::"
#: ../Doc/howto/unicode.rst:376 #: ../Doc/howto/unicode.rst:376
msgid "" msgid ""
@ -604,6 +653,12 @@ msgid ""
"language. You can also assemble strings using the :func:`chr` built-in " "language. You can also assemble strings using the :func:`chr` built-in "
"function, but this is even more tedious." "function, but this is even more tedious."
msgstr "" msgstr ""
"L'utilisation de séquences d'échappement pour des points de code supérieurs "
"à 127 est acceptable à faible dose, mais devient gênante si vous utilisez "
"beaucoup de caractères accentués, comme c'est le cas dans un programme avec "
"des messages en français ou dans une autre langue utilisant des lettres "
"accentuées. Vous pouvez également assembler des chaînes de caractères à "
"l'aide de la fonction native :func:`chr`, mais c'est encore plus fastidieux."
#: ../Doc/howto/unicode.rst:382 #: ../Doc/howto/unicode.rst:382
msgid "" msgid ""
@ -612,6 +667,10 @@ msgid ""
"which would display the accented characters naturally, and have the right " "which would display the accented characters naturally, and have the right "
"characters used at runtime." "characters used at runtime."
msgstr "" msgstr ""
"Idéalement, vous devriez être capable d'écrire des littéraux dans l'encodage "
"naturel de votre langue. Vous pourriez alors éditer le code source de "
"Python avec votre éditeur favori qui affiche les caractères accentués "
"naturellement, et a les bons caractères utilisés au moment de l'exécution."
#: ../Doc/howto/unicode.rst:387 #: ../Doc/howto/unicode.rst:387
msgid "" msgid ""
@ -620,6 +679,10 @@ msgid ""
"including a special comment as either the first or second line of the source " "including a special comment as either the first or second line of the source "
"file::" "file::"
msgstr "" msgstr ""
"Python considère que le code source est écrit en UTF-8 par défaut, mais vous "
"pouvez utiliser presque n'importe quel encodage si vous déclarez l'encodage "
"utilisé. Cela se fait en incluant un commentaire spécial sur la première ou "
"la deuxième ligne du fichier source ::"
#: ../Doc/howto/unicode.rst:397 #: ../Doc/howto/unicode.rst:397
msgid "" msgid ""
@ -629,16 +692,24 @@ msgid ""
"special; they have no significance to Python but are a convention. Python " "special; they have no significance to Python but are a convention. Python "
"looks for ``coding: name`` or ``coding=name`` in the comment." "looks for ``coding: name`` or ``coding=name`` in the comment."
msgstr "" msgstr ""
"La syntaxe s'inspire de la notation d'Emacs pour spécifier les variables "
"locales à un fichier. *Emacs* supporte de nombreuses variables différentes, "
"mais Python ne gère que *coding*. Les symboles ``-*-`` indiquent à Emacs "
"que le commentaire est spécial ; ils n'ont aucune signification pour Python "
"mais sont une convention. Python cherche ``coding: name`` ou "
"``coding=name`` dans le commentaire."
#: ../Doc/howto/unicode.rst:403 #: ../Doc/howto/unicode.rst:403
msgid "" msgid ""
"If you don't include such a comment, the default encoding used will be UTF-8 " "If you don't include such a comment, the default encoding used will be UTF-8 "
"as already mentioned. See also :pep:`263` for more information." "as already mentioned. See also :pep:`263` for more information."
msgstr "" msgstr ""
"Si vous n'incluez pas un tel commentaire, l'encodage par défaut est UTF-8 "
"comme déjà mentionné. Voir aussi la :pep:`263` pour plus d'informations."
#: ../Doc/howto/unicode.rst:408 #: ../Doc/howto/unicode.rst:408
msgid "Unicode Properties" msgid "Unicode Properties"
msgstr "" msgstr "Propriétés Unicode"
#: ../Doc/howto/unicode.rst:410 #: ../Doc/howto/unicode.rst:410
msgid "" msgid ""
@ -655,10 +726,12 @@ msgid ""
"The following program displays some information about several characters, " "The following program displays some information about several characters, "
"and prints the numeric value of one particular character::" "and prints the numeric value of one particular character::"
msgstr "" msgstr ""
"Le programme suivant affiche des informations sur plusieurs caractères et "
"affiche la valeur numérique d'un caractère particulier ::"
#: ../Doc/howto/unicode.rst:431 #: ../Doc/howto/unicode.rst:431
msgid "When run, this prints:" msgid "When run, this prints:"
msgstr "" msgstr "Si vous l'exécutez, cela affiche :"
#: ../Doc/howto/unicode.rst:442 #: ../Doc/howto/unicode.rst:442
msgid "" msgid ""
@ -672,10 +745,20 @@ msgid ""
"unicode.org/reports/tr44/#General_Category_Values>`_ for a list of category " "unicode.org/reports/tr44/#General_Category_Values>`_ for a list of category "
"codes." "codes."
msgstr "" msgstr ""
"Les codes de catégorie sont des abréviations décrivant la nature du "
"caractère. Celles-ci sont regroupées en catégories telles que « Lettre », "
 Nombre », « Ponctuation » ou « Symbole », qui sont à leur tour divisées en "
"sous-catégories. Pour prendre par exemple les codes de la sortie ci-dessus, "
"``'Ll'`` signifie « Lettre, minuscules », ``'No'`` signifie « Nombre, "
"autre », ``'Mn'`` est « Marque, non-espaçant », et ``'So'`` est « Symbole, "
"autre ». Voir la section `Valeurs générales des catégories de la "
"documentation de la base de données de caractères Unicode <http://www."
"unicode.org/reports/tr44/#General_Category_Values>`_ (ressource en anglais) "
"pour une liste de codes de catégories."
#: ../Doc/howto/unicode.rst:453 #: ../Doc/howto/unicode.rst:453
msgid "Unicode Regular Expressions" msgid "Unicode Regular Expressions"
msgstr "" msgstr "Expressions régulières Unicode"
#: ../Doc/howto/unicode.rst:455 #: ../Doc/howto/unicode.rst:455
msgid "" msgid ""
@ -686,12 +769,20 @@ msgid ""
"characters ``[0-9]`` in bytes but in strings will match any character that's " "characters ``[0-9]`` in bytes but in strings will match any character that's "
"in the ``'Nd'`` category." "in the ``'Nd'`` category."
msgstr "" msgstr ""
"Les expressions régulières gérées par le module :mod:`re` peuvent être "
"fournies sous forme de chaîne d'octets ou de texte. Certaines séquences de "
"caractères spéciaux telles que ``\\d`` et ``\\w`` ont des significations "
"différentes selon que le motif est fourni en octets ou en texte. Par "
"exemple, ``\\d`` correspond aux caractères ``[0-9]`` en octets mais dans les "
"chaînes de caractères correspond à tout caractère de la catégorie ``'Nd'``."
#: ../Doc/howto/unicode.rst:462 #: ../Doc/howto/unicode.rst:462
msgid "" msgid ""
"The string in this example has the number 57 written in both Thai and Arabic " "The string in this example has the number 57 written in both Thai and Arabic "
"numerals::" "numerals::"
msgstr "" msgstr ""
"Dans cet exemple, la chaîne contient le nombre 57 écrit en chiffres arabes "
"et thaïlandais ::"
#: ../Doc/howto/unicode.rst:472 #: ../Doc/howto/unicode.rst:472
msgid "" msgid ""
@ -699,6 +790,9 @@ msgid ""
"you supply the :const:`re.ASCII` flag to :func:`~re.compile`, ``\\d+`` will " "you supply the :const:`re.ASCII` flag to :func:`~re.compile`, ``\\d+`` will "
"match the substring \"57\" instead." "match the substring \"57\" instead."
msgstr "" msgstr ""
"Une fois exécuté, ``\\d+`` correspond aux chiffres thaïlandais et les "
"affiche. Si vous fournissez le drapeau :const:`re.ASCII` à :func:`~re."
"compile`, ``\\d+`` correspond cette fois à la chaîne \"57\"."
#: ../Doc/howto/unicode.rst:476 #: ../Doc/howto/unicode.rst:476
msgid "" msgid ""
@ -706,16 +800,24 @@ msgid ""
"``[a-zA-Z0-9_]`` in bytes or if :const:`re.ASCII` is supplied, and ``\\s`` " "``[a-zA-Z0-9_]`` in bytes or if :const:`re.ASCII` is supplied, and ``\\s`` "
"will match either Unicode whitespace characters or ``[ \\t\\n\\r\\f\\v]``." "will match either Unicode whitespace characters or ``[ \\t\\n\\r\\f\\v]``."
msgstr "" msgstr ""
"De même, ``\\w`` correspond à une grande variété de caractères Unicode mais "
"seulement ``[a-zA-Z0-9_]`` en octets (ou si :const:`re.ASCII` est fourni) et "
"``\\s`` correspond soit aux caractères blancs Unicode soit aux caractères "
"``[ \\t\\n\\r\\f\\v]``."
#: ../Doc/howto/unicode.rst:487 #: ../Doc/howto/unicode.rst:487
msgid "Some good alternative discussions of Python's Unicode support are:" msgid "Some good alternative discussions of Python's Unicode support are:"
msgstr "" msgstr ""
"Quelques bonnes discussions alternatives sur la gestion d'Unicode par Python "
"sont :"
#: ../Doc/howto/unicode.rst:489 #: ../Doc/howto/unicode.rst:489
msgid "" msgid ""
"`Processing Text Files in Python 3 <http://python-notes.curiousefficiency." "`Processing Text Files in Python 3 <http://python-notes.curiousefficiency."
"org/en/latest/python3/text_file_processing.html>`_, by Nick Coghlan." "org/en/latest/python3/text_file_processing.html>`_, by Nick Coghlan."
msgstr "" msgstr ""
"`Processing Text Files in Python 3 <http://python-notes.curiousefficiency."
"org/en/latest/python3/text_file_processing.html>`_, par Nick Coghlan."
#: ../Doc/howto/unicode.rst:490 #: ../Doc/howto/unicode.rst:490
msgid "" msgid ""
@ -728,14 +830,16 @@ msgid ""
"The :class:`str` type is described in the Python library reference at :ref:" "The :class:`str` type is described in the Python library reference at :ref:"
"`textseq`." "`textseq`."
msgstr "" msgstr ""
"Le type :class:`str` est décrit dans la référence de la bibliothèque Python "
"à :ref:`textseq`."
#: ../Doc/howto/unicode.rst:495 #: ../Doc/howto/unicode.rst:495
msgid "The documentation for the :mod:`unicodedata` module." msgid "The documentation for the :mod:`unicodedata` module."
msgstr "" msgstr "La documentation du module :mod:`unicodedata`."
#: ../Doc/howto/unicode.rst:497 #: ../Doc/howto/unicode.rst:497
msgid "The documentation for the :mod:`codecs` module." msgid "The documentation for the :mod:`codecs` module."
msgstr "" msgstr "La documentation du module :mod:`codecs`."
#: ../Doc/howto/unicode.rst:499 #: ../Doc/howto/unicode.rst:499
msgid "" msgid ""
@ -745,10 +849,16 @@ msgid ""
"Python 2's Unicode features (where the Unicode string type is called " "Python 2's Unicode features (where the Unicode string type is called "
"``unicode`` and literals start with ``u``)." "``unicode`` and literals start with ``u``)."
msgstr "" msgstr ""
"Marc-André Lemburg a donné une présentation intitulée `« Python et "
"Unicode » (diapositives PDF) <https://downloads.egenix.com/python/Unicode-"
"EPC2002-Talk.pdf>`_ à EuroPython 2002. Les diapositives sont un excellent "
"aperçu de la conception des fonctionnalités Unicode de Python 2 (où le type "
"de chaîne Unicode est appelé ``unicode`` et les littéraux commencent par "
"``u``)."
#: ../Doc/howto/unicode.rst:507 #: ../Doc/howto/unicode.rst:507
msgid "Reading and Writing Unicode Data" msgid "Reading and Writing Unicode Data"
msgstr "" msgstr "Lecture et écriture de données Unicode"
#: ../Doc/howto/unicode.rst:509 #: ../Doc/howto/unicode.rst:509
msgid "" msgid ""
@ -756,6 +866,10 @@ msgid ""
"is input/output. How do you get Unicode strings into your program, and how " "is input/output. How do you get Unicode strings into your program, and how "
"do you convert Unicode into a form suitable for storage or transmission?" "do you convert Unicode into a form suitable for storage or transmission?"
msgstr "" msgstr ""
"Une fois que vous avez écrit du code qui fonctionne avec des données "
"Unicode, le problème suivant concerne les entrées/sorties. Comment obtenir "
"des chaînes Unicode dans votre programme et comment convertir les chaînes "
"Unicode dans une forme appropriée pour le stockage ou la transmission ?"
#: ../Doc/howto/unicode.rst:513 #: ../Doc/howto/unicode.rst:513
msgid "" msgid ""
@ -765,6 +879,13 @@ msgid ""
"Unicode data, for example. Many relational databases also support Unicode-" "Unicode data, for example. Many relational databases also support Unicode-"
"valued columns and can return Unicode values from an SQL query." "valued columns and can return Unicode values from an SQL query."
msgstr "" msgstr ""
"Il est possible que vous n'ayez rien à faire en fonction de vos sources "
"d'entrée et des destinations de vos données de sortie ; il convient de "
"vérifier si les bibliothèques utilisées dans votre application gèrent "
"l'Unicode nativement. Par exemple, les analyseurs XML renvoient souvent des "
"données Unicode. De nombreuses bases de données relationnelles prennent "
"également en charge les colonnes encodées en Unicode et peuvent renvoyer des "
"valeurs Unicode à partir d'une requête SQL."
#: ../Doc/howto/unicode.rst:519 #: ../Doc/howto/unicode.rst:519
msgid "" msgid ""
@ -774,6 +895,11 @@ msgid ""
"bytes with ``bytes.decode(encoding)``. However, the manual approach is not " "bytes with ``bytes.decode(encoding)``. However, the manual approach is not "
"recommended." "recommended."
msgstr "" msgstr ""
"Les données Unicode sont généralement converties en un encodage particulier "
"avant d'être écrites sur le disque ou envoyées sur un connecteur réseau. Il "
"est possible de faire tout le travail vous-même : ouvrir un fichier, lire un "
"élément 8-bits, puis convertir les octets avec ``bytes.decode(encoding)``. "
"Cependant, l'approche manuelle n'est pas recommandée."
#: ../Doc/howto/unicode.rst:524 #: ../Doc/howto/unicode.rst:524
msgid "" msgid ""
@ -788,6 +914,17 @@ msgid ""
"least a moment you'd need to have both the encoded string and its Unicode " "least a moment you'd need to have both the encoded string and its Unicode "
"version in memory.)" "version in memory.)"
msgstr "" msgstr ""
"La nature multi-octets des encodages pose problème ; un caractère Unicode "
"peut être représenté par plusieurs octets. Si vous voulez lire le fichier "
"par morceaux de taille arbitraire (disons 1024 ou 4096 octets), vous devez "
"écrire un code de gestion des erreurs pour détecter le cas où une partie "
"seulement des octets codant un seul caractère Unicode est lue à la fin d'un "
"morceau. Une solution serait de lire le fichier entier en mémoire et "
"d'effectuer le décodage, mais cela vous empêche de travailler avec des "
"fichiers extrêmement volumineux ; si vous avez besoin de lire un fichier de "
"2 GiB, vous avez besoin de 2 GiB de RAM (plus que ça, en fait, puisque "
"pendant un moment, vous aurez besoin d'avoir à la fois la chaîne encodée et "
"sa version Unicode en mémoire)."
#: ../Doc/howto/unicode.rst:534 #: ../Doc/howto/unicode.rst:534
msgid "" msgid ""
@ -800,16 +937,27 @@ msgid ""
"*encoding* and *errors* parameters which are interpreted just like those in :" "*encoding* and *errors* parameters which are interpreted just like those in :"
"meth:`str.encode` and :meth:`bytes.decode`." "meth:`str.encode` and :meth:`bytes.decode`."
msgstr "" msgstr ""
"La solution serait d'utiliser l'interface de décodage de bas-niveau pour "
"intercepter le cas des séquences d'encodage incomplètes. Ce travail "
"d'implémentation a déjà été fait pour vous : la fonction native :func:`open` "
"peut renvoyer un objet de type fichier qui suppose que le contenu du fichier "
"est dans un encodage spécifié et accepte les paramètres Unicode pour des "
"méthodes telles que :meth:`~io.TextIOBase.read` et :meth:`~io.TextIOBase."
"write`. Ceci fonctionne grâce aux paramètres *encoding* et *errors* de :"
"func:`open` qui sont interprétés comme ceux de :meth:`str.encode` et :meth:"
"`bytes.decode`."
#: ../Doc/howto/unicode.rst:543 #: ../Doc/howto/unicode.rst:543
msgid "Reading Unicode from a file is therefore simple::" msgid "Reading Unicode from a file is therefore simple::"
msgstr "" msgstr "Lire de l'Unicode à partir d'un fichier est donc simple ::"
#: ../Doc/howto/unicode.rst:549 #: ../Doc/howto/unicode.rst:549
msgid "" msgid ""
"It's also possible to open files in update mode, allowing both reading and " "It's also possible to open files in update mode, allowing both reading and "
"writing::" "writing::"
msgstr "" msgstr ""
"Il est également possible d'ouvrir des fichiers en mode « mise à jour », "
"permettant à la fois la lecture et l'écriture ::"
#: ../Doc/howto/unicode.rst:557 #: ../Doc/howto/unicode.rst:557
msgid "" msgid ""
@ -823,6 +971,17 @@ msgid ""
"endian encodings, that specify one particular byte ordering and don't skip " "endian encodings, that specify one particular byte ordering and don't skip "
"the BOM." "the BOM."
msgstr "" msgstr ""
"Le caractère Unicode ``U+FEFFF`` est utilisé comme marque pour indiquer le "
"boutisme (c'est-à-dire l'ordre dans lequel les octets sont placés pour "
"indiquer une valeur sur plusieurs octets, *byte-order mark* en anglais ou "
"*BOM*), et est souvent écrit en tête (premier caractère) d'un fichier afin "
"d'aider à l'auto-détection du boutisme du fichier. Certains encodages, "
"comme UTF-16, s'attendent à ce qu'une BOM soit présente au début d'un "
"fichier ; lorsqu'un tel encodage est utilisé, la BOM sera automatiquement "
"écrite comme premier caractère et sera silencieusement retirée lorsque le "
"fichier sera lu. Il existe des variantes de ces encodages, comme ``utf-16-"
"le`` et ``utf-16-be`` pour les encodages petit-boutiste et gros-boutiste, "
"qui spécifient un ordre d'octets donné et ne sautent pas la BOM."
#: ../Doc/howto/unicode.rst:566 #: ../Doc/howto/unicode.rst:566
msgid "" msgid ""
@ -835,7 +994,7 @@ msgstr ""
#: ../Doc/howto/unicode.rst:574 #: ../Doc/howto/unicode.rst:574
msgid "Unicode filenames" msgid "Unicode filenames"
msgstr "" msgstr "Noms de fichiers Unicode"
#: ../Doc/howto/unicode.rst:576 #: ../Doc/howto/unicode.rst:576
msgid "" msgid ""
@ -857,12 +1016,20 @@ msgid ""
"writing, you can usually just provide the Unicode string as the filename, " "writing, you can usually just provide the Unicode string as the filename, "
"and it will be automatically converted to the right encoding for you::" "and it will be automatically converted to the right encoding for you::"
msgstr "" msgstr ""
"La fonction :func:`sys.getfilesystemencoding` renvoie l'encodage à utiliser "
"sur votre système actuel, au cas où vous voudriez faire l'encodage "
"manuellement, mais il n'y a pas vraiment de raisons de s'embêter avec ça. "
"Lors de l'ouverture d'un fichier pour la lecture ou l'écriture, vous pouvez "
"généralement simplement fournir la chaîne Unicode comme nom de fichier et "
"elle est automatiquement convertie à l'encodage qui convient ::"
#: ../Doc/howto/unicode.rst:595 #: ../Doc/howto/unicode.rst:595
msgid "" msgid ""
"Functions in the :mod:`os` module such as :func:`os.stat` will also accept " "Functions in the :mod:`os` module such as :func:`os.stat` will also accept "
"Unicode filenames." "Unicode filenames."
msgstr "" msgstr ""
"Les fonctions du module :mod:`os` telles que :func:`os.stat` acceptent "
"également les noms de fichiers Unicode."
#: ../Doc/howto/unicode.rst:598 #: ../Doc/howto/unicode.rst:598
msgid "" msgid ""
@ -879,13 +1046,15 @@ msgstr ""
#: ../Doc/howto/unicode.rst:616 #: ../Doc/howto/unicode.rst:616
msgid "will produce the following output:" msgid "will produce the following output:"
msgstr "" msgstr "produit la sortie suivante :"
#: ../Doc/howto/unicode.rst:624 #: ../Doc/howto/unicode.rst:624
msgid "" msgid ""
"The first list contains UTF-8-encoded filenames, and the second list " "The first list contains UTF-8-encoded filenames, and the second list "
"contains the Unicode versions." "contains the Unicode versions."
msgstr "" msgstr ""
"La première liste contient les noms de fichiers encodés en UTF-8 et la "
"seconde contient les versions Unicode."
#: ../Doc/howto/unicode.rst:627 #: ../Doc/howto/unicode.rst:627
msgid "" msgid ""
@ -896,23 +1065,28 @@ msgstr ""
#: ../Doc/howto/unicode.rst:633 #: ../Doc/howto/unicode.rst:633
msgid "Tips for Writing Unicode-aware Programs" msgid "Tips for Writing Unicode-aware Programs"
msgstr "" msgstr "Conseils pour écrire des programmes compatibles Unicode"
#: ../Doc/howto/unicode.rst:635 #: ../Doc/howto/unicode.rst:635
msgid "" msgid ""
"This section provides some suggestions on writing software that deals with " "This section provides some suggestions on writing software that deals with "
"Unicode." "Unicode."
msgstr "" msgstr ""
"Cette section fournit quelques suggestions sur l'écriture de logiciels qui "
"traitent de l'Unicode."
#: ../Doc/howto/unicode.rst:638 #: ../Doc/howto/unicode.rst:638
msgid "The most important tip is:" msgid "The most important tip is:"
msgstr "" msgstr "Le conseil le plus important est:"
#: ../Doc/howto/unicode.rst:640 #: ../Doc/howto/unicode.rst:640
msgid "" msgid ""
"Software should only work with Unicode strings internally, decoding the " "Software should only work with Unicode strings internally, decoding the "
"input data as soon as possible and encoding the output only at the end." "input data as soon as possible and encoding the output only at the end."
msgstr "" msgstr ""
"Il convient que le logiciel ne traite que des chaînes Unicode en interne, "
"décodant les données d'entrée dès que possible et encodant la sortie "
"uniquement à la fin."
#: ../Doc/howto/unicode.rst:643 #: ../Doc/howto/unicode.rst:643
msgid "" msgid ""
@ -922,6 +1096,12 @@ msgid ""
"or decoding: if you do e.g. ``str + bytes``, a :exc:`TypeError` will be " "or decoding: if you do e.g. ``str + bytes``, a :exc:`TypeError` will be "
"raised." "raised."
msgstr "" msgstr ""
"Si vous essayez d'écrire des fonctions de traitement qui acceptent à la fois "
"les chaînes Unicode et les chaînes d'octets, les possibilités d'occurrences "
"de bogues dans votre programme augmentent partout où vous combinez les deux "
"différents types de chaînes. Il n'y a pas d'encodage ou de décodage "
"automatique : si vous faites par exemple ``str + octets``, une :exc:"
"`TypeError` est levée."
#: ../Doc/howto/unicode.rst:648 #: ../Doc/howto/unicode.rst:648
msgid "" msgid ""
@ -934,10 +1114,21 @@ msgid ""
"true if the input data also specifies the encoding, since the attacker can " "true if the input data also specifies the encoding, since the attacker can "
"then choose a clever way to hide malicious text in the encoded bytestream." "then choose a clever way to hide malicious text in the encoded bytestream."
msgstr "" msgstr ""
"Lors de l'utilisation de données provenant d'un navigateur Web ou d'une "
"autre source non fiable, une technique courante consiste à vérifier la "
"présence de caractères illégaux dans une chaîne de caractères avant de "
"l'utiliser pour générer une ligne de commande ou de la stocker dans une base "
"de données. Si vous le faites, vérifiez bien la chaîne décodée, pas les "
"données d'octets codés ; certains encodages peuvent avoir des propriétés "
"intéressantes, comme ne pas être bijectifs ou ne pas être entièrement "
"compatibles avec l'ASCII. C'est particulièrement vrai si l'encodage est "
"spécifié explicitement dans vos données d'entrée, car l'attaquant peut alors "
"choisir un moyen intelligent de cacher du texte malveillant dans le flux de "
"données encodé."
#: ../Doc/howto/unicode.rst:659 #: ../Doc/howto/unicode.rst:659
msgid "Converting Between File Encodings" msgid "Converting Between File Encodings"
msgstr "" msgstr "Conversion entre les encodages de fichiers"
#: ../Doc/howto/unicode.rst:661 #: ../Doc/howto/unicode.rst:661
msgid "" msgid ""
@ -945,16 +1136,23 @@ msgid ""
"encodings, taking a stream that returns data in encoding #1 and behaving " "encodings, taking a stream that returns data in encoding #1 and behaving "
"like a stream returning data in encoding #2." "like a stream returning data in encoding #2."
msgstr "" msgstr ""
"La classe :class:`~codecs.StreamRecoder` peut convertir de manière "
"transparente entre les encodages : prenant un flux qui renvoie des données "
"dans l'encodage #1, elle se comporte comme un flux qui renvoie des données "
"dans l'encodage #2."
#: ../Doc/howto/unicode.rst:665 #: ../Doc/howto/unicode.rst:665
msgid "" msgid ""
"For example, if you have an input file *f* that's in Latin-1, you can wrap " "For example, if you have an input file *f* that's in Latin-1, you can wrap "
"it with a :class:`~codecs.StreamRecoder` to return bytes encoded in UTF-8::" "it with a :class:`~codecs.StreamRecoder` to return bytes encoded in UTF-8::"
msgstr "" msgstr ""
"Par exemple, si vous avez un fichier d'entrée *f* qui est en Latin-1, vous "
"pouvez l'encapsuler dans un :class:`~codecs.StreamRecoder` pour qu'il "
"renvoie des octets encodés en UTF-8 ::"
#: ../Doc/howto/unicode.rst:679 #: ../Doc/howto/unicode.rst:679
msgid "Files in an Unknown Encoding" msgid "Files in an Unknown Encoding"
msgstr "" msgstr "Fichiers dans un encodage inconnu"
#: ../Doc/howto/unicode.rst:681 #: ../Doc/howto/unicode.rst:681
msgid "" msgid ""
@ -963,6 +1161,11 @@ msgid ""
"to examine or modify the ASCII parts, you can open the file with the " "to examine or modify the ASCII parts, you can open the file with the "
"``surrogateescape`` error handler::" "``surrogateescape`` error handler::"
msgstr "" msgstr ""
"Vous avez besoin de modifier un fichier mais vous ne connaissez pas "
"l'encodage du fichier ? Si vous savez que l'encodage est compatible ASCII "
"et que vous voulez seulement examiner ou modifier les parties ASCII, vous "
"pouvez ouvrir le fichier avec le gestionnaire d'erreurs "
"``surrogateescape`` ::"
#: ../Doc/howto/unicode.rst:695 #: ../Doc/howto/unicode.rst:695
msgid "" msgid ""
@ -979,6 +1182,10 @@ msgid ""
"video/289/pycon-2010--mastering-python-3-i-o>`_, a PyCon 2010 talk by David " "video/289/pycon-2010--mastering-python-3-i-o>`_, a PyCon 2010 talk by David "
"Beazley, discusses text processing and binary data handling." "Beazley, discusses text processing and binary data handling."
msgstr "" msgstr ""
"Une partie de la conférence `Mastering Python 3 Input/Output <http://pyvideo."
"org/video/289/pycon-2010--mastering-python-3-i-o>`_ (ressource en anglais), "
"donnée lors de PyCon 2010 de David Beazley, parle du traitement de texte et "
"du traitement des données binaires."
#: ../Doc/howto/unicode.rst:709 #: ../Doc/howto/unicode.rst:709
msgid "" msgid ""
@ -988,6 +1195,12 @@ msgid ""
"character encodings as well as how to internationalize and localize an " "character encodings as well as how to internationalize and localize an "
"application. These slides cover Python 2.x only." "application. These slides cover Python 2.x only."
msgstr "" msgstr ""
"Le `PDF du diaporama de la présentation de Marc-André Lemburg \"Writing "
"Unicodeaware Applications in Python\" <https://downloads.egenix.com/python/"
"LSM2005-Developing-Unicode-aware-applications-in-Python.pdf>`_ (ressource en "
"anglais) traite des questions d'encodage de caractères ainsi que de "
"l'internationalisation et de la localisation d'une application. Ces "
"diapositives ne couvrent que Python 2.x."
#: ../Doc/howto/unicode.rst:715 #: ../Doc/howto/unicode.rst:715
msgid "" msgid ""
@ -995,6 +1208,10 @@ msgid ""
"unicode-in-python>`_ is a PyCon 2013 talk by Benjamin Peterson that " "unicode-in-python>`_ is a PyCon 2013 talk by Benjamin Peterson that "
"discusses the internal Unicode representation in Python 3.3." "discusses the internal Unicode representation in Python 3.3."
msgstr "" msgstr ""
"`The Guts of Unicode in Python <http://pyvideo.org/video/1768/the-guts-of-"
"unicode-in-python>`_ (ressource en anglais) est une conférence PyCon 2013 "
"donnée par Benjamin Peterson qui traite de la représentation interne Unicode "
"en Python 3.3."
#: ../Doc/howto/unicode.rst:722 #: ../Doc/howto/unicode.rst:722
msgid "Acknowledgements" msgid "Acknowledgements"
@ -1006,6 +1223,9 @@ msgid ""
"since been revised further by Alexander Belopolsky, Georg Brandl, Andrew " "since been revised further by Alexander Belopolsky, Georg Brandl, Andrew "
"Kuchling, and Ezio Melotti." "Kuchling, and Ezio Melotti."
msgstr "" msgstr ""
"La première ébauche de ce document a été rédigée par Andrew Kuchling. Il a "
"depuis été révisé par Alexander Belopolsky, Georg Brandl, Andrew Kuchling et "
"Ezio Melotti."
#: ../Doc/howto/unicode.rst:728 #: ../Doc/howto/unicode.rst:728
msgid "" msgid ""

View File

@ -29,6 +29,13 @@ msgid ""
"provided. The :mod:`threading` module provides an easier to use and higher-" "provided. The :mod:`threading` module provides an easier to use and higher-"
"level threading API built on top of this module." "level threading API built on top of this module."
msgstr "" msgstr ""
"Ce module fournit les primitives de bas niveau pour travailler avec de "
"multiples fils d'exécution (aussi appelés :dfn:`light-weight processes` ou :"
"dfn:`tasks`) — plusieurs fils d'exécution de contrôle partagent leur espace "
"de données global. Pour la synchronisation, de simples verrous (aussi "
"appelés des :dfn:`mutexes` ou des :dfn:`binary semaphores`) sont fournis. Le "
"module :mod:`threading` fournit une API de fils d'exécution de haut niveau, "
"plus facile à utiliser et construite à partir de ce module."
#: ../Doc/library/_thread.rst:26 #: ../Doc/library/_thread.rst:26
msgid "" msgid ""
@ -77,6 +84,8 @@ msgid ""
"Raise the :exc:`SystemExit` exception. When not caught, this will cause the " "Raise the :exc:`SystemExit` exception. When not caught, this will cause the "
"thread to exit silently." "thread to exit silently."
msgstr "" msgstr ""
"Lève une exception :exc:`SystemExit`. Quand elle n'est pas interceptée, le "
"fil d'exécution se terminera silencieusement."
#: ../Doc/library/_thread.rst:80 #: ../Doc/library/_thread.rst:80
msgid "" msgid ""
@ -140,6 +149,10 @@ msgid ""
"(only one thread at a time can acquire a lock --- that's their reason for " "(only one thread at a time can acquire a lock --- that's their reason for "
"existence)." "existence)."
msgstr "" msgstr ""
"Sans aucun argument optionnel, cette méthode acquiert le verrou "
"inconditionnellement, et si nécessaire attend jusqu'à ce qu'il soit relâché "
"par un autre fil d'exécution (un seul fil d'exécution à la fois peut "
"acquérir le verrou — c'est leur raison d'être)."
#: ../Doc/library/_thread.rst:129 #: ../Doc/library/_thread.rst:129
msgid "" msgid ""
@ -148,6 +161,10 @@ msgid ""
"immediately without waiting, while if it is nonzero, the lock is acquired " "immediately without waiting, while if it is nonzero, the lock is acquired "
"unconditionally as above." "unconditionally as above."
msgstr "" msgstr ""
"Si l'argument *waitflag*, un entier, est présent, l'action dépend de sa "
"valeur : si elle est de zéro, le verrou est seulement acquis s'il peut être "
"acquis immédiatement, sans attendre, sinon le verrou est acquis "
"inconditionnellement comme ci-dessus."
#: ../Doc/library/_thread.rst:134 #: ../Doc/library/_thread.rst:134
msgid "" msgid ""
@ -156,12 +173,18 @@ msgid ""
"*timeout* argument specifies an unbounded wait. You cannot specify a " "*timeout* argument specifies an unbounded wait. You cannot specify a "
"*timeout* if *waitflag* is zero." "*timeout* if *waitflag* is zero."
msgstr "" msgstr ""
"Si l'argument *timeout*, en virgule flottante, est présent et positif, il "
"spécifie le temps d'attente maximum en secondes avant de renvoyer. Un "
"argument *timeout* négatif spécifie une attente illimitée. Vous ne pouvez "
"pas spécifier un *timeout* si *waitflag* est à zéro."
#: ../Doc/library/_thread.rst:139 #: ../Doc/library/_thread.rst:139
msgid "" msgid ""
"The return value is ``True`` if the lock is acquired successfully, ``False`` " "The return value is ``True`` if the lock is acquired successfully, ``False`` "
"if not." "if not."
msgstr "" msgstr ""
"La valeur renvoyée est ``True`` si le verrou est acquis avec succès, sinon "
"``False``."
#: ../Doc/library/_thread.rst:142 #: ../Doc/library/_thread.rst:142
msgid "The *timeout* parameter is new." msgid "The *timeout* parameter is new."
@ -170,24 +193,31 @@ msgstr "Le paramètre *timeout* est nouveau."
#: ../Doc/library/_thread.rst:145 #: ../Doc/library/_thread.rst:145
msgid "Lock acquires can now be interrupted by signals on POSIX." msgid "Lock acquires can now be interrupted by signals on POSIX."
msgstr "" msgstr ""
"Le verrou acquis peut maintenant être interrompu par des signaux sur POSIX."
#: ../Doc/library/_thread.rst:151 #: ../Doc/library/_thread.rst:151
msgid "" msgid ""
"Releases the lock. The lock must have been acquired earlier, but not " "Releases the lock. The lock must have been acquired earlier, but not "
"necessarily by the same thread." "necessarily by the same thread."
msgstr "" msgstr ""
"Relâche le verrou. Le verrou doit avoir été acquis plus tôt, mais pas "
"nécessairement par le même fil d'exécution."
#: ../Doc/library/_thread.rst:157 #: ../Doc/library/_thread.rst:157
msgid "" msgid ""
"Return the status of the lock: ``True`` if it has been acquired by some " "Return the status of the lock: ``True`` if it has been acquired by some "
"thread, ``False`` if not." "thread, ``False`` if not."
msgstr "" msgstr ""
"Renvoie le statut du verrou : ``True`` s'il a été acquis par certains fils "
"d'exécution, sinon ``False``."
#: ../Doc/library/_thread.rst:160 #: ../Doc/library/_thread.rst:160
msgid "" msgid ""
"In addition to these methods, lock objects can also be used via the :keyword:" "In addition to these methods, lock objects can also be used via the :keyword:"
"`with` statement, e.g.::" "`with` statement, e.g.::"
msgstr "" msgstr ""
"En plus de ces méthodes, les objets verrous peuvent aussi être utilisés via "
"l'instruction :keyword:`with`, e.g. : ::"
#: ../Doc/library/_thread.rst:170 #: ../Doc/library/_thread.rst:170
msgid "**Caveats:**" msgid "**Caveats:**"
@ -199,12 +229,18 @@ msgid ""
"exception will be received by an arbitrary thread. (When the :mod:`signal` " "exception will be received by an arbitrary thread. (When the :mod:`signal` "
"module is available, interrupts always go to the main thread.)" "module is available, interrupts always go to the main thread.)"
msgstr "" msgstr ""
"Les fils d'exécution interagissent étrangement avec les interruptions : "
"l'exception :exc:`KeyboardInterrupt` sera reçue par un fil d'exécution "
"arbitraire. (Quand le module :mod:`signal` est disponible, les interruptions "
"vont toujours au fil d'exécution principal)."
#: ../Doc/library/_thread.rst:178 #: ../Doc/library/_thread.rst:178
msgid "" msgid ""
"Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is " "Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is "
"equivalent to calling :func:`_thread.exit`." "equivalent to calling :func:`_thread.exit`."
msgstr "" msgstr ""
"Appeler la fonction :func:`sys.exit` ou lever l'exception :exc:`SystemExit` "
"est équivalent à appeler la fonction :func:`_thread.exit`."
#: ../Doc/library/_thread.rst:181 #: ../Doc/library/_thread.rst:181
msgid "" msgid ""
@ -212,6 +248,9 @@ msgid ""
"the :exc:`KeyboardInterrupt` exception will happen after the lock has been " "the :exc:`KeyboardInterrupt` exception will happen after the lock has been "
"acquired." "acquired."
msgstr "" msgstr ""
"Il n'est pas possible d'interrompre la méthode :meth:`acquire` sur un verrou "
"— l'exception :exc:`KeyboardInterrupt` surviendra après que le verrou a été "
"acquis."
#: ../Doc/library/_thread.rst:184 #: ../Doc/library/_thread.rst:184
msgid "" msgid ""
@ -219,6 +258,10 @@ msgid ""
"survive. On most systems, they are killed without executing :keyword:" "survive. On most systems, they are killed without executing :keyword:"
"`try` ... :keyword:`finally` clauses or executing object destructors." "`try` ... :keyword:`finally` clauses or executing object destructors."
msgstr "" msgstr ""
"Quand le fil d'exécution principal s'arrête, il est défini par le système si "
"les autres fils d'exécution survivent. Sur beaucoup de systèmes, ils sont "
"tués sans l'exécution des clauses :keyword:`try`… :keyword:`finally` ou "
"l'exécution des destructeurs d'objets."
#: ../Doc/library/_thread.rst:189 #: ../Doc/library/_thread.rst:189
msgid "" msgid ""
@ -226,3 +269,6 @@ msgid ""
"that :keyword:`try` ... :keyword:`finally` clauses are honored), and the " "that :keyword:`try` ... :keyword:`finally` clauses are honored), and the "
"standard I/O files are not flushed." "standard I/O files are not flushed."
msgstr "" msgstr ""
"Quand le fil d'exécution principal s'arrête, il ne fait pas son nettoyage "
"habituel (excepté que les clauses :keyword:`try`… :keyword:`finally` sont "
"honorées) et les fichiers d'entrée/sortie standards ne sont pas nettoyés."

View File

@ -121,6 +121,9 @@ msgid ""
"framerate, nframes, comptype, compname)``, equivalent to output of the :meth:" "framerate, nframes, comptype, compname)``, equivalent to output of the :meth:"
"`get\\*` methods." "`get\\*` methods."
msgstr "" msgstr ""
"Renvoie une :func:`~collections.namedtuple` ``(nchannels, sampwidth, "
"framerate, nframes, comptype, compname)``, équivalent à la sortie des "
"méthodes :meth:`get\\*`."
#: ../Doc/library/aifc.rst:106 #: ../Doc/library/aifc.rst:106
msgid "" msgid ""

View File

@ -265,7 +265,7 @@ msgstr ""
#: ../Doc/library/asyncio-eventloops.rst:179 #: ../Doc/library/asyncio-eventloops.rst:179
msgid "Set the event loop for the current context to *loop*." msgid "Set the event loop for the current context to *loop*."
msgstr "" msgstr "Définit la boucle d'événements du contexte actuel sur *loop*."
#: ../Doc/library/asyncio-eventloops.rst:183 #: ../Doc/library/asyncio-eventloops.rst:183
msgid "" msgid ""

View File

@ -18,11 +18,11 @@ msgstr ""
#: ../Doc/library/base64.rst:2 #: ../Doc/library/base64.rst:2
msgid ":mod:`base64` --- Base16, Base32, Base64, Base85 Data Encodings" msgid ":mod:`base64` --- Base16, Base32, Base64, Base85 Data Encodings"
msgstr "" msgstr ":mod:`base64` — Encodages base16, base32, base64 et base85"
#: ../Doc/library/base64.rst:8 #: ../Doc/library/base64.rst:8
msgid "**Source code:** :source:`Lib/base64.py`" msgid "**Source code:** :source:`Lib/base64.py`"
msgstr "" msgstr "**Code source :** :source:`Lib/base64.py`"
#: ../Doc/library/base64.rst:16 #: ../Doc/library/base64.rst:16
msgid "" msgid ""
@ -32,6 +32,12 @@ msgid ""
"which defines the Base16, Base32, and Base64 algorithms, and for the de-" "which defines the Base16, Base32, and Base64 algorithms, and for the de-"
"facto standard Ascii85 and Base85 encodings." "facto standard Ascii85 and Base85 encodings."
msgstr "" msgstr ""
"Ce module fournit des fonctions permettant de coder des données binaires en "
"caractères ASCII affichables ainsi que de décoder ces caractères vers des "
"données binaires en retour. Il fournit des fonctions d'encodage et de "
"décodage pour les codages spécifiés par la :rfc:`3548` qui définit les "
"algorithmes base16, base32 et base64, ainsi que les encodages standards *de "
"facto* Ascii85 et base85."
#: ../Doc/library/base64.rst:22 #: ../Doc/library/base64.rst:22
msgid "" msgid ""
@ -40,6 +46,10 @@ msgid ""
"HTTP POST request. The encoding algorithm is not the same as the :program:" "HTTP POST request. The encoding algorithm is not the same as the :program:"
"`uuencode` program." "`uuencode` program."
msgstr "" msgstr ""
"Les encodages définis par la :rfc:`3548` sont adaptés au codage des données "
"binaires pour leur transfert par courriel, comme éléments d'une URL ou d'une "
"requête HTTP POST. L'algorithme d'encodage ne doit pas être confondu avec le "
"programme :program:`uuencode`."
#: ../Doc/library/base64.rst:27 #: ../Doc/library/base64.rst:27
msgid "" msgid ""
@ -49,6 +59,12 @@ msgid ""
"or strings containing ASCII to :class:`bytes`. Both base-64 alphabets " "or strings containing ASCII to :class:`bytes`. Both base-64 alphabets "
"defined in :rfc:`3548` (normal, and URL- and filesystem-safe) are supported." "defined in :rfc:`3548` (normal, and URL- and filesystem-safe) are supported."
msgstr "" msgstr ""
"Ce module présente deux interfaces. L'interface moderne gère l'encodage d':"
"term:`objets octet-compatibles <bytes-like object>` en :class:`bytes` ASCII "
"ainsi que le décodage d':term:`objets octet-compatibles <bytes-like object>` "
"ou de chaînes de caractères contenant de l'ASCII en :class:`bytes`. Les deux "
"alphabets de l'algorithme base64 définis par la :rfc:`3548` (normal et sûr "
"pour les systèmes de fichiers ou URL) sont gérés."
#: ../Doc/library/base64.rst:33 #: ../Doc/library/base64.rst:33
msgid "" msgid ""
@ -59,12 +75,22 @@ msgid ""
"looking for :rfc:`2045` support you probably want to be looking at the :mod:" "looking for :rfc:`2045` support you probably want to be looking at the :mod:"
"`email` package instead." "`email` package instead."
msgstr "" msgstr ""
"L'interface historique ne permet pas le décodage des chaînes de caractères "
"mais fournit des fonctions permettant d'encoder et décoder depuis et vers "
"des :term:`objets fichiers <file object>`. Elle ne gère que l'alphabet "
"base64 standard et ajoute une nouvelle ligne tous les 76 caractères, comme "
"spécifié par la :rfc:`2045`. Notez que le paquet :mod:`email` est "
"probablement ce que vous cherchez si vous souhaitez une implémentation de "
"la :rfc:`2045`."
#: ../Doc/library/base64.rst:41 #: ../Doc/library/base64.rst:41
msgid "" msgid ""
"ASCII-only Unicode strings are now accepted by the decoding functions of the " "ASCII-only Unicode strings are now accepted by the decoding functions of the "
"modern interface." "modern interface."
msgstr "" msgstr ""
"Les chaînes de caractères Unicode contenant uniquement des caractères ASCII "
"sont désormais acceptées par les fonctions de décodage de l'interface "
"moderne."
#: ../Doc/library/base64.rst:45 #: ../Doc/library/base64.rst:45
msgid "" msgid ""
@ -72,6 +98,9 @@ msgid ""
"encoding and decoding functions in this module. Ascii85/Base85 support " "encoding and decoding functions in this module. Ascii85/Base85 support "
"added." "added."
msgstr "" msgstr ""
"Tous les :term:`objets octet-compatibles <bytes-like object>` sont désormais "
"acceptés par l'ensemble des fonctions d'encodage et de décodage de ce "
"module. La gestion de Ascii85/base85 a été ajoutée."
#: ../Doc/library/base64.rst:49 #: ../Doc/library/base64.rst:49
msgid "The modern interface provides:" msgid "The modern interface provides:"
@ -82,6 +111,8 @@ msgid ""
"Encode the :term:`bytes-like object` *s* using Base64 and return the " "Encode the :term:`bytes-like object` *s* using Base64 and return the "
"encoded :class:`bytes`." "encoded :class:`bytes`."
msgstr "" msgstr ""
"Encode un :term:`objet octet-compatible <bytes-like object>` *s* en "
"utilisant l'algorithme base64 et renvoie les :class:`bytes` encodés."
#: ../Doc/library/base64.rst:56 #: ../Doc/library/base64.rst:56
msgid "" msgid ""
@ -91,12 +122,21 @@ msgid ""
"generate URL or filesystem safe Base64 strings. The default is ``None``, " "generate URL or filesystem safe Base64 strings. The default is ``None``, "
"for which the standard Base64 alphabet is used." "for which the standard Base64 alphabet is used."
msgstr "" msgstr ""
"L'option *altchars* doit être un :term:`bytes-like object` de longueur au "
"moins 2 (les caractères additionnels sont ignorés) qui spécifie un alphabet "
"alternatif pour les délimiteurs ``+`` et ``/``. Cela permet de générer des "
"chaînes de caractères base64 pouvant être utilisées pour une URL ou dans un "
"système de fichiers. La valeur par défaut est ``None``, auquel cas "
"l'alphabet standard base64 est utilisé."
#: ../Doc/library/base64.rst:65 #: ../Doc/library/base64.rst:65
msgid "" msgid ""
"Decode the Base64 encoded :term:`bytes-like object` or ASCII string *s* and " "Decode the Base64 encoded :term:`bytes-like object` or ASCII string *s* and "
"return the decoded :class:`bytes`." "return the decoded :class:`bytes`."
msgstr "" msgstr ""
"Décode un :term:`objet octet-compatible <bytes-like object>` ou une chaîne "
"de caractères ASCII *s* encodée en base64 et renvoie les :class:`bytes` "
"décodés."
#: ../Doc/library/base64.rst:68 #: ../Doc/library/base64.rst:68
msgid "" msgid ""
@ -104,11 +144,16 @@ msgid ""
"at least length 2 (additional characters are ignored) which specifies the " "at least length 2 (additional characters are ignored) which specifies the "
"alternative alphabet used instead of the ``+`` and ``/`` characters." "alternative alphabet used instead of the ``+`` and ``/`` characters."
msgstr "" msgstr ""
"L'option *altchars* doit être un :term:`bytes-like object` de longueur au "
"moins égale à 2 (les caractères additionnels sont ignorés) qui spécifie un "
"alphabet alternatif pour les délimiteurs ``+`` et ``/``."
#: ../Doc/library/base64.rst:72 #: ../Doc/library/base64.rst:72
msgid "" msgid ""
"A :exc:`binascii.Error` exception is raised if *s* is incorrectly padded." "A :exc:`binascii.Error` exception is raised if *s* is incorrectly padded."
msgstr "" msgstr ""
"Une exception :exc:`binascii.Error` est levée si *s* n'est pas remplie à une "
"longueur attendue."
#: ../Doc/library/base64.rst:75 #: ../Doc/library/base64.rst:75
msgid "" msgid ""
@ -117,18 +162,28 @@ msgid ""
"the padding check. If *validate* is ``True``, these non-alphabet characters " "the padding check. If *validate* is ``True``, these non-alphabet characters "
"in the input result in a :exc:`binascii.Error`." "in the input result in a :exc:`binascii.Error`."
msgstr "" msgstr ""
"Si *validate* est ``False`` (par défaut), les caractères qui ne sont ni dans "
"l'alphabet base64 normal, ni dans l'alphabet alternatif, sont ignorés avant "
"la vérification de la longueur du remplissage. Si *validate* est ``True``, "
"les caractères hors de l'alphabet de l'entrée produisent une :exc:`binascii."
"Error`."
#: ../Doc/library/base64.rst:84 #: ../Doc/library/base64.rst:84
msgid "" msgid ""
"Encode :term:`bytes-like object` *s* using the standard Base64 alphabet and " "Encode :term:`bytes-like object` *s* using the standard Base64 alphabet and "
"return the encoded :class:`bytes`." "return the encoded :class:`bytes`."
msgstr "" msgstr ""
"Encode un :term:`objet octet-compatible <bytes-like object>` *s* en "
"utilisant l'alphabet standard base64 et renvoie les :class:`bytes` encodés."
#: ../Doc/library/base64.rst:90 #: ../Doc/library/base64.rst:90
msgid "" msgid ""
"Decode :term:`bytes-like object` or ASCII string *s* using the standard " "Decode :term:`bytes-like object` or ASCII string *s* using the standard "
"Base64 alphabet and return the decoded :class:`bytes`." "Base64 alphabet and return the decoded :class:`bytes`."
msgstr "" msgstr ""
"Décode un :term:`objet octet-compatible <bytes-like object>` ou une chaîne "
"de caractères ASCII *s* utilisant l'alphabet base64 standard et renvoie les :"
"class:`bytes` décodés."
#: ../Doc/library/base64.rst:96 #: ../Doc/library/base64.rst:96
msgid "" msgid ""
@ -137,6 +192,10 @@ msgid ""
"`` in the standard Base64 alphabet, and return the encoded :class:`bytes`. " "`` in the standard Base64 alphabet, and return the encoded :class:`bytes`. "
"The result can still contain ``=``." "The result can still contain ``=``."
msgstr "" msgstr ""
"Encode un :term:`objet byte-compatible <bytes-like object>` *s* en utilisant "
"un alphabet sûr pour les URL et systèmes de fichiers qui substitue ``-`` et "
"``_`` à ``+`` et ``/`` dans l'alphabet standard base64 et renvoie les :class:"
"`bytes` encodés."
#: ../Doc/library/base64.rst:105 #: ../Doc/library/base64.rst:105
msgid "" msgid ""
@ -145,24 +204,36 @@ msgid ""
"instead of ``/`` in the standard Base64 alphabet, and return the decoded :" "instead of ``/`` in the standard Base64 alphabet, and return the decoded :"
"class:`bytes`." "class:`bytes`."
msgstr "" msgstr ""
"Décode un :term:`objet octet-compatible <bytes-like object>` ou une chaîne "
"de caractères ASCII *s* utilisant un alphabet sûr pour les URL et systèmes "
"de fichiers qui substitue ``-`` et ``_`` à ``+`` et ``/`` dans l'alphabet "
"standard base64 et renvoie les :class:`bytes` décodés."
#: ../Doc/library/base64.rst:114 #: ../Doc/library/base64.rst:114
msgid "" msgid ""
"Encode the :term:`bytes-like object` *s* using Base32 and return the " "Encode the :term:`bytes-like object` *s* using Base32 and return the "
"encoded :class:`bytes`." "encoded :class:`bytes`."
msgstr "" msgstr ""
"Encode un :term:`objet byte-compatible <bytes-like object>` *s* en utilisant "
"l'algorithme base32 et renvoie les :class:`bytes` encodés."
#: ../Doc/library/base64.rst:120 #: ../Doc/library/base64.rst:120
msgid "" msgid ""
"Decode the Base32 encoded :term:`bytes-like object` or ASCII string *s* and " "Decode the Base32 encoded :term:`bytes-like object` or ASCII string *s* and "
"return the decoded :class:`bytes`." "return the decoded :class:`bytes`."
msgstr "" msgstr ""
"Décode un :term:`objet octet-compatible <bytes-like object>` ou une chaîne "
"de caractères ASCII *s* encodé en base32 et renvoie les :class:`bytes` "
"décodés."
#: ../Doc/library/base64.rst:123 ../Doc/library/base64.rst:150 #: ../Doc/library/base64.rst:123 ../Doc/library/base64.rst:150
msgid "" msgid ""
"Optional *casefold* is a flag specifying whether a lowercase alphabet is " "Optional *casefold* is a flag specifying whether a lowercase alphabet is "
"acceptable as input. For security purposes, the default is ``False``." "acceptable as input. For security purposes, the default is ``False``."
msgstr "" msgstr ""
"L'option *casefold* est un drapeau spécifiant si l'utilisation d'un alphabet "
"en minuscules est acceptable comme entrée. Pour des raisons de sécurité, "
"cette option est à ``False`` par défaut."
#: ../Doc/library/base64.rst:127 #: ../Doc/library/base64.rst:127
msgid "" msgid ""
@ -174,30 +245,46 @@ msgid ""
"purposes the default is ``None``, so that 0 and 1 are not allowed in the " "purposes the default is ``None``, so that 0 and 1 are not allowed in the "
"input." "input."
msgstr "" msgstr ""
"La :rfc:`3548` autorise une correspondance optionnelle du chiffre 0 (zéro) "
"vers la lettre O (/o/) ainsi que du chiffre 1 (un) vers soit la lettre I (/"
"i/) ou la lettre L (/l/). L'argument optionnel *map01*, lorsqu'il diffère de "
"``None``, spécifie en quelle lettre le chiffre 1 doit être transformé "
"(lorsque *map01* n'est pas ``None``, le chiffre 0 est toujours transformé en "
"la lettre O). Pour des raisons de sécurité, le défaut est ``None``, de telle "
"sorte que 0 et 1 ne sont pas autorisés dans l'entrée."
#: ../Doc/library/base64.rst:134 ../Doc/library/base64.rst:154 #: ../Doc/library/base64.rst:134 ../Doc/library/base64.rst:154
msgid "" msgid ""
"A :exc:`binascii.Error` is raised if *s* is incorrectly padded or if there " "A :exc:`binascii.Error` is raised if *s* is incorrectly padded or if there "
"are non-alphabet characters present in the input." "are non-alphabet characters present in the input."
msgstr "" msgstr ""
"Une exception :exc:`binascii.Error` est levée si *s* n'est pas remplie à une "
"longueur attendue ou si elle contient des caractères hors de l'alphabet."
#: ../Doc/library/base64.rst:141 #: ../Doc/library/base64.rst:141
msgid "" msgid ""
"Encode the :term:`bytes-like object` *s* using Base16 and return the " "Encode the :term:`bytes-like object` *s* using Base16 and return the "
"encoded :class:`bytes`." "encoded :class:`bytes`."
msgstr "" msgstr ""
"Encode un :term:`objet byte-compatible <bytes-like object>` *s* en utilisant "
"l'algorithme base16 et renvoie les :class:`bytes` encodés."
#: ../Doc/library/base64.rst:147 #: ../Doc/library/base64.rst:147
msgid "" msgid ""
"Decode the Base16 encoded :term:`bytes-like object` or ASCII string *s* and " "Decode the Base16 encoded :term:`bytes-like object` or ASCII string *s* and "
"return the decoded :class:`bytes`." "return the decoded :class:`bytes`."
msgstr "" msgstr ""
"Décode un :term:`objet octet-compatible <bytes-like object>` ou une chaîne "
"de caractères ASCII *s* encodé en base16 et renvoie les :class:`bytes` "
"décodés."
#: ../Doc/library/base64.rst:161 #: ../Doc/library/base64.rst:161
msgid "" msgid ""
"Encode the :term:`bytes-like object` *b* using Ascii85 and return the " "Encode the :term:`bytes-like object` *b* using Ascii85 and return the "
"encoded :class:`bytes`." "encoded :class:`bytes`."
msgstr "" msgstr ""
"Encode un :term:`objet byte-compatible <bytes-like object>` *s* en utilisant "
"l'algorithme Ascii85 et renvoie les :class:`bytes` encodés."
#: ../Doc/library/base64.rst:164 #: ../Doc/library/base64.rst:164
msgid "" msgid ""
@ -205,6 +292,10 @@ msgid ""
"instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This " "instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This "
"feature is not supported by the \"standard\" Ascii85 encoding." "feature is not supported by the \"standard\" Ascii85 encoding."
msgstr "" msgstr ""
"L'option *foldspaces* permet d'utiliser la séquence spéciale 'y' à la place "
"de quatre espaces consécutives (ASCII ``0x20``) comme pris en charge par "
"*btoa*. Cette fonctionnalité n'est pas gérée par l'encodage « standard » "
"Ascii85."
#: ../Doc/library/base64.rst:168 #: ../Doc/library/base64.rst:168
msgid "" msgid ""
@ -212,24 +303,35 @@ msgid ""
"characters added to it. If this is non-zero, each output line will be at " "characters added to it. If this is non-zero, each output line will be at "
"most this many characters long." "most this many characters long."
msgstr "" msgstr ""
"*wrapcol* contrôle l'ajout de caractères de saut de ligne (``b'\\n'``) à la "
"sortie. Chaque ligne de sortie contient au maximum *wrapcol* caractères si "
"cette option diffère de zéro."
#: ../Doc/library/base64.rst:172 #: ../Doc/library/base64.rst:172
msgid "" msgid ""
"*pad* controls whether the input is padded to a multiple of 4 before " "*pad* controls whether the input is padded to a multiple of 4 before "
"encoding. Note that the ``btoa`` implementation always pads." "encoding. Note that the ``btoa`` implementation always pads."
msgstr "" msgstr ""
"*pad* spécifie l'ajout de caractères de remplissage (*padding* en anglais) à "
"l'entrée jusqu'à ce que sa longueur soit un multiple de 4 avant encodage. "
"Notez que l'implémentation ``btoa`` effectue systématiquement ce remplissage."
#: ../Doc/library/base64.rst:175 #: ../Doc/library/base64.rst:175
msgid "" msgid ""
"*adobe* controls whether the encoded byte sequence is framed with ``<~`` and " "*adobe* controls whether the encoded byte sequence is framed with ``<~`` and "
"``~>``, which is used by the Adobe implementation." "``~>``, which is used by the Adobe implementation."
msgstr "" msgstr ""
"*adobe* contrôle si oui ou non la séquence encodée d'octets est encadrée par "
"``<~`` et ``~>`` comme utilisé dans l'implémentation Adobe."
#: ../Doc/library/base64.rst:183 #: ../Doc/library/base64.rst:183
msgid "" msgid ""
"Decode the Ascii85 encoded :term:`bytes-like object` or ASCII string *b* and " "Decode the Ascii85 encoded :term:`bytes-like object` or ASCII string *b* and "
"return the decoded :class:`bytes`." "return the decoded :class:`bytes`."
msgstr "" msgstr ""
"Décode un :term:`objet octet-compatible <bytes-like object>` ou une chaîne "
"de caractères ASCII *s* encodé en Ascii85 et renvoie les :class:`bytes` "
"décodés."
#: ../Doc/library/base64.rst:186 #: ../Doc/library/base64.rst:186
msgid "" msgid ""
@ -237,12 +339,18 @@ msgid ""
"be accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature " "be accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature "
"is not supported by the \"standard\" Ascii85 encoding." "is not supported by the \"standard\" Ascii85 encoding."
msgstr "" msgstr ""
"L'option *foldspaces* permet d'utiliser la séquence spéciale 'y' à la place "
"de quatre espaces consécutives (ASCII `0x20`) comme pris en charge par "
"*btoa*. Cette fonctionnalité n'est pas gérée par l'encodage « standard » "
"Ascii85."
#: ../Doc/library/base64.rst:190 #: ../Doc/library/base64.rst:190
msgid "" msgid ""
"*adobe* controls whether the input sequence is in Adobe Ascii85 format (i.e. " "*adobe* controls whether the input sequence is in Adobe Ascii85 format (i.e. "
"is framed with <~ and ~>)." "is framed with <~ and ~>)."
msgstr "" msgstr ""
"*adobe* indique si la séquence d'entrée utilise le format Adobe Ascii85 "
"(c'est-à-dire utilise l'encadrement par ``<~`` et ``~>``)."
#: ../Doc/library/base64.rst:193 #: ../Doc/library/base64.rst:193
msgid "" msgid ""
@ -251,18 +359,28 @@ msgid ""
"whitespace characters, and by default contains all whitespace characters in " "whitespace characters, and by default contains all whitespace characters in "
"ASCII." "ASCII."
msgstr "" msgstr ""
"*ignorechars* doit être un :term:`bytes-like object` ou une chaîne ASCII "
"contenant des caractères à ignorer dans l'entrée. Il ne doit contenir que "
"des caractères d'espacement et contient par défaut l'ensemble des caractères "
"d'espacement de l'alphabet ASCII."
#: ../Doc/library/base64.rst:203 #: ../Doc/library/base64.rst:203
msgid "" msgid ""
"Encode the :term:`bytes-like object` *b* using base85 (as used in e.g. git-" "Encode the :term:`bytes-like object` *b* using base85 (as used in e.g. git-"
"style binary diffs) and return the encoded :class:`bytes`." "style binary diffs) and return the encoded :class:`bytes`."
msgstr "" msgstr ""
"Encode un :term:`objet byte-compatible <bytes-like object>` *s* en utilisant "
"l'algorithme base85 (tel qu'utilisé par exemple par le programme *git-diff* "
"sur des données binaires) et renvoie les :class:`bytes` encodés."
#: ../Doc/library/base64.rst:206 #: ../Doc/library/base64.rst:206
msgid "" msgid ""
"If *pad* is true, the input is padded with ``b'\\0'`` so its length is a " "If *pad* is true, the input is padded with ``b'\\0'`` so its length is a "
"multiple of 4 bytes before encoding." "multiple of 4 bytes before encoding."
msgstr "" msgstr ""
"Si *pad* est vrai, des caractères de remplissage ``b'``0'`` (*padding* en "
"anglais) sont ajoutés à l'entrée jusqu'à ce que sa longueur soit un multiple "
"de 4 octets avant encodage."
#: ../Doc/library/base64.rst:214 #: ../Doc/library/base64.rst:214
msgid "" msgid ""
@ -270,6 +388,10 @@ msgid ""
"return the decoded :class:`bytes`. Padding is implicitly removed, if " "return the decoded :class:`bytes`. Padding is implicitly removed, if "
"necessary." "necessary."
msgstr "" msgstr ""
"Décode un :term:`objet octet-compatible <bytes-like object>` ou une chaîne "
"de caractères ASCII *b* encodé en base85 et renvoie les :class:`bytes` "
"décodés. Les caractères de remplissage sont implicitement retirés si "
"nécessaire."
#: ../Doc/library/base64.rst:222 #: ../Doc/library/base64.rst:222
msgid "" msgid ""
@ -291,6 +413,10 @@ msgid ""
"objects <file object>`. *input* will be read until ``input.readline()`` " "objects <file object>`. *input* will be read until ``input.readline()`` "
"returns an empty bytes object." "returns an empty bytes object."
msgstr "" msgstr ""
"Décode le contenu d'un fichier binaire *input* et écrit les données binaires "
"résultantes dans le fichier *output*. *input* et *output* doivent être des :"
"term:`objets fichiers <file object>`. *input* est lu jusqu'à ce que ``input."
"readline()`` renvoie un objet *bytes* vide."
#: ../Doc/library/base64.rst:242 #: ../Doc/library/base64.rst:242
msgid "" msgid ""
@ -308,6 +434,13 @@ msgid ""
"(``b'\\n'``) after every 76 bytes of the output, as well as ensuring that " "(``b'\\n'``) after every 76 bytes of the output, as well as ensuring that "
"the output always ends with a newline, as per :rfc:`2045` (MIME)." "the output always ends with a newline, as per :rfc:`2045` (MIME)."
msgstr "" msgstr ""
"Encode le contenu du fichier binaire *input* et écrit les données encodées "
"en base64 résultantes dans le fichier *output. *input* et *output* doivent "
"être des :term:`objets fichiers <file object>`. *input* est lu jusqu'à ce "
"que ``input.readline()`` renvoie un objet *bytes* vide. :func:`encode` "
"insère un caractère de saut de ligne (``b'\\n'``) tous les 76 octets de "
"sortie et assure que celle-ci se termine par une nouvelle ligne, comme "
"spécifié par la :rfc:`2045` (MIME)."
#: ../Doc/library/base64.rst:262 #: ../Doc/library/base64.rst:262
msgid "" msgid ""
@ -316,6 +449,11 @@ msgid ""
"newlines (``b'\\n'``) inserted after every 76 bytes of output, and ensuring " "newlines (``b'\\n'``) inserted after every 76 bytes of output, and ensuring "
"that there is a trailing newline, as per :rfc:`2045` (MIME)." "that there is a trailing newline, as per :rfc:`2045` (MIME)."
msgstr "" msgstr ""
"Encode un :term:`objet octet-compatible <bytes-like object>` *s* pouvant "
"contenir des données binaires arbitraires et renvoie les :class:`bytes` "
"contenant les données encodées en base64. Un caractère de saut de ligne "
"(``b'\\n'``) est inséré tous les 76 octets de sortie et celle-ci se termine "
"par une nouvelle ligne, comme spécifié par la :rfc:`2045` (MIME)."
#: ../Doc/library/base64.rst:267 #: ../Doc/library/base64.rst:267
msgid "``encodestring`` is a deprecated alias." msgid "``encodestring`` is a deprecated alias."
@ -342,9 +480,14 @@ msgid ""
"Mechanisms for Specifying and Describing the Format of Internet Message " "Mechanisms for Specifying and Describing the Format of Internet Message "
"Bodies" "Bodies"
msgstr "" msgstr ""
":rfc:`1521` — MIME (*Multipurpose Internet Mail Extensions*) *Part One: "
"Mechanisms for Specifying and Describing the Format of Internet Message "
"Bodies*"
#: ../Doc/library/base64.rst:287 #: ../Doc/library/base64.rst:287
msgid "" msgid ""
"Section 5.2, \"Base64 Content-Transfer-Encoding,\" provides the definition " "Section 5.2, \"Base64 Content-Transfer-Encoding,\" provides the definition "
"of the base64 encoding." "of the base64 encoding."
msgstr "" msgstr ""
"La Section 5.2, \"*Base64 Content-Transfer-Encoding*\", donne la définition "
"de l'encodage base64."

View File

@ -31,6 +31,9 @@ msgid ""
"`with` statement. For more information see also :ref:`typecontextmanager` " "`with` statement. For more information see also :ref:`typecontextmanager` "
"and :ref:`context-managers`." "and :ref:`context-managers`."
msgstr "" msgstr ""
"Ce module fournit des utilitaires pour les tâches impliquant le mot-clé :"
"keyword:`with`. Pour plus d'informations voir aussi :ref:"
"`typecontextmanager` et :ref:`context-managers`."
#: ../Doc/library/contextlib.rst:17 #: ../Doc/library/contextlib.rst:17
msgid "Utilities" msgid "Utilities"
@ -38,7 +41,7 @@ msgstr "Utilitaires"
#: ../Doc/library/contextlib.rst:19 #: ../Doc/library/contextlib.rst:19
msgid "Functions and classes provided:" msgid "Functions and classes provided:"
msgstr "" msgstr "Fonctions et classes fournies :"
#: ../Doc/library/contextlib.rst:23 #: ../Doc/library/contextlib.rst:23
msgid "" msgid ""
@ -46,6 +49,10 @@ msgid ""
"function for :keyword:`with` statement context managers, without needing to " "function for :keyword:`with` statement context managers, without needing to "
"create a class or separate :meth:`__enter__` and :meth:`__exit__` methods." "create a class or separate :meth:`__enter__` and :meth:`__exit__` methods."
msgstr "" msgstr ""
"Cette fonction est un :term:`decorator` qui peut être utilisé pour définir "
"une fonction fabriquant des gestionnaires de contexte à utiliser avec :"
"keyword:`with`, sans nécessiter de créer une classe ou des méthodes :meth:"
"`__enter__` et :meth:`__exit__` séparées."
#: ../Doc/library/contextlib.rst:27 #: ../Doc/library/contextlib.rst:27
msgid "" msgid ""
@ -86,26 +93,38 @@ msgid ""
"that context managers support multiple invocations in order to be used as " "that context managers support multiple invocations in order to be used as "
"decorators)." "decorators)."
msgstr "" msgstr ""
"Le décorateur :func:`contextmanager` utilise la classe :class:"
"`ContextDecorator` afin que les gestionnaires de contexte qu'il crée "
"puissent être utilisés aussi bien en tant que décorateurs qu'avec des "
"instructions :keyword:`with`. Quand vous l'utilisez comme décorateur, une "
"nouvelle instance du générateur est créée à chaque appel de la fonction "
"(cela permet aux gestionnaires de contexte à usage unique créés par :func:"
"`contextmanager` de remplir la condition de pouvoir être invoqués plusieurs "
"fois afin d'être utilisés comme décorateurs)."
#: ../Doc/library/contextlib.rst:67 #: ../Doc/library/contextlib.rst:67
msgid "Use of :class:`ContextDecorator`." msgid "Use of :class:`ContextDecorator`."
msgstr "" msgstr "Utilisation de la classe :class:`ContextDecorator`."
#: ../Doc/library/contextlib.rst:73 #: ../Doc/library/contextlib.rst:73
msgid "" msgid ""
"Return a context manager that closes *thing* upon completion of the block. " "Return a context manager that closes *thing* upon completion of the block. "
"This is basically equivalent to::" "This is basically equivalent to::"
msgstr "" msgstr ""
"Renvoie un gestionnaire de contexte qui ferme *thing* à la fin du bloc. "
"C'est essentiellement équivalent à ::"
#: ../Doc/library/contextlib.rst:85 #: ../Doc/library/contextlib.rst:85
msgid "And lets you write code like this::" msgid "And lets you write code like this::"
msgstr "" msgstr "Et cela vous permet d'écrire du code tel que ::"
#: ../Doc/library/contextlib.rst:94 #: ../Doc/library/contextlib.rst:94
msgid "" msgid ""
"without needing to explicitly close ``page``. Even if an error occurs, " "without needing to explicitly close ``page``. Even if an error occurs, "
"``page.close()`` will be called when the :keyword:`with` block is exited." "``page.close()`` will be called when the :keyword:`with` block is exited."
msgstr "" msgstr ""
"sans besoin de fermer explicitement ``page``. Même si une erreur survient, "
"``page.close()`` est appelée à la fermeture du bloc :keyword:`with`."
#: ../Doc/library/contextlib.rst:100 #: ../Doc/library/contextlib.rst:100
msgid "" msgid ""
@ -113,6 +132,9 @@ msgid ""
"they occur in the body of a with statement and then resumes execution with " "they occur in the body of a with statement and then resumes execution with "
"the first statement following the end of the with statement." "the first statement following the end of the with statement."
msgstr "" msgstr ""
"Renvoie un gestionnaire de contexte qui supprime toutes les exceptions "
"spécifiées si elles surviennent dans le corps du bloc *with*, et reprend "
"l'exécution sur la première instruction qui suit la fin du bloc *with*."
#: ../Doc/library/contextlib.rst:104 #: ../Doc/library/contextlib.rst:104
msgid "" msgid ""
@ -121,6 +143,10 @@ msgid ""
"silently continuing with program execution is known to be the right thing to " "silently continuing with program execution is known to be the right thing to "
"do." "do."
msgstr "" msgstr ""
"Comme pour tous les mécanismes qui suppriment complètement les exceptions, "
"ce gestionnaire de contexte doit seulement être utilisé pour couvrir des cas "
"très spécifiques d'erreurs où il est certain que continuer silencieusement "
"l'exécution du programme est la bonne chose à faire."
#: ../Doc/library/contextlib.rst:109 #: ../Doc/library/contextlib.rst:109
msgid "For example::" msgid "For example::"
@ -133,19 +159,23 @@ msgstr "Ce code est équivalent à ::"
#: ../Doc/library/contextlib.rst:131 ../Doc/library/contextlib.rst:170 #: ../Doc/library/contextlib.rst:131 ../Doc/library/contextlib.rst:170
#: ../Doc/library/contextlib.rst:180 #: ../Doc/library/contextlib.rst:180
msgid "This context manager is :ref:`reentrant <reentrant-cms>`." msgid "This context manager is :ref:`reentrant <reentrant-cms>`."
msgstr "" msgstr "Ce gestionnaire de contexte est :ref:`réentrant <reentrant-cms>`."
#: ../Doc/library/contextlib.rst:138 #: ../Doc/library/contextlib.rst:138
msgid "" msgid ""
"Context manager for temporarily redirecting :data:`sys.stdout` to another " "Context manager for temporarily redirecting :data:`sys.stdout` to another "
"file or file-like object." "file or file-like object."
msgstr "" msgstr ""
"Gestionnaire de contexte servant à rediriger temporairement :data:`sys."
"stdout` vers un autre fichier ou objet fichier-compatible."
#: ../Doc/library/contextlib.rst:141 #: ../Doc/library/contextlib.rst:141
msgid "" msgid ""
"This tool adds flexibility to existing functions or classes whose output is " "This tool adds flexibility to existing functions or classes whose output is "
"hardwired to stdout." "hardwired to stdout."
msgstr "" msgstr ""
"Cet outil ajoute une certaine flexibilité aux fonctions ou classes "
"existantes dont la sortie est envoyée vers la sortie standard."
#: ../Doc/library/contextlib.rst:144 #: ../Doc/library/contextlib.rst:144
msgid "" msgid ""
@ -153,16 +183,21 @@ msgid ""
"You can capture that output in a string by redirecting the output to an :" "You can capture that output in a string by redirecting the output to an :"
"class:`io.StringIO` object::" "class:`io.StringIO` object::"
msgstr "" msgstr ""
"Par exemple, la sortie de :func:`help` est normalement envoyée vers *sys."
"stdout*. Vous pouvez capturer cette sortie dans une chaîne de caractères en "
"la redirigeant vers un objet :class:`io.StringIO` ::"
#: ../Doc/library/contextlib.rst:153 #: ../Doc/library/contextlib.rst:153
msgid "" msgid ""
"To send the output of :func:`help` to a file on disk, redirect the output to " "To send the output of :func:`help` to a file on disk, redirect the output to "
"a regular file::" "a regular file::"
msgstr "" msgstr ""
"Pour envoyer la sortie de :func:`help` vers un fichier sur le disque, "
"redirigez-la sur un fichier normal ::"
#: ../Doc/library/contextlib.rst:160 #: ../Doc/library/contextlib.rst:160
msgid "To send the output of :func:`help` to *sys.stderr*::" msgid "To send the output of :func:`help` to *sys.stderr*::"
msgstr "" msgstr "Pour envoyer la sortie de :func:`help` sur *sys.stderr* ::"
#: ../Doc/library/contextlib.rst:165 #: ../Doc/library/contextlib.rst:165
msgid "" msgid ""
@ -171,17 +206,27 @@ msgid ""
"applications. It also has no effect on the output of subprocesses. However, " "applications. It also has no effect on the output of subprocesses. However, "
"it is still a useful approach for many utility scripts." "it is still a useful approach for many utility scripts."
msgstr "" msgstr ""
"Notez que l'effet de bord global sur :data:`sys.stdout` signifie que ce "
"gestionnaire de contexte n'est pas adapté à une utilisation dans le code "
"d'une bibliothèque ni dans la plupart des applications à plusieurs fils "
"d'exécution. Aussi, cela n'a pas d'effet sur la sortie des sous-processus. "
"Cependant, cela reste une approche utile pour beaucoup de scripts "
"utilitaires."
#: ../Doc/library/contextlib.rst:177 #: ../Doc/library/contextlib.rst:177
msgid "" msgid ""
"Similar to :func:`~contextlib.redirect_stdout` but redirecting :data:`sys." "Similar to :func:`~contextlib.redirect_stdout` but redirecting :data:`sys."
"stderr` to another file or file-like object." "stderr` to another file or file-like object."
msgstr "" msgstr ""
"Similaire à :func:`~contextlib.redirect_stdout` mais redirige :data:`sys."
"stderr` vers un autre fichier ou objet fichier-compatible."
#: ../Doc/library/contextlib.rst:187 #: ../Doc/library/contextlib.rst:187
msgid "" msgid ""
"A base class that enables a context manager to also be used as a decorator." "A base class that enables a context manager to also be used as a decorator."
msgstr "" msgstr ""
"Une classe mère qui permet à un gestionnaire de contexte d'être aussi "
"utilisé comme décorateur."
#: ../Doc/library/contextlib.rst:189 #: ../Doc/library/contextlib.rst:189
msgid "" msgid ""
@ -189,37 +234,50 @@ msgid ""
"``__enter__`` and ``__exit__`` as normal. ``__exit__`` retains its optional " "``__enter__`` and ``__exit__`` as normal. ``__exit__`` retains its optional "
"exception handling even when used as a decorator." "exception handling even when used as a decorator."
msgstr "" msgstr ""
"Les gestionnaires de contexte héritant de ``ContextDecorator`` doivent "
"implémenter ``__enter__`` et ``__exit__`` comme habituellement. ``__exit__`` "
"conserve sa gestion optionnelle des exceptions même lors de l'utilisation en "
"décorateur."
#: ../Doc/library/contextlib.rst:193 #: ../Doc/library/contextlib.rst:193
msgid "" msgid ""
"``ContextDecorator`` is used by :func:`contextmanager`, so you get this " "``ContextDecorator`` is used by :func:`contextmanager`, so you get this "
"functionality automatically." "functionality automatically."
msgstr "" msgstr ""
"``ContextDecorator`` est utilisé par :func:`contextmanager`, donc vous "
"bénéficiez automatiquement de cette fonctionnalité."
#: ../Doc/library/contextlib.rst:196 #: ../Doc/library/contextlib.rst:196
msgid "Example of ``ContextDecorator``::" msgid "Example of ``ContextDecorator``::"
msgstr "" msgstr "Exemple de ``ContextDecorator`` ::"
#: ../Doc/library/contextlib.rst:225 #: ../Doc/library/contextlib.rst:225
msgid "" msgid ""
"This change is just syntactic sugar for any construct of the following form::" "This change is just syntactic sugar for any construct of the following form::"
msgstr "" msgstr ""
"Ce changement est simplement un sucre syntaxique pour les constructions de "
"la forme suivante ::"
#: ../Doc/library/contextlib.rst:231 #: ../Doc/library/contextlib.rst:231
msgid "``ContextDecorator`` lets you instead write::" msgid "``ContextDecorator`` lets you instead write::"
msgstr "" msgstr "``ContextDecorator`` vous permet d'écrire à la place ::"
#: ../Doc/library/contextlib.rst:237 #: ../Doc/library/contextlib.rst:237
msgid "" msgid ""
"It makes it clear that the ``cm`` applies to the whole function, rather than " "It makes it clear that the ``cm`` applies to the whole function, rather than "
"just a piece of it (and saving an indentation level is nice, too)." "just a piece of it (and saving an indentation level is nice, too)."
msgstr "" msgstr ""
"Cela éclaircit le fait que ``cm`` s'applique à la fonction entière, et pas "
"seulement à un morceau en particulier (et gagner un niveau d'indentation est "
"toujours appréciable)."
#: ../Doc/library/contextlib.rst:240 #: ../Doc/library/contextlib.rst:240
msgid "" msgid ""
"Existing context managers that already have a base class can be extended by " "Existing context managers that already have a base class can be extended by "
"using ``ContextDecorator`` as a mixin class::" "using ``ContextDecorator`` as a mixin class::"
msgstr "" msgstr ""
"Les gestionnaires de contexte existants qui ont déjà une classe mère peuvent "
"être étendus en utilisant ``ContextDecorator`` comme une *mixin* ::"
#: ../Doc/library/contextlib.rst:253 #: ../Doc/library/contextlib.rst:253
msgid "" msgid ""
@ -235,12 +293,18 @@ msgid ""
"combine other context managers and cleanup functions, especially those that " "combine other context managers and cleanup functions, especially those that "
"are optional or otherwise driven by input data." "are optional or otherwise driven by input data."
msgstr "" msgstr ""
"Gestionnaire de contexte conçu pour simplifier le fait de combiner "
"programmatiquement d'autres gestionnaires de contexte et fonctions de "
"nettoyage, spécifiquement ceux qui sont optionnels ou pilotés par des "
"données d'entrée."
#: ../Doc/library/contextlib.rst:267 #: ../Doc/library/contextlib.rst:267
msgid "" msgid ""
"For example, a set of files may easily be handled in a single with statement " "For example, a set of files may easily be handled in a single with statement "
"as follows::" "as follows::"
msgstr "" msgstr ""
"Par exemple, un ensemble de fichiers peut facilement être géré dans une "
"unique instruction *with* comme suit ::"
#: ../Doc/library/contextlib.rst:276 #: ../Doc/library/contextlib.rst:276
msgid "" msgid ""
@ -249,6 +313,11 @@ msgid ""
"at the end of a :keyword:`with` statement). Note that callbacks are *not* " "at the end of a :keyword:`with` statement). Note that callbacks are *not* "
"invoked implicitly when the context stack instance is garbage collected." "invoked implicitly when the context stack instance is garbage collected."
msgstr "" msgstr ""
"Chaque instance maintient une pile de fonctions de rappels (*callbacks*) "
"enregistrées qui sont appelées en ordre inverse quand l'instance est fermée "
"(explicitement ou implicitement à la fin d'un bloc :keyword:`with`). Notez "
"que ces fonctions ne sont *pas* invoquées implicitement quand l'instance de "
"la pile de contextes est collectée par le ramasse-miettes."
#: ../Doc/library/contextlib.rst:281 #: ../Doc/library/contextlib.rst:281
msgid "" msgid ""
@ -256,6 +325,9 @@ msgid ""
"resources in their ``__init__`` method (such as file objects) can be handled " "resources in their ``__init__`` method (such as file objects) can be handled "
"correctly." "correctly."
msgstr "" msgstr ""
"Ce modèle de pile est utilisé afin que les gestionnaires de contexte qui "
"acquièrent leurs ressources dans leur méthode ``__init__`` (tels que les "
"objets-fichiers) puissent être gérés correctement."
#: ../Doc/library/contextlib.rst:285 #: ../Doc/library/contextlib.rst:285
msgid "" msgid ""
@ -266,6 +338,12 @@ msgid ""
"exception, then outer callbacks will be passed arguments based on that " "exception, then outer callbacks will be passed arguments based on that "
"updated state." "updated state."
msgstr "" msgstr ""
"Comme les fonctions de rappel enregistrées sont invoquées dans l'ordre "
"inverse d'enregistrement, cela revient au même que si de multiples blocs :"
"keyword:`with` imbriqués avaient été utilisés avec l'ensemble de fonctions "
"enregistrées. Cela s'étend aussi à la gestion d'exceptions — si une fonction "
"de rappel intérieure supprime ou remplace une exception, alors les fonctions "
"extérieures reçoivent des arguments basés sur ce nouvel état."
#: ../Doc/library/contextlib.rst:292 #: ../Doc/library/contextlib.rst:292
msgid "" msgid ""
@ -274,6 +352,10 @@ msgid ""
"foundation for higher level context managers that manipulate the exit stack " "foundation for higher level context managers that manipulate the exit stack "
"in application specific ways." "in application specific ways."
msgstr "" msgstr ""
"C'est une *API* relativement bas-niveau qui s'occupe de dérouler "
"correctement la pile des appels de sortie. Elle fournit une base adaptée "
"pour des gestionnaires de contexte de plus haut niveau qui manipulent la "
"pile de sortie de manière spécifique à l'application."
#: ../Doc/library/contextlib.rst:301 #: ../Doc/library/contextlib.rst:301
msgid "" msgid ""
@ -281,16 +363,24 @@ msgid ""
"callback stack. The return value is the result of the context manager's own :" "callback stack. The return value is the result of the context manager's own :"
"meth:`__enter__` method." "meth:`__enter__` method."
msgstr "" msgstr ""
"Entre dans un nouveau gestionnaire de contexte et ajoute sa méthode :meth:"
"`__exit__` à la pile d'appels. La valeur de retour est le résultat de la "
"méthode :meth:`__enter__` du gestionnaire de contexte donné."
#: ../Doc/library/contextlib.rst:305 #: ../Doc/library/contextlib.rst:305
msgid "" msgid ""
"These context managers may suppress exceptions just as they normally would " "These context managers may suppress exceptions just as they normally would "
"if used directly as part of a :keyword:`with` statement." "if used directly as part of a :keyword:`with` statement."
msgstr "" msgstr ""
"Ces gestionnaires de contexte peuvent supprimer des exceptions comme ils le "
"feraient normalement s'ils étaient utilisés directement derrière une "
"instruction :keyword:`with`."
#: ../Doc/library/contextlib.rst:310 #: ../Doc/library/contextlib.rst:310
msgid "Adds a context manager's :meth:`__exit__` method to the callback stack." msgid "Adds a context manager's :meth:`__exit__` method to the callback stack."
msgstr "" msgstr ""
"Ajoute la méthode :meth:`__exit__` d'un gestionnaire de contexte à la pile "
"d'appels."
#: ../Doc/library/contextlib.rst:312 #: ../Doc/library/contextlib.rst:312
msgid "" msgid ""
@ -298,6 +388,9 @@ msgid ""
"an :meth:`__enter__` implementation with a context manager's own :meth:" "an :meth:`__enter__` implementation with a context manager's own :meth:"
"`__exit__` method." "`__exit__` method."
msgstr "" msgstr ""
"Comme ``__enter__`` n'est *pas* invoquée, cette méthode peut être utilisée "
"pour couvrir une partie de l'implémentation de :meth:`__enter__` avec la "
"propre méthode :meth:`__exit__` d'un gestionnaire de contexte."
#: ../Doc/library/contextlib.rst:316 #: ../Doc/library/contextlib.rst:316
msgid "" msgid ""
@ -305,36 +398,52 @@ msgid ""
"a callback with the same signature as a context manager's :meth:`__exit__` " "a callback with the same signature as a context manager's :meth:`__exit__` "
"method and adds it directly to the callback stack." "method and adds it directly to the callback stack."
msgstr "" msgstr ""
"Si l'argument passé n'est pas un gestionnaire de contexte, la méthode assume "
"qu'il s'agit d'une fonction de rappel avec la même signature que la méthode :"
"meth:`__exit__` des gestionnaires de contexte pour l'ajouter directement à "
"la pile d'appels."
#: ../Doc/library/contextlib.rst:320 #: ../Doc/library/contextlib.rst:320
msgid "" msgid ""
"By returning true values, these callbacks can suppress exceptions the same " "By returning true values, these callbacks can suppress exceptions the same "
"way context manager :meth:`__exit__` methods can." "way context manager :meth:`__exit__` methods can."
msgstr "" msgstr ""
"En retournant des valeurs vraies, ces fonctions peuvent supprimer des "
"exceptions de la même manière que le peuvent les méthodes :meth:`__exit__` "
"des gestionnaires de contexte."
#: ../Doc/library/contextlib.rst:323 #: ../Doc/library/contextlib.rst:323
msgid "" msgid ""
"The passed in object is returned from the function, allowing this method to " "The passed in object is returned from the function, allowing this method to "
"be used as a function decorator." "be used as a function decorator."
msgstr "" msgstr ""
"L'objet passé en paramètre est renvoyé par la fonction, ce qui permet à la "
"méthode d'être utilisée comme décorateur de fonction."
#: ../Doc/library/contextlib.rst:328 #: ../Doc/library/contextlib.rst:328
msgid "" msgid ""
"Accepts an arbitrary callback function and arguments and adds it to the " "Accepts an arbitrary callback function and arguments and adds it to the "
"callback stack." "callback stack."
msgstr "" msgstr ""
"Accepte une fonction arbitraire et ses arguments et les ajoute à la pile des "
"fonctions de rappel."
#: ../Doc/library/contextlib.rst:331 #: ../Doc/library/contextlib.rst:331
msgid "" msgid ""
"Unlike the other methods, callbacks added this way cannot suppress " "Unlike the other methods, callbacks added this way cannot suppress "
"exceptions (as they are never passed the exception details)." "exceptions (as they are never passed the exception details)."
msgstr "" msgstr ""
"À la différence des autres méthodes, les fonctions de rappel ajoutées de "
"cette manière ne peuvent pas supprimer les exceptions (puisqu'elles ne "
"reçoivent jamais les détails de l'exception)."
#: ../Doc/library/contextlib.rst:334 #: ../Doc/library/contextlib.rst:334
msgid "" msgid ""
"The passed in callback is returned from the function, allowing this method " "The passed in callback is returned from the function, allowing this method "
"to be used as a function decorator." "to be used as a function decorator."
msgstr "" msgstr ""
"La fonction passée en paramètre est renvoyée par la méthode, ce qui permet à "
"la méthode d'être utilisée comme décorateur de fonction."
#: ../Doc/library/contextlib.rst:339 #: ../Doc/library/contextlib.rst:339
msgid "" msgid ""
@ -343,12 +452,18 @@ msgid ""
"now be invoked when the new stack is closed (either explicitly or implicitly " "now be invoked when the new stack is closed (either explicitly or implicitly "
"at the end of a :keyword:`with` statement)." "at the end of a :keyword:`with` statement)."
msgstr "" msgstr ""
"Transfère la pile d'appels à une nouvelle instance de :class:`ExitStack` et "
"la renvoie. Aucune fonction de rappel n'est invoquée par cette opération — à "
"la place, elles sont dorénavant invoquées quand la nouvelle pile sera close "
"(soit explicitement soit implicitement à la fin d'un bloc :keyword:`with`)."
#: ../Doc/library/contextlib.rst:344 #: ../Doc/library/contextlib.rst:344
msgid "" msgid ""
"For example, a group of files can be opened as an \"all or nothing\" " "For example, a group of files can be opened as an \"all or nothing\" "
"operation as follows::" "operation as follows::"
msgstr "" msgstr ""
"Par exemple, un groupe de fichiers peut être ouvert comme une opération "
 tout ou rien » comme suit ::"
#: ../Doc/library/contextlib.rst:358 #: ../Doc/library/contextlib.rst:358
msgid "" msgid ""
@ -356,20 +471,26 @@ msgid ""
"order of registration. For any context managers and exit callbacks " "order of registration. For any context managers and exit callbacks "
"registered, the arguments passed in will indicate that no exception occurred." "registered, the arguments passed in will indicate that no exception occurred."
msgstr "" msgstr ""
"Déroule immédiatement la pile d'appels, invoquant les fonctions de rappel "
"dans l'ordre inverse d'enregistrement. Pour chaque gestionnaire de contexte "
"et fonction de sortie enregistré, les arguments passés indiqueront qu'aucune "
"exception n'est survenue."
#: ../Doc/library/contextlib.rst:365 #: ../Doc/library/contextlib.rst:365
msgid "Examples and Recipes" msgid "Examples and Recipes"
msgstr "" msgstr "Exemples et Recettes"
#: ../Doc/library/contextlib.rst:367 #: ../Doc/library/contextlib.rst:367
msgid "" msgid ""
"This section describes some examples and recipes for making effective use of " "This section describes some examples and recipes for making effective use of "
"the tools provided by :mod:`contextlib`." "the tools provided by :mod:`contextlib`."
msgstr "" msgstr ""
"Cette section décrit quelques exemples et recettes pour décrire une "
"utilisation réelle des outils fournis par :mod:`contextlib`."
#: ../Doc/library/contextlib.rst:372 #: ../Doc/library/contextlib.rst:372
msgid "Supporting a variable number of context managers" msgid "Supporting a variable number of context managers"
msgstr "" msgstr "Gérer un nombre variable de gestionnaires de contexte"
#: ../Doc/library/contextlib.rst:374 #: ../Doc/library/contextlib.rst:374
msgid "" msgid ""
@ -380,6 +501,13 @@ msgid ""
"input (such as opening a user specified collection of files), or from some " "input (such as opening a user specified collection of files), or from some "
"of the context managers being optional::" "of the context managers being optional::"
msgstr "" msgstr ""
"Le cas d'utilisation primaire de :class:`ExitStack` est celui décrit dans la "
"documentation de la classe : gérer un nombre variable de gestionnaires de "
"contexte et d'autres opérations de nettoyage en une unique instruction :"
"keyword:`with`. La variabilité peut venir du nombre de gestionnaires de "
"contexte voulus découlant d'une entrée de l'utilisateur (comme ouvrir une "
"collection spécifique de fichiers de l'utilisateur), ou de certains "
"gestionnaires de contexte qui peuvent être optionnels ::"
#: ../Doc/library/contextlib.rst:389 #: ../Doc/library/contextlib.rst:389
msgid "" msgid ""
@ -387,6 +515,9 @@ msgid ""
"statements to manage arbitrary resources that don't natively support the " "statements to manage arbitrary resources that don't natively support the "
"context management protocol." "context management protocol."
msgstr "" msgstr ""
"Comme montré, :class:`ExitStack` rend aussi assez facile d'utiliser les "
"instructions :keyword:`with` pour gérer des ressources arbitraires qui ne "
"gèrent pas nativement le protocole des gestionnaires de contexte."
#: ../Doc/library/contextlib.rst:395 #: ../Doc/library/contextlib.rst:395
msgid "Simplifying support for single optional context managers" msgid "Simplifying support for single optional context managers"
@ -402,7 +533,7 @@ msgstr ""
#: ../Doc/library/contextlib.rst:413 #: ../Doc/library/contextlib.rst:413
msgid "Catching exceptions from ``__enter__`` methods" msgid "Catching exceptions from ``__enter__`` methods"
msgstr "" msgstr "Attraper des exceptions depuis les méthodes ``__enter__``"
#: ../Doc/library/contextlib.rst:415 #: ../Doc/library/contextlib.rst:415
msgid "" msgid ""
@ -412,6 +543,12 @@ msgid ""
"By using :class:`ExitStack` the steps in the context management protocol can " "By using :class:`ExitStack` the steps in the context management protocol can "
"be separated slightly in order to allow this::" "be separated slightly in order to allow this::"
msgstr "" msgstr ""
"Il est occasionnellement souhaitable d'attraper les exceptions depuis "
"l'implémentation d'une méthode ``__enter__``, *sans* attraper par "
"inadvertance les exceptions du corps de l'instruction :keyword:`with` ou de "
"la méthode ``__exit__`` des gestionnaires de contexte. En utilisant :class:"
"`ExitStack`, les étapes du protocole des gestionnaires de contexte peuvent "
"être légèrement séparées pour permettre le code suivant ::"
#: ../Doc/library/contextlib.rst:430 #: ../Doc/library/contextlib.rst:430
msgid "" msgid ""
@ -423,10 +560,18 @@ msgid ""
"to handle various situations that can't be handled directly in a :keyword:" "to handle various situations that can't be handled directly in a :keyword:"
"`with` statement." "`with` statement."
msgstr "" msgstr ""
"Avoir à faire cela est en fait surtout utile pour indiquer que l'*API* sous-"
"jacente devrait fournir une interface directe de gestion des ressources à "
"utiliser avec les instructions :keyword:`try`/:keyword:`except`/:keyword:"
"`finally`, mais que toutes les *API* ne sont pas bien conçues dans cet "
"objectif. Quand un gestionnaire de contexte est la seule *API* de gestion "
"des ressources fournie, alors :class:`ExitStack` peut rendre plus facile la "
"gestion de plusieurs situations qui ne peuvent pas être traitées directement "
"dans une instruction :keyword:`with`."
#: ../Doc/library/contextlib.rst:440 #: ../Doc/library/contextlib.rst:440
msgid "Cleaning up in an ``__enter__`` implementation" msgid "Cleaning up in an ``__enter__`` implementation"
msgstr "" msgstr "Nettoyer dans une méthode ``__enter__``"
#: ../Doc/library/contextlib.rst:442 #: ../Doc/library/contextlib.rst:442
msgid "" msgid ""
@ -434,6 +579,9 @@ msgid ""
"useful in cleaning up an already allocated resource if later steps in the :" "useful in cleaning up an already allocated resource if later steps in the :"
"meth:`__enter__` implementation fail." "meth:`__enter__` implementation fail."
msgstr "" msgstr ""
"Comme indiqué dans la documentation de :meth:`ExitStack.push`, cette méthode "
"peut être utile pour nettoyer une ressource déjà allouée si les dernières "
"étapes de l'implémentation de :meth:`__enter__` échouent."
#: ../Doc/library/contextlib.rst:446 #: ../Doc/library/contextlib.rst:446
msgid "" msgid ""
@ -441,10 +589,13 @@ msgid ""
"acquisition and release functions, along with an optional validation " "acquisition and release functions, along with an optional validation "
"function, and maps them to the context management protocol::" "function, and maps them to the context management protocol::"
msgstr "" msgstr ""
"Voici un exemple de gestionnaire de contexte qui reçoit des fonctions "
"d'acquisition de ressources et de libération, avec une méthode de validation "
"optionnelle, et qui les adapte au protocole des gestionnaires de contexte ::"
#: ../Doc/library/contextlib.rst:486 #: ../Doc/library/contextlib.rst:486
msgid "Replacing any use of ``try-finally`` and flag variables" msgid "Replacing any use of ``try-finally`` and flag variables"
msgstr "" msgstr "Remplacer un ``try-finally`` avec une option variable"
#: ../Doc/library/contextlib.rst:488 #: ../Doc/library/contextlib.rst:488
msgid "" msgid ""
@ -453,6 +604,10 @@ msgid ""
"should be executed. In its simplest form (that can't already be handled just " "should be executed. In its simplest form (that can't already be handled just "
"by using an ``except`` clause instead), it looks something like this::" "by using an ``except`` clause instead), it looks something like this::"
msgstr "" msgstr ""
"Un modèle que vous rencontrerez parfois est un bloc ``try-finally`` avec une "
"option pour indiquer si le corps de la clause ``finally`` doit être exécuté "
"ou non. Dans sa forme la plus simple (qui ne peut pas déjà être gérée avec "
"juste une clause ``except``), cela ressemble à ::"
#: ../Doc/library/contextlib.rst:502 #: ../Doc/library/contextlib.rst:502
msgid "" msgid ""
@ -460,6 +615,10 @@ msgid ""
"development and review, because the setup code and the cleanup code can end " "development and review, because the setup code and the cleanup code can end "
"up being separated by arbitrarily long sections of code." "up being separated by arbitrarily long sections of code."
msgstr "" msgstr ""
"Comme avec n'importe quel code basé sur une instruction ``try``, cela peut "
"poser problème pour le développement et la revue, parce que beaucoup de "
"codes d'installation et de nettoyage peuvent finir par être séparés par des "
"sections de code arbitrairement longues."
#: ../Doc/library/contextlib.rst:506 #: ../Doc/library/contextlib.rst:506
msgid "" msgid ""
@ -467,18 +626,25 @@ msgid ""
"execution at the end of a ``with`` statement, and then later decide to skip " "execution at the end of a ``with`` statement, and then later decide to skip "
"executing that callback::" "executing that callback::"
msgstr "" msgstr ""
":class:`ExitStack` rend possible de plutôt enregistrer une fonction de "
"rappel pour être exécutée à la fin d'une instruction ``with``, et décider "
"ensuite de passer l'exécution de cet appel ::"
#: ../Doc/library/contextlib.rst:518 #: ../Doc/library/contextlib.rst:518
msgid "" msgid ""
"This allows the intended cleanup up behaviour to be made explicit up front, " "This allows the intended cleanup up behaviour to be made explicit up front, "
"rather than requiring a separate flag variable." "rather than requiring a separate flag variable."
msgstr "" msgstr ""
"Cela permet de rendre explicite dès le départ le comportement de nettoyage "
"attendu, plutôt que de nécessiter une option séparée."
#: ../Doc/library/contextlib.rst:521 #: ../Doc/library/contextlib.rst:521
msgid "" msgid ""
"If a particular application uses this pattern a lot, it can be simplified " "If a particular application uses this pattern a lot, it can be simplified "
"even further by means of a small helper class::" "even further by means of a small helper class::"
msgstr "" msgstr ""
"Si une application particulière utilise beaucoup ce modèle, cela peut-être "
"simplifié encore plus au moyen d'une petite classe d'aide ::"
#: ../Doc/library/contextlib.rst:539 #: ../Doc/library/contextlib.rst:539
msgid "" msgid ""
@ -486,6 +652,10 @@ msgid ""
"function, then it is still possible to use the decorator form of :meth:" "function, then it is still possible to use the decorator form of :meth:"
"`ExitStack.callback` to declare the resource cleanup in advance::" "`ExitStack.callback` to declare the resource cleanup in advance::"
msgstr "" msgstr ""
"Si le nettoyage de la ressource n'est pas déjà soigneusement embarqué dans "
"une fonction autonome, il est possible d'utiliser le décorateur :meth:"
"`ExitStack.callback` pour déclarer la fonction de nettoyage de ressource en "
"avance ::"
#: ../Doc/library/contextlib.rst:554 #: ../Doc/library/contextlib.rst:554
msgid "" msgid ""
@ -493,16 +663,24 @@ msgid ""
"this way cannot take any parameters. Instead, any resources to be released " "this way cannot take any parameters. Instead, any resources to be released "
"must be accessed as closure variables." "must be accessed as closure variables."
msgstr "" msgstr ""
"Dû au fonctionnement du protocole des décorateurs, une fonction déclarée "
"ainsi ne peut prendre aucun paramètre. À la place, les ressources à libérer "
"doivent être récupérées depuis l'extérieur comme des variables de fermeture "
"(*closure*)."
#: ../Doc/library/contextlib.rst:560 #: ../Doc/library/contextlib.rst:560
msgid "Using a context manager as a function decorator" msgid "Using a context manager as a function decorator"
msgstr "" msgstr ""
"Utiliser un gestionnaire de contexte en tant que décorateur de fonction"
#: ../Doc/library/contextlib.rst:562 #: ../Doc/library/contextlib.rst:562
msgid "" msgid ""
":class:`ContextDecorator` makes it possible to use a context manager in both " ":class:`ContextDecorator` makes it possible to use a context manager in both "
"an ordinary ``with`` statement and also as a function decorator." "an ordinary ``with`` statement and also as a function decorator."
msgstr "" msgstr ""
":class:`ContextDecorator` rend possible l'utilisation d'un gestionnaire de "
"contexte à la fois ordinairement avec une instruction ``with`` ou comme un "
"décorateur de fonction."
#: ../Doc/library/contextlib.rst:565 #: ../Doc/library/contextlib.rst:565
msgid "" msgid ""
@ -512,14 +690,22 @@ msgid ""
"task, inheriting from :class:`ContextDecorator` provides both capabilities " "task, inheriting from :class:`ContextDecorator` provides both capabilities "
"in a single definition::" "in a single definition::"
msgstr "" msgstr ""
"Par exemple, il est parfois utile d'emballer les fonctions ou blocs "
"d'instructions avec un journaliseur qui pourrait suivre le temps d'exécution "
"entre l'entrée et la sortie. Plutôt qu'écrire à la fois un décorateur et un "
"gestionnaire de contexte pour la même tâche, hériter de :class:"
"`ContextDecorator` fournit les deux fonctionnalités en une seule "
"définition ::"
#: ../Doc/library/contextlib.rst:586 #: ../Doc/library/contextlib.rst:586
msgid "Instances of this class can be used as both a context manager::" msgid "Instances of this class can be used as both a context manager::"
msgstr "" msgstr ""
"Les instances de cette classe peuvent être utilisées comme gestionnaires de "
"contexte ::"
#: ../Doc/library/contextlib.rst:592 #: ../Doc/library/contextlib.rst:592
msgid "And also as a function decorator::" msgid "And also as a function decorator::"
msgstr "" msgstr "Et comme décorateurs de fonctions ::"
#: ../Doc/library/contextlib.rst:599 #: ../Doc/library/contextlib.rst:599
msgid "" msgid ""
@ -528,6 +714,10 @@ msgid ""
"`__enter__`. If that value is needed, then it is still necessary to use an " "`__enter__`. If that value is needed, then it is still necessary to use an "
"explicit ``with`` statement." "explicit ``with`` statement."
msgstr "" msgstr ""
"Notez qu'il y a une autre limitation en utilisant les gestionnaires de "
"contexte comme décorateurs : il n'y a aucune manière d'accéder à la valeur "
"de retour de :meth:`__enter__`. Si cette valeur est nécessaire, il faut "
"utiliser explicitement une instruction ``with``."
#: ../Doc/library/contextlib.rst:607 #: ../Doc/library/contextlib.rst:607
msgid ":pep:`343` - The \"with\" statement" msgid ":pep:`343` - The \"with\" statement"
@ -543,7 +733,7 @@ msgstr ""
#: ../Doc/library/contextlib.rst:613 #: ../Doc/library/contextlib.rst:613
msgid "Single use, reusable and reentrant context managers" msgid "Single use, reusable and reentrant context managers"
msgstr "" msgstr "Gestionnaires de contexte à usage unique, réutilisables et réentrants"
#: ../Doc/library/contextlib.rst:615 #: ../Doc/library/contextlib.rst:615
msgid "" msgid ""
@ -552,6 +742,11 @@ msgid ""
"managers must be created afresh each time they're used - attempting to use " "managers must be created afresh each time they're used - attempting to use "
"them a second time will trigger an exception or otherwise not work correctly." "them a second time will trigger an exception or otherwise not work correctly."
msgstr "" msgstr ""
"La plupart des gestionnaires de contexte sont écrits d'une manière qui ne "
"leur permet que d'être utilisés une fois avec une instruction :keyword:"
"`with`. Ces gestionnaires de contexte à usage unique doivent être recréés "
"chaque fois qu'ils sont utilisés — tenter de les utiliser une seconde fois "
"lève une exception ou ne fonctionne pas correctement."
#: ../Doc/library/contextlib.rst:621 #: ../Doc/library/contextlib.rst:621
msgid "" msgid ""
@ -559,6 +754,10 @@ msgid ""
"context managers directly in the header of the :keyword:`with` statement " "context managers directly in the header of the :keyword:`with` statement "
"where they are used (as shown in all of the usage examples above)." "where they are used (as shown in all of the usage examples above)."
msgstr "" msgstr ""
"Cette limitation commune signifie qu'il est généralement conseillé de créer "
"les gestionnaires de contexte directement dans l'en-tête du bloc :keyword:"
"`with` où ils sont utilisés (comme montré dans tous les exemples "
"d'utilisation au-dessus)."
#: ../Doc/library/contextlib.rst:625 #: ../Doc/library/contextlib.rst:625
msgid "" msgid ""
@ -566,6 +765,10 @@ msgid ""
"first :keyword:`with` statement will close the file, preventing any further " "first :keyword:`with` statement will close the file, preventing any further "
"IO operations using that file object." "IO operations using that file object."
msgstr "" msgstr ""
"Les fichiers sont un exemple de gestionnaires de contexte étant "
"effectivement à usage unique, puisque la première instruction :keyword:"
"`with` ferme le fichier, empêchant d'autres opérations d'entrée/sortie "
"d'être exécutées sur ce fichier."
#: ../Doc/library/contextlib.rst:629 #: ../Doc/library/contextlib.rst:629
msgid "" msgid ""
@ -573,10 +776,13 @@ msgid ""
"context managers, and will complain about the underlying generator failing " "context managers, and will complain about the underlying generator failing "
"to yield if an attempt is made to use them a second time::" "to yield if an attempt is made to use them a second time::"
msgstr "" msgstr ""
"Les gestionnaires de contexte créés avec :func:`contextmanager` sont aussi à "
"usage unique, et se plaindront du fait que le générateur sous-jacent ne "
"produise plus de valeur si vous essayez de les utiliser une seconde fois ::"
#: ../Doc/library/contextlib.rst:657 #: ../Doc/library/contextlib.rst:657
msgid "Reentrant context managers" msgid "Reentrant context managers"
msgstr "" msgstr "Gestionnaires de contexte réentrants"
#: ../Doc/library/contextlib.rst:659 #: ../Doc/library/contextlib.rst:659
msgid "" msgid ""
@ -592,6 +798,9 @@ msgid ""
"are :func:`suppress` and :func:`redirect_stdout`. Here's a very simple " "are :func:`suppress` and :func:`redirect_stdout`. Here's a very simple "
"example of reentrant use::" "example of reentrant use::"
msgstr "" msgstr ""
":class:`threading.RLock` est un exemple de gestionnaire de contexte "
"réentrant, comme le sont aussi :func:`suppress` et :func:`redirect_stdout`. "
"Voici un très simple exemple d'utilisation réentrante ::"
#: ../Doc/library/contextlib.rst:683 #: ../Doc/library/contextlib.rst:683
msgid "" msgid ""
@ -599,6 +808,9 @@ msgid ""
"functions calling each other and hence be far more complicated than this " "functions calling each other and hence be far more complicated than this "
"example." "example."
msgstr "" msgstr ""
"Les exemples plus réels de réentrance sont susceptibles d'invoquer plusieurs "
"fonctions s'entre-appelant, et donc être bien plus compliqués que cet "
"exemple."
#: ../Doc/library/contextlib.rst:687 #: ../Doc/library/contextlib.rst:687
msgid "" msgid ""
@ -607,10 +819,14 @@ msgid ""
"as it makes a global modification to the system state by binding :data:`sys." "as it makes a global modification to the system state by binding :data:`sys."
"stdout` to a different stream." "stdout` to a different stream."
msgstr "" msgstr ""
"Notez aussi qu'être réentrant ne signifie *pas* être *thread safe*. :func:"
"`redirect_stdout`, par exemple, n'est définitivement pas *thread safe*, "
"puisqu'il effectue des changements globaux sur l'état du système en "
"branchant :data:`sys.stdout` sur différents flux."
#: ../Doc/library/contextlib.rst:696 #: ../Doc/library/contextlib.rst:696
msgid "Reusable context managers" msgid "Reusable context managers"
msgstr "" msgstr "Gestionnaires de contexte réutilisables"
#: ../Doc/library/contextlib.rst:698 #: ../Doc/library/contextlib.rst:698
msgid "" msgid ""
@ -621,6 +837,14 @@ msgid ""
"will fail (or otherwise not work correctly) if the specific context manager " "will fail (or otherwise not work correctly) if the specific context manager "
"instance has already been used in a containing with statement." "instance has already been used in a containing with statement."
msgstr "" msgstr ""
"D'autres gestionnaires de contexte que ceux à usage unique et les réentrants "
"sont les gestionnaires de contexte « réutilisables » (ou, pour être plus "
"explicite, « réutilisables mais pas réentrants », puisque les gestionnaires "
"de contexte réentrants sont aussi réutilisables). Ces gestionnaires de "
"contexte sont conçus afin d'être utilisés plusieurs fois, mais échoueront "
"(ou ne fonctionnent pas correctement) si l'instance de gestionnaire de "
"contexte référencée a déjà été utilisée dans une instruction *with* "
"englobante."
#: ../Doc/library/contextlib.rst:705 #: ../Doc/library/contextlib.rst:705
msgid "" msgid ""
@ -628,6 +852,9 @@ msgid ""
"context manager (for a reentrant lock, it is necessary to use :class:" "context manager (for a reentrant lock, it is necessary to use :class:"
"`threading.RLock` instead)." "`threading.RLock` instead)."
msgstr "" msgstr ""
":class:`threading.Lock` est un exemple de gestionnaire de contexte "
"réutilisable mais pas réentrant (pour un verrou réentrant, il faut à la "
"place utiliser :class:`threading.RLock`)."
#: ../Doc/library/contextlib.rst:709 #: ../Doc/library/contextlib.rst:709
msgid "" msgid ""
@ -635,6 +862,10 @@ msgid ""
"`ExitStack`, as it invokes *all* currently registered callbacks when leaving " "`ExitStack`, as it invokes *all* currently registered callbacks when leaving "
"any with statement, regardless of where those callbacks were added::" "any with statement, regardless of where those callbacks were added::"
msgstr "" msgstr ""
"Un autre exemple de gestionnaire de contexte réutilisable mais pas réentrant "
"est :class:`ExitStack`, puisqu'il invoque *toutes* les fonctions de rappel "
"actuellement enregistrées en quittant l'instruction *with*, sans regarder où "
"ces fonctions ont été ajoutées ::"
#: ../Doc/library/contextlib.rst:740 #: ../Doc/library/contextlib.rst:740
msgid "" msgid ""
@ -643,9 +874,15 @@ msgid ""
"cause the stack to be cleared at the end of the innermost with statement, " "cause the stack to be cleared at the end of the innermost with statement, "
"which is unlikely to be desirable behaviour." "which is unlikely to be desirable behaviour."
msgstr "" msgstr ""
"Comme le montre la sortie de l'exemple, réutiliser une simple pile entre "
"plusieurs instructions *with* fonctionne correctement, mais essayer de les "
"imbriquer fait que la pile est vidée à la fin du *with* le plus imbriqué, ce "
"qui n'est probablement pas le comportement voulu."
#: ../Doc/library/contextlib.rst:745 #: ../Doc/library/contextlib.rst:745
msgid "" msgid ""
"Using separate :class:`ExitStack` instances instead of reusing a single " "Using separate :class:`ExitStack` instances instead of reusing a single "
"instance avoids that problem::" "instance avoids that problem::"
msgstr "" msgstr ""
"Pour éviter ce problème, utilisez des instances différentes de :class:"
"`ExitStack` plutôt qu'une seule instance ::"

View File

@ -1807,7 +1807,7 @@ msgstr "``KEY_CLOSE``"
#: ../Doc/library/curses.rst:1382 #: ../Doc/library/curses.rst:1382
msgid "Close" msgid "Close"
msgstr "" msgstr "*Close*"
#: ../Doc/library/curses.rst:1384 #: ../Doc/library/curses.rst:1384
msgid "``KEY_COMMAND``" msgid "``KEY_COMMAND``"
@ -1823,7 +1823,7 @@ msgstr "``KEY_COPY``"
#: ../Doc/library/curses.rst:1386 #: ../Doc/library/curses.rst:1386
msgid "Copy" msgid "Copy"
msgstr "" msgstr "*Copy*"
#: ../Doc/library/curses.rst:1388 #: ../Doc/library/curses.rst:1388
msgid "``KEY_CREATE``" msgid "``KEY_CREATE``"
@ -1847,7 +1847,7 @@ msgstr "``KEY_EXIT``"
#: ../Doc/library/curses.rst:1392 #: ../Doc/library/curses.rst:1392
msgid "Exit" msgid "Exit"
msgstr "" msgstr "*Exit*"
#: ../Doc/library/curses.rst:1394 #: ../Doc/library/curses.rst:1394
msgid "``KEY_FIND``" msgid "``KEY_FIND``"
@ -1927,7 +1927,7 @@ msgstr "``KEY_REDO``"
#: ../Doc/library/curses.rst:1412 #: ../Doc/library/curses.rst:1412
msgid "Redo" msgid "Redo"
msgstr "" msgstr "*Redo*"
#: ../Doc/library/curses.rst:1414 #: ../Doc/library/curses.rst:1414
msgid "``KEY_REFERENCE``" msgid "``KEY_REFERENCE``"
@ -1975,7 +1975,7 @@ msgstr "``KEY_SAVE``"
#: ../Doc/library/curses.rst:1424 #: ../Doc/library/curses.rst:1424
msgid "Save" msgid "Save"
msgstr "" msgstr "*Save*"
#: ../Doc/library/curses.rst:1426 #: ../Doc/library/curses.rst:1426
msgid "``KEY_SBEG``" msgid "``KEY_SBEG``"
@ -2223,7 +2223,7 @@ msgstr "``KEY_UNDO``"
#: ../Doc/library/curses.rst:1486 #: ../Doc/library/curses.rst:1486
msgid "Undo" msgid "Undo"
msgstr "" msgstr "*Undo*"
#: ../Doc/library/curses.rst:1488 #: ../Doc/library/curses.rst:1488
msgid "``KEY_MOUSE``" msgid "``KEY_MOUSE``"

View File

@ -18,7 +18,7 @@ msgstr ""
#: ../Doc/library/dis.rst:2 #: ../Doc/library/dis.rst:2
msgid ":mod:`dis` --- Disassembler for Python bytecode" msgid ":mod:`dis` --- Disassembler for Python bytecode"
msgstr "" msgstr ":mod:`dis` Désassembleur pour le code intermédiaire de Python"
#: ../Doc/library/dis.rst:7 #: ../Doc/library/dis.rst:7
msgid "**Source code:** :source:`Lib/dis.py`" msgid "**Source code:** :source:`Lib/dis.py`"
@ -31,6 +31,10 @@ msgid ""
"is defined in the file :file:`Include/opcode.h` and used by the compiler and " "is defined in the file :file:`Include/opcode.h` and used by the compiler and "
"the interpreter." "the interpreter."
msgstr "" msgstr ""
"La bibliothèque :mod:`dis` supporte l'analyse du :term:`bytecode` CPython "
"en le désassemblant. Le code intermédiaire CPython, que cette bibliothèque "
"prend en paramètre, est défini dans le fichier :file:`Include/opcode.h` et "
"est utilisé par le compilateur et l'interpréteur."
#: ../Doc/library/dis.rst:18 #: ../Doc/library/dis.rst:18
msgid "" msgid ""
@ -39,24 +43,31 @@ msgid ""
"between versions of Python. Use of this module should not be considered to " "between versions of Python. Use of this module should not be considered to "
"work across Python VMs or Python releases." "work across Python VMs or Python releases."
msgstr "" msgstr ""
"Le code intermédiaire est un détail d'implémentation de l'interpréteur "
"CPython. Il n'y a pas de garantie que le code intermédiaire sera ajouté, "
"retiré, ou modifié dans les différentes versions de Python. L'utilisation de "
"cette bibliothèque ne fonctionne pas nécessairement sur les machines "
"virtuelles Python ni les différentes versions de Python."
#: ../Doc/library/dis.rst:24 #: ../Doc/library/dis.rst:24
msgid "Example: Given the function :func:`myfunc`::" msgid "Example: Given the function :func:`myfunc`::"
msgstr "" msgstr "Exemple : Etant donné la fonction :func:`myfunc` ::"
#: ../Doc/library/dis.rst:29 #: ../Doc/library/dis.rst:29
msgid "" msgid ""
"the following command can be used to display the disassembly of :func:" "the following command can be used to display the disassembly of :func:"
"`myfunc`::" "`myfunc`::"
msgstr "" msgstr ""
"la commande suivante peut-être utilisé pour afficher le désassemblage de :"
"func:`myfunc` ::"
#: ../Doc/library/dis.rst:38 #: ../Doc/library/dis.rst:38
msgid "(The \"2\" is a line number)." msgid "(The \"2\" is a line number)."
msgstr "" msgstr "(Le \"2\" est un numéro de ligne)."
#: ../Doc/library/dis.rst:41 #: ../Doc/library/dis.rst:41
msgid "Bytecode analysis" msgid "Bytecode analysis"
msgstr "" msgstr "Analyse du code intermédiaire"
#: ../Doc/library/dis.rst:45 #: ../Doc/library/dis.rst:45
msgid "" msgid ""
@ -64,6 +75,9 @@ msgid ""
"class:`Bytecode` object that provides easy access to details of the compiled " "class:`Bytecode` object that provides easy access to details of the compiled "
"code." "code."
msgstr "" msgstr ""
"L'analyse de l'*API* code intermédiaire permet de rassembler des blocs de "
"code en Python dans une classe :class:`Bytecode`, qui permet un accès facile "
"aux détails du code compilé."
#: ../Doc/library/dis.rst:52 #: ../Doc/library/dis.rst:52
msgid "" msgid ""
@ -77,6 +91,10 @@ msgid ""
"most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " "most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` "
"instance yields the bytecode operations as :class:`Instruction` instances." "instance yields the bytecode operations as :class:`Instruction` instances."
msgstr "" msgstr ""
"Ceci est *wrapper* sur plusieurs fonctions de la liste ci-dessous, "
"notamment :func:`get_instructions`, étant donné qu'une itération sur une "
"instance de la classe :class:`Bytecode` rend les opérations du code "
"intermédiaire des instances de :class:`Instruction`."
#: ../Doc/library/dis.rst:59 ../Doc/library/dis.rst:200 #: ../Doc/library/dis.rst:59 ../Doc/library/dis.rst:200
msgid "" msgid ""
@ -85,6 +103,10 @@ msgid ""
"source line information (if any) is taken directly from the disassembled " "source line information (if any) is taken directly from the disassembled "
"code object." "code object."
msgstr "" msgstr ""
"Si *first_line* ne vaut pas ``None``, elle indique le nombre de la ligne qui "
"doit être considérée comme première ligne source dans le code désassemblé. "
"Autrement, les informations sur la ligne source sont prises directement à "
"partir de la classe du code désassemblé."
#: ../Doc/library/dis.rst:64 #: ../Doc/library/dis.rst:64
msgid "" msgid ""
@ -92,32 +114,43 @@ msgid ""
"the disassembled code. Setting this means :meth:`.dis` will display a " "the disassembled code. Setting this means :meth:`.dis` will display a "
"\"current instruction\" marker against the specified opcode." "\"current instruction\" marker against the specified opcode."
msgstr "" msgstr ""
"Si la valeur de *current_offset* est différente de ``None``, c'est une "
"référence à un offset d'une instruction dans le code désassemblé. Cela veut "
"dire que :meth:`.dis` va générer un marqueur de \" l'instruction en cours\" "
"contre le code d'opération donné."
#: ../Doc/library/dis.rst:70 #: ../Doc/library/dis.rst:70
msgid "" msgid ""
"Construct a :class:`Bytecode` instance from the given traceback, setting " "Construct a :class:`Bytecode` instance from the given traceback, setting "
"*current_offset* to the instruction responsible for the exception." "*current_offset* to the instruction responsible for the exception."
msgstr "" msgstr ""
"Construisez une instance :class:`Bytecode` à partir de la trace d'appel, en "
"mettant *current_offet* à l'instruction responsable de l'exception."
#: ../Doc/library/dis.rst:75 #: ../Doc/library/dis.rst:75
msgid "The compiled code object." msgid "The compiled code object."
msgstr "" msgstr "Le code compilé objet."
#: ../Doc/library/dis.rst:79 #: ../Doc/library/dis.rst:79
msgid "The first source line of the code object (if available)" msgid "The first source line of the code object (if available)"
msgstr "" msgstr "La première ligne source du code objet (si disponible)"
#: ../Doc/library/dis.rst:83 #: ../Doc/library/dis.rst:83
msgid "" msgid ""
"Return a formatted view of the bytecode operations (the same as printed by :" "Return a formatted view of the bytecode operations (the same as printed by :"
"func:`dis.dis`, but returned as a multi-line string)." "func:`dis.dis`, but returned as a multi-line string)."
msgstr "" msgstr ""
"Retourne une vue formatée des opérations du code intermédiaire (la même que "
"celle envoyée par :func:`dis.dis`, mais comme une chaîne de caractères de "
"plusieurs lignes )."
#: ../Doc/library/dis.rst:88 #: ../Doc/library/dis.rst:88
msgid "" msgid ""
"Return a formatted multi-line string with detailed information about the " "Return a formatted multi-line string with detailed information about the "
"code object, like :func:`code_info`." "code object, like :func:`code_info`."
msgstr "" msgstr ""
"Retourne une chaîne de caractères de plusieurs lignes formatée avec des "
"informations détaillées sur l'objet code comme :func:`code_info`."
#: ../Doc/library/dis.rst:91 #: ../Doc/library/dis.rst:91
msgid "Example::" msgid "Example::"
@ -125,7 +158,7 @@ msgstr "Exemple ::"
#: ../Doc/library/dis.rst:104 #: ../Doc/library/dis.rst:104
msgid "Analysis functions" msgid "Analysis functions"
msgstr "" msgstr "Analyse de fonctions"
#: ../Doc/library/dis.rst:106 #: ../Doc/library/dis.rst:106
msgid "" msgid ""
@ -134,6 +167,10 @@ msgid ""
"a single operation is being performed, so the intermediate analysis object " "a single operation is being performed, so the intermediate analysis object "
"isn't useful:" "isn't useful:"
msgstr "" msgstr ""
"La bibliothèque :mod:`dis` comprend également l'analyse des fonctions "
"suivantes, qui envoient l'entrée directement à la sortie souhaitée. Elles "
"peuvent être utiles si il n'y a qu'une seule opération à effectuer, la "
"représentation intermédiaire objet n'étant donc pas utile dans ce cas:"
#: ../Doc/library/dis.rst:112 #: ../Doc/library/dis.rst:112
msgid "" msgid ""
@ -148,6 +185,10 @@ msgid ""
"dependent and they may change arbitrarily across Python VMs or Python " "dependent and they may change arbitrarily across Python VMs or Python "
"releases." "releases."
msgstr "" msgstr ""
"Il est à noter que le contenu exact des chaînes de caractères figurant dans "
"les informations du code dépendent fortement sur l'implémentation, et "
"peuvent changer arbitrairement sous machines virtuelles Python ou les "
"versions de Python."
#: ../Doc/library/dis.rst:124 #: ../Doc/library/dis.rst:124
msgid "" msgid ""
@ -155,17 +196,23 @@ msgid ""
"source code string or code object to *file* (or ``sys.stdout`` if *file* is " "source code string or code object to *file* (or ``sys.stdout`` if *file* is "
"not specified)." "not specified)."
msgstr "" msgstr ""
"Affiche des informations détaillées sur le code de la fonction fournie, la "
"méthode, la chaîne de caractère du code source ou du code objet à *file* (ou "
"bien ``sys.stdout`` si *file* n'est pas spécifié)."
#: ../Doc/library/dis.rst:128 #: ../Doc/library/dis.rst:128
msgid "" msgid ""
"This is a convenient shorthand for ``print(code_info(x), file=file)``, " "This is a convenient shorthand for ``print(code_info(x), file=file)``, "
"intended for interactive exploration at the interpreter prompt." "intended for interactive exploration at the interpreter prompt."
msgstr "" msgstr ""
"Ceci est un raccourci convenable de ``print(code_info(x), file=file)``, "
"principalement fait pour l'exploration interactive sur l'invite de "
"l'interpréteur."
#: ../Doc/library/dis.rst:133 ../Doc/library/dis.rst:151 #: ../Doc/library/dis.rst:133 ../Doc/library/dis.rst:151
#: ../Doc/library/dis.rst:164 ../Doc/library/dis.rst:188 #: ../Doc/library/dis.rst:164 ../Doc/library/dis.rst:188
msgid "Added *file* parameter." msgid "Added *file* parameter."
msgstr "" msgstr "Ajout du paramètre *file*."
#: ../Doc/library/dis.rst:139 #: ../Doc/library/dis.rst:139
msgid "" msgid ""
@ -185,6 +232,8 @@ msgid ""
"The disassembly is written as text to the supplied *file* argument if " "The disassembly is written as text to the supplied *file* argument if "
"provided and to ``sys.stdout`` otherwise." "provided and to ``sys.stdout`` otherwise."
msgstr "" msgstr ""
"Le désassemblage est envoyé sous forme de texte à l'argument du fichier "
"*file* si il est fourni, et à ``sys.stdout`` sinon."
#: ../Doc/library/dis.rst:157 #: ../Doc/library/dis.rst:157
msgid "" msgid ""
@ -192,58 +241,70 @@ msgid ""
"traceback if none was passed. The instruction causing the exception is " "traceback if none was passed. The instruction causing the exception is "
"indicated." "indicated."
msgstr "" msgstr ""
"Désassemble la fonction du haut de la pile des traces d'appels, en utilisant "
"la dernière trace d'appels si rien n'a été envoyé. L'instruction à l'origine "
"de l'exception est indiquée."
#: ../Doc/library/dis.rst:171 #: ../Doc/library/dis.rst:171
msgid "" msgid ""
"Disassemble a code object, indicating the last instruction if *lasti* was " "Disassemble a code object, indicating the last instruction if *lasti* was "
"provided. The output is divided in the following columns:" "provided. The output is divided in the following columns:"
msgstr "" msgstr ""
"Désassemble un code objet, en indiquant la dernière instruction si *lasti* "
"est fournie. La sortie est répartie sur les colonnes suivantes :"
#: ../Doc/library/dis.rst:174 #: ../Doc/library/dis.rst:174
msgid "the line number, for the first instruction of each line" msgid "the line number, for the first instruction of each line"
msgstr "" msgstr "le numéro de ligne, pour la première instruction de chaque ligne"
#: ../Doc/library/dis.rst:175 #: ../Doc/library/dis.rst:175
msgid "the current instruction, indicated as ``-->``," msgid "the current instruction, indicated as ``-->``,"
msgstr "" msgstr "l'instruction en cours, indiquée par ``-->``,"
#: ../Doc/library/dis.rst:176 #: ../Doc/library/dis.rst:176
msgid "a labelled instruction, indicated with ``>>``," msgid "a labelled instruction, indicated with ``>>``,"
msgstr "" msgstr "une instruction libellée, indiquée par ``> >``,"
#: ../Doc/library/dis.rst:177 #: ../Doc/library/dis.rst:177
msgid "the address of the instruction," msgid "the address of the instruction,"
msgstr "" msgstr "l'adresse de l'instruction,"
#: ../Doc/library/dis.rst:178 #: ../Doc/library/dis.rst:178
msgid "the operation code name," msgid "the operation code name,"
msgstr "" msgstr "le nom de le code d'opération,"
#: ../Doc/library/dis.rst:179 #: ../Doc/library/dis.rst:179
msgid "operation parameters, and" msgid "operation parameters, and"
msgstr "" msgstr "paramètres de l'opération, et"
#: ../Doc/library/dis.rst:180 #: ../Doc/library/dis.rst:180
msgid "interpretation of the parameters in parentheses." msgid "interpretation of the parameters in parentheses."
msgstr "" msgstr "interprétation des paramètres entre parenthèses."
#: ../Doc/library/dis.rst:182 #: ../Doc/library/dis.rst:182
msgid "" msgid ""
"The parameter interpretation recognizes local and global variable names, " "The parameter interpretation recognizes local and global variable names, "
"constant values, branch targets, and compare operators." "constant values, branch targets, and compare operators."
msgstr "" msgstr ""
"L'interprétation du paramètre reconnaît les noms des variables locales et "
"globales, des valeurs constantes, des branchements cibles, et des opérateurs "
"de comparaison."
#: ../Doc/library/dis.rst:194 #: ../Doc/library/dis.rst:194
msgid "" msgid ""
"Return an iterator over the instructions in the supplied function, method, " "Return an iterator over the instructions in the supplied function, method, "
"source code string or code object." "source code string or code object."
msgstr "" msgstr ""
"Retourne un itérateur sur les instructions dans la fonction fournie, la "
"méthode, les chaînes de caractères du code source ou objet."
#: ../Doc/library/dis.rst:197 #: ../Doc/library/dis.rst:197
msgid "" msgid ""
"The iterator generates a series of :class:`Instruction` named tuples giving " "The iterator generates a series of :class:`Instruction` named tuples giving "
"the details of each operation in the supplied code." "the details of each operation in the supplied code."
msgstr "" msgstr ""
"Cet itérateur génère une série de n-uplets de :class:`Instruction` qui "
"donnent les détails de chacune des opérations dans le code fourni."
#: ../Doc/library/dis.rst:210 #: ../Doc/library/dis.rst:210
msgid "" msgid ""
@ -264,31 +325,37 @@ msgstr ""
#: ../Doc/library/dis.rst:230 #: ../Doc/library/dis.rst:230
msgid "Python Bytecode Instructions" msgid "Python Bytecode Instructions"
msgstr "" msgstr "Les instructions du code intermédiaire en Python"
#: ../Doc/library/dis.rst:232 #: ../Doc/library/dis.rst:232
msgid "" msgid ""
"The :func:`get_instructions` function and :class:`Bytecode` class provide " "The :func:`get_instructions` function and :class:`Bytecode` class provide "
"details of bytecode instructions as :class:`Instruction` instances:" "details of bytecode instructions as :class:`Instruction` instances:"
msgstr "" msgstr ""
"La fonction :func:`get_instructions` et la méthode :class:`Bytecode` fournit "
"des détails sur le code intermédiaire des instructions comme :class:"
"`Instruction` instances:"
#: ../Doc/library/dis.rst:237 #: ../Doc/library/dis.rst:237
msgid "Details for a bytecode operation" msgid "Details for a bytecode operation"
msgstr "" msgstr "Détails sur le code intermédiaire de l'opération"
#: ../Doc/library/dis.rst:241 #: ../Doc/library/dis.rst:241
msgid "" msgid ""
"numeric code for operation, corresponding to the opcode values listed below " "numeric code for operation, corresponding to the opcode values listed below "
"and the bytecode values in the :ref:`opcode_collections`." "and the bytecode values in the :ref:`opcode_collections`."
msgstr "" msgstr ""
"code numérique pour l'opération, correspondant aux valeurs de l'*opcode* ci-"
"dessous et les valeurs du code intermédiaire dans la :ref:"
"`opcode_collections`."
#: ../Doc/library/dis.rst:247 #: ../Doc/library/dis.rst:247
msgid "human readable name for operation" msgid "human readable name for operation"
msgstr "" msgstr "nom lisible/compréhensible de l'opération"
#: ../Doc/library/dis.rst:252 #: ../Doc/library/dis.rst:252
msgid "numeric argument to operation (if any), otherwise ``None``" msgid "numeric argument to operation (if any), otherwise ``None``"
msgstr "" msgstr "le cas échéant, argument numérique de l'opération sinon ``None``"
#: ../Doc/library/dis.rst:257 #: ../Doc/library/dis.rst:257
msgid "resolved arg value (if known), otherwise same as arg" msgid "resolved arg value (if known), otherwise same as arg"

View File

@ -18,7 +18,7 @@ msgstr ""
#: ../Doc/library/enum.rst:2 #: ../Doc/library/enum.rst:2
msgid ":mod:`enum` --- Support for enumerations" msgid ":mod:`enum` --- Support for enumerations"
msgstr "" msgstr ":mod:`enum` — Énumerations"
#: ../Doc/library/enum.rst:14 #: ../Doc/library/enum.rst:14
msgid "**Source code:** :source:`Lib/enum.py`" msgid "**Source code:** :source:`Lib/enum.py`"
@ -30,6 +30,10 @@ msgid ""
"constant values. Within an enumeration, the members can be compared by " "constant values. Within an enumeration, the members can be compared by "
"identity, and the enumeration itself can be iterated over." "identity, and the enumeration itself can be iterated over."
msgstr "" msgstr ""
"Une énumération est un ensemble de noms symboliques, appelés *membres*, liés "
"à des valeurs constantes et uniques. Au sein d'une énumération, les membres "
"peuvent être comparés entre eux et il est possible d'itérer sur "
"l'énumération elle-même."
#: ../Doc/library/enum.rst:24 #: ../Doc/library/enum.rst:24
msgid "Module Contents" msgid "Module Contents"
@ -47,21 +51,27 @@ msgid ""
"Base class for creating enumerated constants. See section `Functional API`_ " "Base class for creating enumerated constants. See section `Functional API`_ "
"for an alternate construction syntax." "for an alternate construction syntax."
msgstr "" msgstr ""
"Classe de base pour créer une énumération de constantes. Voir la section "
"`API par fonction`_ pour une syntaxe alternative de construction."
#: ../Doc/library/enum.rst:37 #: ../Doc/library/enum.rst:37
msgid "" msgid ""
"Base class for creating enumerated constants that are also subclasses of :" "Base class for creating enumerated constants that are also subclasses of :"
"class:`int`." "class:`int`."
msgstr "" msgstr ""
"Classe de base pour créer une énumération de constantes qui sont également "
"des sous-classes de :class:`int`."
#: ../Doc/library/enum.rst:42 #: ../Doc/library/enum.rst:42
msgid "" msgid ""
"Enum class decorator that ensures only one name is bound to any one value." "Enum class decorator that ensures only one name is bound to any one value."
msgstr "" msgstr ""
"Décorateur de classe qui garantit qu'une valeur ne puisse être associée qu'à "
"un seul nom."
#: ../Doc/library/enum.rst:46 #: ../Doc/library/enum.rst:46
msgid "Creating an Enum" msgid "Creating an Enum"
msgstr "" msgstr "Création d'une *Enum*"
#: ../Doc/library/enum.rst:48 #: ../Doc/library/enum.rst:48
msgid "" msgid ""
@ -70,14 +80,18 @@ msgid ""
"`Functional API`_. To define an enumeration, subclass :class:`Enum` as " "`Functional API`_. To define an enumeration, subclass :class:`Enum` as "
"follows::" "follows::"
msgstr "" msgstr ""
"Une énumération est créée comme une :keyword:`class`, ce qui la rend facile "
"à lire et à écrire. Une autre méthode de création est décrite dans `API par "
"fonction`_. Pour définir une énumération, il faut hériter de :class:`Enum` "
"de la manière suivante : ::"
#: ../Doc/library/enum.rst:60 #: ../Doc/library/enum.rst:60
msgid "Nomenclature" msgid "Nomenclature"
msgstr "" msgstr "Nomenclature"
#: ../Doc/library/enum.rst:62 #: ../Doc/library/enum.rst:62
msgid "The class :class:`Color` is an *enumeration* (or *enum*)" msgid "The class :class:`Color` is an *enumeration* (or *enum*)"
msgstr "" msgstr "La classe :class:`Color` est une *énumération* (ou un *enum*)."
#: ../Doc/library/enum.rst:63 #: ../Doc/library/enum.rst:63
msgid "" msgid ""
@ -96,36 +110,46 @@ msgid ""
"Even though we use the :keyword:`class` syntax to create Enums, Enums are " "Even though we use the :keyword:`class` syntax to create Enums, Enums are "
"not normal Python classes. See `How are Enums different?`_ for more details." "not normal Python classes. See `How are Enums different?`_ for more details."
msgstr "" msgstr ""
"Même si on utilise la syntaxe en :keyword:`class` pour créer des "
"énumérations, les *Enums* ne sont pas des vraies classes Python. Voir `En "
"quoi les Enums sont différentes ?`_ pour plus de détails."
#: ../Doc/library/enum.rst:75 #: ../Doc/library/enum.rst:75
msgid "Enumeration members have human readable string representations::" msgid "Enumeration members have human readable string representations::"
msgstr "" msgstr ""
"Les membres d'une énumération ont une représentation en chaîne de caractères "
"compréhensible par un humain : ::"
#: ../Doc/library/enum.rst:80 #: ../Doc/library/enum.rst:80
msgid "...while their ``repr`` has more information::" msgid "...while their ``repr`` has more information::"
msgstr "" msgstr "… tandis que leur ``repr`` contient plus d'informations : ::"
#: ../Doc/library/enum.rst:85 #: ../Doc/library/enum.rst:85
msgid "The *type* of an enumeration member is the enumeration it belongs to::" msgid "The *type* of an enumeration member is the enumeration it belongs to::"
msgstr "" msgstr ""
"Le *type* d'un membre est l'énumération auquel ce membre appartient : ::"
#: ../Doc/library/enum.rst:93 #: ../Doc/library/enum.rst:93
msgid "Enum members also have a property that contains just their item name::" msgid "Enum members also have a property that contains just their item name::"
msgstr "" msgstr "Les membres ont également un attribut qui contient leur nom : ::"
#: ../Doc/library/enum.rst:98 #: ../Doc/library/enum.rst:98
msgid "Enumerations support iteration, in definition order::" msgid "Enumerations support iteration, in definition order::"
msgstr "" msgstr ""
"Les énumérations sont itérables, l'ordre d'itération est celui dans lequel "
"les membres sont déclarés : ::"
#: ../Doc/library/enum.rst:114 #: ../Doc/library/enum.rst:114
msgid "" msgid ""
"Enumeration members are hashable, so they can be used in dictionaries and " "Enumeration members are hashable, so they can be used in dictionaries and "
"sets::" "sets::"
msgstr "" msgstr ""
"Les membres d'une énumération sont hachables, ils peuvent ainsi être "
"utilisés dans des dictionnaires ou des ensembles : ::"
#: ../Doc/library/enum.rst:124 #: ../Doc/library/enum.rst:124
msgid "Programmatic access to enumeration members and their attributes" msgid "Programmatic access to enumeration members and their attributes"
msgstr "" msgstr "Accès dynamique aux membres et à leurs attributs"
#: ../Doc/library/enum.rst:126 #: ../Doc/library/enum.rst:126
msgid "" msgid ""
@ -137,18 +161,20 @@ msgstr ""
#: ../Doc/library/enum.rst:135 #: ../Doc/library/enum.rst:135
msgid "If you want to access enum members by *name*, use item access::" msgid "If you want to access enum members by *name*, use item access::"
msgstr "" msgstr ""
"Pour accéder aux membres par leur *nom*, utilisez l'accès par indexation : ::"
#: ../Doc/library/enum.rst:142 #: ../Doc/library/enum.rst:142
msgid "If you have an enum member and need its :attr:`name` or :attr:`value`::" msgid "If you have an enum member and need its :attr:`name` or :attr:`value`::"
msgstr "" msgstr "Pour obtenir l'attribut :attr:`name` ou :attr:`value` d'un membre : ::"
#: ../Doc/library/enum.rst:152 #: ../Doc/library/enum.rst:152
msgid "Duplicating enum members and values" msgid "Duplicating enum members and values"
msgstr "" msgstr "Duplication de membres et de valeurs"
#: ../Doc/library/enum.rst:154 #: ../Doc/library/enum.rst:154
msgid "Having two enum members with the same name is invalid::" msgid "Having two enum members with the same name is invalid::"
msgstr "" msgstr ""
"Il n'est pas possible d'avoir deux membres du même nom dans un *enum* : ::"
#: ../Doc/library/enum.rst:164 #: ../Doc/library/enum.rst:164
msgid "" msgid ""
@ -157,6 +183,10 @@ msgid ""
"A. By-value lookup of the value of A and B will return A. By-name lookup " "A. By-value lookup of the value of A and B will return A. By-name lookup "
"of B will also return A::" "of B will also return A::"
msgstr "" msgstr ""
"Cependant deux membres peuvent avoir la même valeur. Si deux membres A et B "
"ont la même valeur (et que A est défini en premier), B sera un alias de A. "
"Un accès par valeur avec la valeur commune à A et B renverra A. Un accès à B "
"par nom renverra aussi A : ::"
#: ../Doc/library/enum.rst:184 #: ../Doc/library/enum.rst:184
msgid "" msgid ""
@ -164,10 +194,13 @@ msgid ""
"attribute (another member, a method, etc.) or attempting to create an " "attribute (another member, a method, etc.) or attempting to create an "
"attribute with the same name as a member is not allowed." "attribute with the same name as a member is not allowed."
msgstr "" msgstr ""
"Il est interdit de créer un membre avec le même nom qu'un attribut déjà "
"défini (un autre membre, une méthode, etc.) ou de créer un attribut avec le "
"nom d'un membre."
#: ../Doc/library/enum.rst:190 #: ../Doc/library/enum.rst:190
msgid "Ensuring unique enumeration values" msgid "Ensuring unique enumeration values"
msgstr "" msgstr "Coercition d'unicité des valeurs d'une énumération"
#: ../Doc/library/enum.rst:192 #: ../Doc/library/enum.rst:192
msgid "" msgid ""
@ -175,6 +208,10 @@ msgid ""
"When this behavior isn't desired, the following decorator can be used to " "When this behavior isn't desired, the following decorator can be used to "
"ensure each value is used only once in the enumeration:" "ensure each value is used only once in the enumeration:"
msgstr "" msgstr ""
"Par défaut, les énumérations autorisent les alias de nom pour une même "
"valeur. Quand ce comportement n'est pas désiré, il faut utiliser le "
"décorateur suivant pour s'assurer que chaque valeur n'est utilisée qu'une "
"seule fois au sein de l'énumération : ::"
#: ../Doc/library/enum.rst:198 #: ../Doc/library/enum.rst:198
msgid "" msgid ""
@ -182,14 +219,18 @@ msgid ""
"enumeration's :attr:`__members__` gathering any aliases it finds; if any are " "enumeration's :attr:`__members__` gathering any aliases it finds; if any are "
"found :exc:`ValueError` is raised with the details::" "found :exc:`ValueError` is raised with the details::"
msgstr "" msgstr ""
"Un décorateur de :keyword:`class` spécifique aux énumérations. Il examine "
"l'attribut :attr:`__members__` d'une énumération et recherche des alias ; "
"s'il en trouve, l'exception :exc:`ValueError` est levée avec des détails : ::"
#: ../Doc/library/enum.rst:216 #: ../Doc/library/enum.rst:216
msgid "Iteration" msgid "Iteration"
msgstr "" msgstr "Itération"
#: ../Doc/library/enum.rst:218 #: ../Doc/library/enum.rst:218
msgid "Iterating over the members of an enum does not provide the aliases::" msgid "Iterating over the members of an enum does not provide the aliases::"
msgstr "" msgstr ""
"Itérer sur les membres d'une énumération ne parcourt pas les alias : ::"
#: ../Doc/library/enum.rst:223 #: ../Doc/library/enum.rst:223
msgid "" msgid ""
@ -203,6 +244,8 @@ msgid ""
"The ``__members__`` attribute can be used for detailed programmatic access " "The ``__members__`` attribute can be used for detailed programmatic access "
"to the enumeration members. For example, finding all the aliases::" "to the enumeration members. For example, finding all the aliases::"
msgstr "" msgstr ""
"L'attribut ``__members__`` peut servir à accéder dynamiquement aux membres "
"de l'énumération. Par exemple, pour trouver tous les alias : ::"
#: ../Doc/library/enum.rst:243 #: ../Doc/library/enum.rst:243
msgid "Comparisons" msgid "Comparisons"
@ -210,17 +253,20 @@ msgstr "Comparaisons"
#: ../Doc/library/enum.rst:245 #: ../Doc/library/enum.rst:245
msgid "Enumeration members are compared by identity::" msgid "Enumeration members are compared by identity::"
msgstr "" msgstr "Les membres d'une énumération sont comparés par identité : ::"
#: ../Doc/library/enum.rst:254 #: ../Doc/library/enum.rst:254
msgid "" msgid ""
"Ordered comparisons between enumeration values are *not* supported. Enum " "Ordered comparisons between enumeration values are *not* supported. Enum "
"members are not integers (but see `IntEnum`_ below)::" "members are not integers (but see `IntEnum`_ below)::"
msgstr "" msgstr ""
"Les comparaisons d'ordre entre les valeurs d'une énumération n'existent "
"*pas* ; les membres d'un *enum* ne sont pas des entiers (voir cependant "
"`IntEnum`_ ci-dessous) : ::"
#: ../Doc/library/enum.rst:262 #: ../Doc/library/enum.rst:262
msgid "Equality comparisons are defined though::" msgid "Equality comparisons are defined though::"
msgstr "" msgstr "A contrario, les comparaisons d'égalité existent : ::"
#: ../Doc/library/enum.rst:271 #: ../Doc/library/enum.rst:271
msgid "" msgid ""
@ -228,10 +274,13 @@ msgid ""
"(again, :class:`IntEnum` was explicitly designed to behave differently, see " "(again, :class:`IntEnum` was explicitly designed to behave differently, see "
"below)::" "below)::"
msgstr "" msgstr ""
"Les comparaisons avec des valeurs ne provenant pas d'énumérations sont "
"toujours fausses (ici encore, :class:`IntEnum` a été conçue pour fonctionner "
"différemment, voir ci-dessous) : ::"
#: ../Doc/library/enum.rst:280 #: ../Doc/library/enum.rst:280
msgid "Allowed members and attributes of enumerations" msgid "Allowed members and attributes of enumerations"
msgstr "" msgstr "Membres et attributs autorisés dans une énumération"
#: ../Doc/library/enum.rst:282 #: ../Doc/library/enum.rst:282
msgid "" msgid ""
@ -241,16 +290,24 @@ msgid ""
"the actual value of an enumeration is. But if the value *is* important, " "the actual value of an enumeration is. But if the value *is* important, "
"enumerations can have arbitrary values." "enumerations can have arbitrary values."
msgstr "" msgstr ""
"Les exemples précédents utilisent des entiers pour énumérer les valeurs. "
"C'est un choix concis et pratique (et implémenté par défaut dans l'`API par "
"fonction`_), mais ce n'est pas une obligation. Dans la majorité des cas, il "
"importe peu de connaître la valeur réelle d'une énumération. Il est "
"toutefois possible de donner une valeur arbitraire aux énumérations, si "
"cette valeur est *vraiment* significative."
#: ../Doc/library/enum.rst:288 #: ../Doc/library/enum.rst:288
msgid "" msgid ""
"Enumerations are Python classes, and can have methods and special methods as " "Enumerations are Python classes, and can have methods and special methods as "
"usual. If we have this enumeration::" "usual. If we have this enumeration::"
msgstr "" msgstr ""
"Les énumérations sont des classes Python et peuvent donc avoir des méthodes "
"et des méthodes spéciales. L'énumération suivante : ::"
#: ../Doc/library/enum.rst:308 #: ../Doc/library/enum.rst:308
msgid "Then::" msgid "Then::"
msgstr "" msgstr "amène : ::"
#: ../Doc/library/enum.rst:317 #: ../Doc/library/enum.rst:317
msgid "" msgid ""
@ -267,6 +324,9 @@ msgid ""
"then whatever value(s) were given to the enum member will be passed into " "then whatever value(s) were given to the enum member will be passed into "
"those methods. See `Planet`_ for an example." "those methods. See `Planet`_ for an example."
msgstr "" msgstr ""
"Remarque : si l'énumération définit :meth:`__new__` ou :meth:`__init__`, "
"alors la (ou les) valeur affectée au membre sera passée à ces méthodes. Voir "
"l'exemple de `Planet`_."
#: ../Doc/library/enum.rst:329 #: ../Doc/library/enum.rst:329
msgid "Restricted subclassing of enumerations" msgid "Restricted subclassing of enumerations"
@ -280,7 +340,7 @@ msgstr ""
#: ../Doc/library/enum.rst:341 #: ../Doc/library/enum.rst:341
msgid "But this is allowed::" msgid "But this is allowed::"
msgstr "" msgstr "Mais celui-ci est correct : ::"
#: ../Doc/library/enum.rst:352 #: ../Doc/library/enum.rst:352
msgid "" msgid ""
@ -289,14 +349,18 @@ msgid ""
"makes sense to allow sharing some common behavior between a group of " "makes sense to allow sharing some common behavior between a group of "
"enumerations. (See `OrderedEnum`_ for an example.)" "enumerations. (See `OrderedEnum`_ for an example.)"
msgstr "" msgstr ""
"Autoriser l'héritage d'*enums* définissant des membres violerait des "
"invariants sur les types et les instances. D'un autre côté, il est logique "
"d'autoriser un groupe d'énumérations à partager un comportement commun (voir "
"par exemple `OrderedEnum`_)."
#: ../Doc/library/enum.rst:359 #: ../Doc/library/enum.rst:359
msgid "Pickling" msgid "Pickling"
msgstr "" msgstr "Sérialisation"
#: ../Doc/library/enum.rst:361 #: ../Doc/library/enum.rst:361
msgid "Enumerations can be pickled and unpickled::" msgid "Enumerations can be pickled and unpickled::"
msgstr "" msgstr "Les énumérations peuvent être sérialisées et dé-sérialisées : ::"
#: ../Doc/library/enum.rst:368 #: ../Doc/library/enum.rst:368
msgid "" msgid ""
@ -304,33 +368,44 @@ msgid ""
"in the top level of a module, since unpickling requires them to be " "in the top level of a module, since unpickling requires them to be "
"importable from that module." "importable from that module."
msgstr "" msgstr ""
"Les restrictions habituelles de sérialisation s'appliquent : les *enums* à "
"sérialiser doivent être déclarés dans l'espace de nom de haut niveau du "
"module car la dé-sérialisation nécessite que ces *enums* puissent être "
"importés depuis ce module."
#: ../Doc/library/enum.rst:374 #: ../Doc/library/enum.rst:374
msgid "" msgid ""
"With pickle protocol version 4 it is possible to easily pickle enums nested " "With pickle protocol version 4 it is possible to easily pickle enums nested "
"in other classes." "in other classes."
msgstr "" msgstr ""
"Depuis la version 4 du protocole de *pickle*, il est possible de sérialiser "
"facilement des *enums* imbriqués dans d'autres classes."
#: ../Doc/library/enum.rst:377 #: ../Doc/library/enum.rst:377
msgid "" msgid ""
"It is possible to modify how Enum members are pickled/unpickled by defining :" "It is possible to modify how Enum members are pickled/unpickled by defining :"
"meth:`__reduce_ex__` in the enumeration class." "meth:`__reduce_ex__` in the enumeration class."
msgstr "" msgstr ""
"Redéfinir la méthode :meth:`__reduce_ex__` permet de modifier la "
"sérialisation ou la dé-sérialisation des membres d'une énumération."
#: ../Doc/library/enum.rst:382 #: ../Doc/library/enum.rst:382
msgid "Functional API" msgid "Functional API"
msgstr "" msgstr "API par fonction"
#: ../Doc/library/enum.rst:384 #: ../Doc/library/enum.rst:384
msgid "" msgid ""
"The :class:`Enum` class is callable, providing the following functional API::" "The :class:`Enum` class is callable, providing the following functional API::"
msgstr "" msgstr ""
"La :class:`Enum` est appelable et implémente l'API par fonction suivante : ::"
#: ../Doc/library/enum.rst:396 #: ../Doc/library/enum.rst:396
msgid "" msgid ""
"The semantics of this API resemble :class:`~collections.namedtuple`. The " "The semantics of this API resemble :class:`~collections.namedtuple`. The "
"first argument of the call to :class:`Enum` is the name of the enumeration." "first argument of the call to :class:`Enum` is the name of the enumeration."
msgstr "" msgstr ""
"La sémantique de cette API est similaire à :class:`~collections.namedtuple`. "
"Le premier argument de l'appel à :class:`Enum` est le nom de l'énumération."
#: ../Doc/library/enum.rst:399 #: ../Doc/library/enum.rst:399
msgid "" msgid ""
@ -343,6 +418,15 @@ msgid ""
"class derived from :class:`Enum` is returned. In other words, the above " "class derived from :class:`Enum` is returned. In other words, the above "
"assignment to :class:`Animal` is equivalent to::" "assignment to :class:`Animal` is equivalent to::"
msgstr "" msgstr ""
"Le second argument est la *source* des noms des membres de l'énumération. Il "
"peut être une chaîne de caractères contenant les noms séparés par des "
"espaces, une séquence de noms, une séquence de couples clé / valeur ou un "
"dictionnaire (p. ex. un *dict*) de valeurs indexées par des noms. Les deux "
"dernières options permettent d'affecter des valeurs arbitraires aux "
"énumérations ; les autres affectent automatiquement des entiers en "
"commençant par 1 (le paramètre ``start`` permet de changer la valeur de "
"départ). Ceci renvoie une nouvelle classe dérivée de :class:`Enum`. En "
"d'autres termes, la déclaration de :class:`Animal` ci-dessus équivaut à : ::"
#: ../Doc/library/enum.rst:415 #: ../Doc/library/enum.rst:415
msgid "" msgid ""
@ -350,6 +434,9 @@ msgid ""
"that ``0`` is ``False`` in a boolean sense, but enum members all evaluate to " "that ``0`` is ``False`` in a boolean sense, but enum members all evaluate to "
"``True``." "``True``."
msgstr "" msgstr ""
"La valeur de départ par défaut est ``1`` et non ``0`` car ``0`` au sens "
"booléen vaut ``False`` alors que tous les membres d'une *enum* valent "
"``True``."
#: ../Doc/library/enum.rst:419 #: ../Doc/library/enum.rst:419
msgid "" msgid ""
@ -359,6 +446,13 @@ msgid ""
"function in separate module, and also may not work on IronPython or Jython). " "function in separate module, and also may not work on IronPython or Jython). "
"The solution is to specify the module name explicitly as follows::" "The solution is to specify the module name explicitly as follows::"
msgstr "" msgstr ""
"La sérialisation d'énumérations créées avec l'API en fonction peut être "
"source de problèmes, car celle-ci repose sur des détails d'implémentation de "
"l'affichage de la pile d'appel pour tenter de déterminer dans quel module "
"l'énumération est créée (p. ex. elle échouera avec les fonctions utilitaires "
"provenant d'un module séparé et peut ne pas fonctionner avec IronPython ou "
"Jython). La solution consiste à préciser explicitement le nom du module "
"comme ceci : ::"
#: ../Doc/library/enum.rst:429 #: ../Doc/library/enum.rst:429
msgid "" msgid ""
@ -366,6 +460,9 @@ msgid ""
"Enum members will not be unpicklable; to keep errors closer to the source, " "Enum members will not be unpicklable; to keep errors closer to the source, "
"pickling will be disabled." "pickling will be disabled."
msgstr "" msgstr ""
"Si ``module`` n'est pas fourni et que *Enum* ne peut pas le deviner, les "
"nouveaux membres de *l'Enum* ne seront pas dé-sérialisables ; pour garder "
"les erreurs au plus près de leur origine, la sérialisation sera désactivée."
#: ../Doc/library/enum.rst:433 #: ../Doc/library/enum.rst:433
msgid "" msgid ""
@ -374,56 +471,64 @@ msgid ""
"able to find the class. For example, if the class was made available in " "able to find the class. For example, if the class was made available in "
"class SomeData in the global scope::" "class SomeData in the global scope::"
msgstr "" msgstr ""
"Le nouveau protocole version 4 de *pickle* se base lui aussi, dans certains "
"cas, sur le fait que :attr:`~definition.__qualname__` pointe sur l'endroit "
"où *pickle* peut trouver la classe. Par exemple, si la classe était "
"disponible depuis la classe *SomeData* dans l'espace de nom de plus haut "
"niveau : ::"
#: ../Doc/library/enum.rst:440 #: ../Doc/library/enum.rst:440
msgid "The complete signature is::" msgid "The complete signature is::"
msgstr "" msgstr "La signature complète est la suivante : ::"
#: ../Doc/library/enum.rst:444 #: ../Doc/library/enum.rst:444
msgid "What the new Enum class will record as its name." msgid "What the new Enum class will record as its name."
msgstr "" msgstr "Le nom de la la nouvelle classe *Enum*."
#: ../Doc/library/enum.rst:446 #: ../Doc/library/enum.rst:446
msgid "" msgid ""
"The Enum members. This can be a whitespace or comma separated string " "The Enum members. This can be a whitespace or comma separated string "
"(values will start at 1 unless otherwise specified)::" "(values will start at 1 unless otherwise specified)::"
msgstr "" msgstr ""
"Les membres de l'énumération. Une chaîne de caractères séparés par des "
"espaces ou des virgules (la valeur de départ est fixée à 1, sauf si "
"spécifiée autrement) : ::"
#: ../Doc/library/enum.rst:451 #: ../Doc/library/enum.rst:451
msgid "or an iterator of names::" msgid "or an iterator of names::"
msgstr "" msgstr "ou un itérateur sur les noms : ::"
#: ../Doc/library/enum.rst:455 #: ../Doc/library/enum.rst:455
msgid "or an iterator of (name, value) pairs::" msgid "or an iterator of (name, value) pairs::"
msgstr "" msgstr "ou un itérateur sur les tuples (nom, valeur) : ::"
#: ../Doc/library/enum.rst:459 #: ../Doc/library/enum.rst:459
msgid "or a mapping::" msgid "or a mapping::"
msgstr "" msgstr "ou une correspondance : ::"
#: ../Doc/library/enum.rst:463 #: ../Doc/library/enum.rst:463
msgid "name of module where new Enum class can be found." msgid "name of module where new Enum class can be found."
msgstr "" msgstr "nom du module dans lequel la classe *Enum* se trouve."
#: ../Doc/library/enum.rst:465 #: ../Doc/library/enum.rst:465
msgid "where in module new Enum class can be found." msgid "where in module new Enum class can be found."
msgstr "" msgstr "localisation de la nouvelle classe *Enum* dans le module."
#: ../Doc/library/enum.rst:467 #: ../Doc/library/enum.rst:467
msgid "type to mix in to new Enum class." msgid "type to mix in to new Enum class."
msgstr "" msgstr "le type à mélanger dans la nouvelle classe *Enum*."
#: ../Doc/library/enum.rst:469 #: ../Doc/library/enum.rst:469
msgid "number to start counting at if only names are passed in." msgid "number to start counting at if only names are passed in."
msgstr "" msgstr "index de départ si uniquement des noms sont passés."
#: ../Doc/library/enum.rst:471 #: ../Doc/library/enum.rst:471
msgid "The *start* parameter was added." msgid "The *start* parameter was added."
msgstr "" msgstr "Ajout du paramètre *start*."
#: ../Doc/library/enum.rst:476 #: ../Doc/library/enum.rst:476
msgid "Derived Enumerations" msgid "Derived Enumerations"
msgstr "" msgstr "Énumérations dérivées"
#: ../Doc/library/enum.rst:479 #: ../Doc/library/enum.rst:479
msgid "IntEnum" msgid "IntEnum"
@ -442,11 +547,15 @@ msgid ""
"However, they still can't be compared to standard :class:`Enum` " "However, they still can't be compared to standard :class:`Enum` "
"enumerations::" "enumerations::"
msgstr "" msgstr ""
"Elles ne peuvent cependant toujours pas être comparées à des énumérations "
"standards de :class:`Enum` : ::"
#: ../Doc/library/enum.rst:515 #: ../Doc/library/enum.rst:515
msgid "" msgid ""
":class:`IntEnum` values behave like integers in other ways you'd expect::" ":class:`IntEnum` values behave like integers in other ways you'd expect::"
msgstr "" msgstr ""
"Les valeurs de :class:`IntEnum` se comportent comme des entiers, comme on "
"pouvait s'y attendre : ::"
#: ../Doc/library/enum.rst:524 #: ../Doc/library/enum.rst:524
msgid "" msgid ""
@ -468,6 +577,8 @@ msgid ""
"While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " "While :class:`IntEnum` is part of the :mod:`enum` module, it would be very "
"simple to implement independently::" "simple to implement independently::"
msgstr "" msgstr ""
"Bien que :class:`IntEnum` fasse partie du module :mod:`enum`, elle serait "
"très simple à implémenter hors de ce module : ::"
#: ../Doc/library/enum.rst:542 #: ../Doc/library/enum.rst:542
msgid "" msgid ""
@ -475,10 +586,13 @@ msgid ""
"example a :class:`StrEnum` that mixes in :class:`str` instead of :class:" "example a :class:`StrEnum` that mixes in :class:`str` instead of :class:"
"`int`." "`int`."
msgstr "" msgstr ""
"Ceci montre comment définir des énumérations dérivées similaires ; par "
"exemple une classe :class:`StrEnum` qui dériverait de :class:`str` au lieu "
"de :class:`int`."
#: ../Doc/library/enum.rst:545 #: ../Doc/library/enum.rst:545
msgid "Some rules:" msgid "Some rules:"
msgstr "" msgstr "Quelques règles :"
#: ../Doc/library/enum.rst:547 #: ../Doc/library/enum.rst:547
msgid "" msgid ""
@ -486,6 +600,9 @@ msgid ""
"`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example " "`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example "
"above." "above."
msgstr "" msgstr ""
"Pour hériter de :class:`Enum`, les types de mélange doivent être placés "
"avant la classe :class:`Enum` elle-même dans la liste des classes de base, "
"comme dans l'exemple de :class:`IntEnum` ci-dessus."
#: ../Doc/library/enum.rst:550 #: ../Doc/library/enum.rst:550
msgid "" msgid ""
@ -495,6 +612,11 @@ msgid ""
"methods and don't specify another data type such as :class:`int` or :class:" "methods and don't specify another data type such as :class:`int` or :class:"
"`str`." "`str`."
msgstr "" msgstr ""
"Même si une classe :class:`Enum` peut avoir des membres de n'importe quel "
"type, dès lors qu'un type de mélange est ajouté, tous les membres doivent "
"être de ce type, p. ex. :class:`int` ci-dessus. Cette restriction ne "
"s'applique pas aux types de mélange qui ne font qu'ajouter des méthodes et "
"ne définissent pas de type de données, tels :class:`int` ou :class:`str`. "
#: ../Doc/library/enum.rst:555 #: ../Doc/library/enum.rst:555
msgid "" msgid ""
@ -502,6 +624,9 @@ msgid ""
"same* as the enum member itself, although it is equivalent and will compare " "same* as the enum member itself, although it is equivalent and will compare "
"equal." "equal."
msgstr "" msgstr ""
"Quand un autre type de données est mélangé, l'attribut :attr:`value` n'est "
"*pas* identique au membre de l'énumération lui-même, bien qu'ils soient "
"équivalents et égaux en comparaison."
#: ../Doc/library/enum.rst:558 #: ../Doc/library/enum.rst:558
msgid "" msgid ""
@ -509,6 +634,10 @@ msgid ""
"`__str__` and :meth:`__repr__` respectively; other codes (such as `%i` or `" "`__str__` and :meth:`__repr__` respectively; other codes (such as `%i` or `"
"%h` for IntEnum) treat the enum member as its mixed-in type." "%h` for IntEnum) treat the enum member as its mixed-in type."
msgstr "" msgstr ""
"Formatage de style *%* : `%s` et `%r` appellent respectivement les méthodes :"
"meth:`__str__` et :meth:`__repr__` de la classe :class:`Enum` ; les autres "
"codes, comme `%i` ou `%h` pour *IntEnum*, s'appliquent au membre comme si "
"celui-ci était converti en son type de mélange."
#: ../Doc/library/enum.rst:561 #: ../Doc/library/enum.rst:561
msgid "" msgid ""
@ -519,7 +648,7 @@ msgstr ""
#: ../Doc/library/enum.rst:567 #: ../Doc/library/enum.rst:567
msgid "Interesting examples" msgid "Interesting examples"
msgstr "" msgstr "Exemples intéressants"
#: ../Doc/library/enum.rst:569 #: ../Doc/library/enum.rst:569
msgid "" msgid ""
@ -543,6 +672,10 @@ msgid ""
"members; it is then replaced by Enum's :meth:`__new__` which is used after " "members; it is then replaced by Enum's :meth:`__new__` which is used after "
"class creation for lookup of existing members." "class creation for lookup of existing members."
msgstr "" msgstr ""
"La méthode :meth:`__new__`, si définie, est appelée à la création des "
"membres de l'énumération ; elle est ensuite remplacée par la méthode :meth:"
"`__new__` de *Enum*, qui est utilisée après la création de la classe pour la "
"recherche des membres existants."
#: ../Doc/library/enum.rst:603 #: ../Doc/library/enum.rst:603
msgid "OrderedEnum" msgid "OrderedEnum"
@ -554,6 +687,10 @@ msgid ""
"maintains the normal :class:`Enum` invariants (such as not being comparable " "maintains the normal :class:`Enum` invariants (such as not being comparable "
"to other enumerations)::" "to other enumerations)::"
msgstr "" msgstr ""
"Une énumération ordonnée qui n'est pas basée sur :class:`IntEnum` et qui, "
"par conséquent, respecte les invariants classiques de :class:`Enum` (comme "
"par exemple l'impossibilité de pouvoir être comparée à d'autres "
"énumérations) ::"
#: ../Doc/library/enum.rst:639 #: ../Doc/library/enum.rst:639
msgid "DuplicateFreeEnum" msgid "DuplicateFreeEnum"
@ -564,6 +701,7 @@ msgid ""
"Raises an error if a duplicate member name is found instead of creating an " "Raises an error if a duplicate member name is found instead of creating an "
"alias::" "alias::"
msgstr "" msgstr ""
"Lève une erreur si un membre est dupliqué, plutôt que de créer un alias : ::"
#: ../Doc/library/enum.rst:666 #: ../Doc/library/enum.rst:666
msgid "" msgid ""
@ -571,30 +709,37 @@ msgid ""
"behaviors as well as disallowing aliases. If the only desired change is " "behaviors as well as disallowing aliases. If the only desired change is "
"disallowing aliases, the :func:`unique` decorator can be used instead." "disallowing aliases, the :func:`unique` decorator can be used instead."
msgstr "" msgstr ""
"Cet exemple d'héritage de *Enum* est intéressant pour ajouter ou modifier "
"des comportements comme interdire les alias. Si vous ne souhaitez "
"qu'interdire les alias, il suffit d'utiliser le décorateur :func:`unique`."
#: ../Doc/library/enum.rst:672 #: ../Doc/library/enum.rst:672
msgid "Planet" msgid "Planet"
msgstr "" msgstr "Planet"
#: ../Doc/library/enum.rst:674 #: ../Doc/library/enum.rst:674
msgid "" msgid ""
"If :meth:`__new__` or :meth:`__init__` is defined the value of the enum " "If :meth:`__new__` or :meth:`__init__` is defined the value of the enum "
"member will be passed to those methods::" "member will be passed to those methods::"
msgstr "" msgstr ""
"Si :meth:`__new__` ou :meth:`__init__` sont définies, la valeur du membre de "
"l'énumération sera passée à ces méthodes : ::"
#: ../Doc/library/enum.rst:702 #: ../Doc/library/enum.rst:702
msgid "How are Enums different?" msgid "How are Enums different?"
msgstr "" msgstr "En quoi les *Enums* sont différentes ?"
#: ../Doc/library/enum.rst:704 #: ../Doc/library/enum.rst:704
msgid "" msgid ""
"Enums have a custom metaclass that affects many aspects of both derived Enum " "Enums have a custom metaclass that affects many aspects of both derived Enum "
"classes and their instances (members)." "classes and their instances (members)."
msgstr "" msgstr ""
"Les *enums* ont une métaclasse spéciale qui affecte de nombreux aspects des "
"classes dérivées de *Enum* et de leur instances (membres)."
#: ../Doc/library/enum.rst:709 #: ../Doc/library/enum.rst:709
msgid "Enum Classes" msgid "Enum Classes"
msgstr "" msgstr "Classes *Enum*"
#: ../Doc/library/enum.rst:711 #: ../Doc/library/enum.rst:711
msgid "" msgid ""
@ -609,7 +754,7 @@ msgstr ""
#: ../Doc/library/enum.rst:721 #: ../Doc/library/enum.rst:721
msgid "Enum Members (aka instances)" msgid "Enum Members (aka instances)"
msgstr "" msgstr "Membres d'Enum (c.-à-d. instances)"
#: ../Doc/library/enum.rst:723 #: ../Doc/library/enum.rst:723
msgid "" msgid ""
@ -619,10 +764,16 @@ msgid ""
"no new ones are ever instantiated by returning only the existing member " "no new ones are ever instantiated by returning only the existing member "
"instances." "instances."
msgstr "" msgstr ""
"Il est intéressant de souligner que les membres d'une *Enum* sont des "
"singletons. La classe :class:`EnumMeta` les crée tous au moment de la "
"création de la classe :class:`Enum` elle-même et implémente une méthode :"
"meth:`__new__` spécifique. Cette méthode renvoie toujours les instances de "
"membres déjà existantes pour être sûr de ne jamais en instancier de "
"nouvelles."
#: ../Doc/library/enum.rst:731 #: ../Doc/library/enum.rst:731
msgid "Finer Points" msgid "Finer Points"
msgstr "" msgstr "Aspects approfondis"
#: ../Doc/library/enum.rst:733 #: ../Doc/library/enum.rst:733
msgid "" msgid ""
@ -642,6 +793,9 @@ msgid ""
"class above, those methods will show up in a :func:`dir` of the member, but " "class above, those methods will show up in a :func:`dir` of the member, but "
"not of the class::" "not of the class::"
msgstr "" msgstr ""
"Si votre classe :class:`Enum` contient des méthodes supplémentaires, comme "
"la classe `Planet`_ ci-dessus, elles s'afficheront avec un appel à :func:"
"`dir` sur le membre, mais pas avec un appel sur la classe : ::"
#: ../Doc/library/enum.rst:761 #: ../Doc/library/enum.rst:761
msgid "" msgid ""

View File

@ -19,6 +19,7 @@ msgstr ""
#: ../Doc/library/getopt.rst:2 #: ../Doc/library/getopt.rst:2
msgid ":mod:`getopt` --- C-style parser for command line options" msgid ":mod:`getopt` --- C-style parser for command line options"
msgstr "" msgstr ""
":mod:`getopt` Analyseur de style C pour les options de ligne de commande"
#: ../Doc/library/getopt.rst:8 #: ../Doc/library/getopt.rst:8
msgid "**Source code:** :source:`Lib/getopt.py`" msgid "**Source code:** :source:`Lib/getopt.py`"
@ -32,6 +33,12 @@ msgid ""
"write less code and get better help and error messages should consider using " "write less code and get better help and error messages should consider using "
"the :mod:`argparse` module instead." "the :mod:`argparse` module instead."
msgstr "" msgstr ""
"Le module :mod:`getopt` est un analyseur pour les options de ligne de "
"commande dont lAPI est conçue pour être familière aux utilisateurs de la "
"fonction C :c:func:`getopt`. Les utilisateurs qui ne connaissent pas la "
"fonction :c:func:`getopt` ou qui aimeraient écrire moins de code, obtenir "
"une meilleure aide et de meilleurs messages derreur devraient utiliser le "
"module :mod:`argparse`."
#: ../Doc/library/getopt.rst:20 #: ../Doc/library/getopt.rst:20
msgid "" msgid ""
@ -41,10 +48,16 @@ msgid ""
"and '``--``'). Long options similar to those supported by GNU software may " "and '``--``'). Long options similar to those supported by GNU software may "
"be used as well via an optional third argument." "be used as well via an optional third argument."
msgstr "" msgstr ""
"Ce module aide les scripts à analyser les arguments de ligne de commande "
"contenus dans ``sys.argv``. Il prend en charge les mêmes conventions que la "
"fonction UNIX :c:func:`getopt` (y compris les significations spéciales des "
"arguments de la forme ``-`` et ``--``). De longues options similaires à "
"celles prises en charge par le logiciel GNU peuvent également être utilisées "
"via un troisième argument facultatif."
#: ../Doc/library/getopt.rst:26 #: ../Doc/library/getopt.rst:26
msgid "This module provides two functions and an exception:" msgid "This module provides two functions and an exception:"
msgstr "" msgstr "Ce module fournit deux fonctions et une exception :"
#: ../Doc/library/getopt.rst:32 #: ../Doc/library/getopt.rst:32
msgid "" msgid ""
@ -55,6 +68,14 @@ msgid ""
"argument followed by a colon (``':'``; i.e., the same format that Unix :c:" "argument followed by a colon (``':'``; i.e., the same format that Unix :c:"
"func:`getopt` uses)." "func:`getopt` uses)."
msgstr "" msgstr ""
"Analyse les options de ligne de commande et la liste des paramètres. *args* "
"est la liste darguments à analyser, sans la référence principale au "
"programme en cours dexécution. En général, cela signifie ``sys.argv[1:]`` "
"(donc que le premier argument contenant le nom du programme nest pas dans "
"la liste). *shortopts* est la chaîne de lettres doptions que le script doit "
"reconnaître, avec des options qui requièrent un argument suivi dun signe "
"deux-points (``:``, donc le même format que la version Unix de :c:func:"
"`getopt` utilise)."
#: ../Doc/library/getopt.rst:40 #: ../Doc/library/getopt.rst:40
msgid "" msgid ""
@ -62,6 +83,9 @@ msgid ""
"arguments are considered also non-options. This is similar to the way non-" "arguments are considered also non-options. This is similar to the way non-"
"GNU Unix systems work." "GNU Unix systems work."
msgstr "" msgstr ""
"Contrairement au :c:func:`getopt` GNU, après un argument n'appartenant pas à "
"une option, aucun argument ne sera considéré comme appartenant à une option. "
"Ceci est similaire à la façon dont les systèmes UNIX non-GNU fonctionnent."
#: ../Doc/library/getopt.rst:44 #: ../Doc/library/getopt.rst:44
msgid "" msgid ""
@ -76,6 +100,17 @@ msgid ""
"option ``--fo`` will match as ``--foo``, but ``--f`` will not match " "option ``--fo`` will match as ``--foo``, but ``--f`` will not match "
"uniquely, so :exc:`GetoptError` will be raised." "uniquely, so :exc:`GetoptError` will be raised."
msgstr "" msgstr ""
"*longopts*, si spécifié, doit être une liste de chaînes avec les noms des "
"options longues qui doivent être prises en charge. Le premier ``'--'`` ne "
"dois pas figurer dans le nom de loption. Les options longues qui requièrent "
"un argument doivent être suivies dun signe égal (``'='``). Les arguments "
"facultatifs ne sont pas pris en charge. Pour accepter uniquement les options "
"longues, *shortopts* doit être une chaîne vide. Les options longues sur la "
"ligne de commande peuvent être reconnues tant quelles fournissent un "
"préfixe du nom de loption qui correspond exactement à lune des options "
"acceptées. Par exemple, si *longopts* est ``['foo', 'frob']``, loption ``--"
"fo`` correspondra à ``--foo``, mais ``--f`` ne correspondra pas de façon "
"unique, donc :exc:`GetoptError` sera levé."
#: ../Doc/library/getopt.rst:55 #: ../Doc/library/getopt.rst:55
msgid "" msgid ""
@ -89,6 +124,17 @@ msgid ""
"list in the same order in which they were found, thus allowing multiple " "list in the same order in which they were found, thus allowing multiple "
"occurrences. Long and short options may be mixed." "occurrences. Long and short options may be mixed."
msgstr "" msgstr ""
"La valeur de retour se compose de deux éléments : le premier est une liste "
"de paires ``(option, value)``, la deuxième est la liste des arguments de "
"programme laissés après que la liste doptions est été dépouillée (il sagit "
"dune tranche de fin de *args*). Chaque paire option-valeur retournée a "
"loption comme premier élément, préfixée avec un trait d'union pour les "
"options courtes (par exemple, ``'-x'``) ou deux tirets pour les options "
"longues (par exemple, ``'--long-option'``), et largument option comme "
"deuxième élément, ou une chaîne vide si le option na aucun argument. Les "
"options se trouvent dans la liste dans lordre dans lequel elles ont été "
"trouvées, permettant ainsi plusieurs occurrences. Les options longues et "
"courtes peuvent être mélangées."
#: ../Doc/library/getopt.rst:68 #: ../Doc/library/getopt.rst:68
msgid "" msgid ""
@ -97,6 +143,10 @@ msgid ""
"intermixed. The :func:`getopt` function stops processing options as soon as " "intermixed. The :func:`getopt` function stops processing options as soon as "
"a non-option argument is encountered." "a non-option argument is encountered."
msgstr "" msgstr ""
"Cette fonction fonctionne comme :func:`getopt`, sauf que le mode de *scan* "
"GNU est utilisé par défaut. Cela signifie que les arguments option et non-"
"option peuvent être **intermixés**. La fonction :func:`getopt` arrête le "
"traitement des options dès quun argument de non-option est rencontré."
#: ../Doc/library/getopt.rst:73 #: ../Doc/library/getopt.rst:73
msgid "" msgid ""
@ -104,6 +154,9 @@ msgid ""
"environment variable :envvar:`POSIXLY_CORRECT` is set, then option " "environment variable :envvar:`POSIXLY_CORRECT` is set, then option "
"processing stops as soon as a non-option argument is encountered." "processing stops as soon as a non-option argument is encountered."
msgstr "" msgstr ""
"Si le premier caractère de la chaîne doptions est ``+``, ou si la variable "
"denvironnement :envvar:`POSIXLY_CORRECT` est définie, le traitement des "
"options sarrête dès quun argument non-option est rencontré."
#: ../Doc/library/getopt.rst:80 #: ../Doc/library/getopt.rst:80
msgid "" msgid ""
@ -115,22 +168,30 @@ msgid ""
"give the error message and related option; if there is no specific option to " "give the error message and related option; if there is no specific option to "
"which the exception relates, :attr:`opt` is an empty string." "which the exception relates, :attr:`opt` is an empty string."
msgstr "" msgstr ""
"Cette exception est levée lorsquune option non reconnue est trouvée dans la "
"liste darguments ou lorsquune option nécessitant un argument nen a pas "
"reçu. Largument de lexception est une chaîne de caractères indiquant la "
"cause de lerreur. Pour les options longues, un argument donné à une option "
"qui nen exige pas un entraîne également le levage de cette exception. Les "
"attributs :attr:`msg` et :attr:`opt` donnent le message derreur et loption "
"connexe. Sil nexiste aucune option spécifique à laquelle lexception se "
"rapporte, :attr:`opt` est une chaîne vide."
#: ../Doc/library/getopt.rst:91 #: ../Doc/library/getopt.rst:91
msgid "Alias for :exc:`GetoptError`; for backward compatibility." msgid "Alias for :exc:`GetoptError`; for backward compatibility."
msgstr "" msgstr "Alias pour :exc:`GetoptError` ; pour la rétrocompatibilité."
#: ../Doc/library/getopt.rst:93 #: ../Doc/library/getopt.rst:93
msgid "An example using only Unix style options:" msgid "An example using only Unix style options:"
msgstr "" msgstr "Un exemple utilisant uniquement les options de style UNIX :"
#: ../Doc/library/getopt.rst:105 #: ../Doc/library/getopt.rst:105
msgid "Using long option names is equally easy:" msgid "Using long option names is equally easy:"
msgstr "" msgstr "Lutilisation de noms doptions longs est tout aussi simple :"
#: ../Doc/library/getopt.rst:118 #: ../Doc/library/getopt.rst:118
msgid "In a script, typical usage is something like this::" msgid "In a script, typical usage is something like this::"
msgstr "" msgstr "Dans un script, lutilisation typique ressemble à ceci ::"
#: ../Doc/library/getopt.rst:147 #: ../Doc/library/getopt.rst:147
msgid "" msgid ""
@ -138,11 +199,16 @@ msgid ""
"code and more informative help and error messages by using the :mod:" "code and more informative help and error messages by using the :mod:"
"`argparse` module::" "`argparse` module::"
msgstr "" msgstr ""
"Notez quune interface de ligne de commande équivalente peut être produite "
"avec moins de code et des messages derreur et daide plus informatifs à "
"laide du module :mod:`argparse` module ::"
#: ../Doc/library/getopt.rst:162 #: ../Doc/library/getopt.rst:162
msgid "Module :mod:`argparse`" msgid "Module :mod:`argparse`"
msgstr "" msgstr "Module :mod:`argparse`"
#: ../Doc/library/getopt.rst:163 #: ../Doc/library/getopt.rst:163
msgid "Alternative command line option and argument parsing library." msgid "Alternative command line option and argument parsing library."
msgstr "" msgstr ""
"Option de ligne de commande alternative et bibliothèque danalyse "
"darguments."

View File

@ -18,7 +18,7 @@ msgstr ""
#: ../Doc/library/heapq.rst:2 #: ../Doc/library/heapq.rst:2
msgid ":mod:`heapq` --- Heap queue algorithm" msgid ":mod:`heapq` --- Heap queue algorithm"
msgstr "" msgstr ":mod:`heapq` — File de priorité basée sur un tas"
#: ../Doc/library/heapq.rst:12 #: ../Doc/library/heapq.rst:12
msgid "**Source code:** :source:`Lib/heapq.py`" msgid "**Source code:** :source:`Lib/heapq.py`"
@ -29,6 +29,8 @@ msgid ""
"This module provides an implementation of the heap queue algorithm, also " "This module provides an implementation of the heap queue algorithm, also "
"known as the priority queue algorithm." "known as the priority queue algorithm."
msgstr "" msgstr ""
"Ce module expose une implémentation de l'algorithme de file de priorité, "
"basée sur un tas."
#: ../Doc/library/heapq.rst:19 #: ../Doc/library/heapq.rst:19
msgid "" msgid ""
@ -39,6 +41,13 @@ msgid ""
"elements are considered to be infinite. The interesting property of a heap " "elements are considered to be infinite. The interesting property of a heap "
"is that its smallest element is always the root, ``heap[0]``." "is that its smallest element is always the root, ``heap[0]``."
msgstr "" msgstr ""
"Les tas sont des arbres binaires pour lesquels chaque valeur portée par un "
"nœud est inférieure ou égale à celle de ses deux fils. Cette implémentation "
"utilise des tableaux pour lesquels ``tas[k] <= tas[2*k+1]`` et ``tas[k] <= "
"tas[2*k+2]`` pour tout *k*, en commençant la numérotation à zéro. Pour "
"contenter l'opérateur de comparaison, les éléments inexistants sont "
"considérés comme porteur d'une valeur infinie. L'intérêt du tas est que son "
"plus petit élément est toujours la racine, ``tas[0]``."
#: ../Doc/library/heapq.rst:26 #: ../Doc/library/heapq.rst:26
msgid "" msgid ""
@ -50,6 +59,13 @@ msgid ""
"\"max heap\" is more common in texts because of its suitability for in-place " "\"max heap\" is more common in texts because of its suitability for in-place "
"sorting)." "sorting)."
msgstr "" msgstr ""
"L'API ci-dessous diffère de la file de priorité classique par deux aspects : "
"(a) L'indiçage commence à zéro. Cela complexifie légèrement la relation "
"entre l'indice d'un nœud et les indices de ses fils mais est alignée avec "
"l'indiçage commençant à zéro que Python utilise. (b) La méthode *pop* "
"renvoie le plus petit élément et non le plus grand (appelé « tas-min » dans "
"les manuels scolaires ; le « tas-max » étant généralement plus courant dans "
"la littérature car il permet le classement sans tampon)."
#: ../Doc/library/heapq.rst:33 #: ../Doc/library/heapq.rst:33
msgid "" msgid ""
@ -57,12 +73,18 @@ msgid ""
"surprises: ``heap[0]`` is the smallest item, and ``heap.sort()`` maintains " "surprises: ``heap[0]`` is the smallest item, and ``heap.sort()`` maintains "
"the heap invariant!" "the heap invariant!"
msgstr "" msgstr ""
"Ces deux points permettent d'aborder le tas comme une liste Python standard "
"sans surprise : ``heap[0]`` est le plus petit élément tandis que ``heap."
"sort()`` ne modifie pas le tas !"
#: ../Doc/library/heapq.rst:37 #: ../Doc/library/heapq.rst:37
msgid "" msgid ""
"To create a heap, use a list initialized to ``[]``, or you can transform a " "To create a heap, use a list initialized to ``[]``, or you can transform a "
"populated list into a heap via function :func:`heapify`." "populated list into a heap via function :func:`heapify`."
msgstr "" msgstr ""
"Pour créer un tas, utilisez une liste initialisée à ``[]`` ou bien utilisez "
"une liste existante et transformez la en tas à l'aide de la fonction :func:"
"`heapify`."
#: ../Doc/library/heapq.rst:40 #: ../Doc/library/heapq.rst:40
msgid "The following functions are provided:" msgid "The following functions are provided:"
@ -71,6 +93,8 @@ msgstr "Les fonctions suivantes sont fournies :"
#: ../Doc/library/heapq.rst:45 #: ../Doc/library/heapq.rst:45
msgid "Push the value *item* onto the *heap*, maintaining the heap invariant." msgid "Push the value *item* onto the *heap*, maintaining the heap invariant."
msgstr "" msgstr ""
"Introduit la valeur *item* dans le tas *heap*, en conservant l'invariance du "
"tas."
#: ../Doc/library/heapq.rst:50 #: ../Doc/library/heapq.rst:50
msgid "" msgid ""
@ -78,6 +102,9 @@ msgid ""
"invariant. If the heap is empty, :exc:`IndexError` is raised. To access " "invariant. If the heap is empty, :exc:`IndexError` is raised. To access "
"the smallest item without popping it, use ``heap[0]``." "the smallest item without popping it, use ``heap[0]``."
msgstr "" msgstr ""
"Extraie le plus petit élément de *heap* en préservant l'invariant du tas. Si "
"le tas est vide, une exception :exc:`IndexError` est levée. Pour accéder au "
"plus petit élément sans le retirer, utilisez ``heap[0]``."
#: ../Doc/library/heapq.rst:57 #: ../Doc/library/heapq.rst:57
msgid "" msgid ""
@ -85,10 +112,15 @@ msgid ""
"*heap*. The combined action runs more efficiently than :func:`heappush` " "*heap*. The combined action runs more efficiently than :func:`heappush` "
"followed by a separate call to :func:`heappop`." "followed by a separate call to :func:`heappop`."
msgstr "" msgstr ""
"Introduit l'élément *item* dans le tas, puis extraie le plus petit élément "
"de *heap*. Cette action combinée est plus efficace que :func:`heappush` "
"suivie par un appel séparé à :func:`heappop`."
#: ../Doc/library/heapq.rst:64 #: ../Doc/library/heapq.rst:64
msgid "Transform list *x* into a heap, in-place, in linear time." msgid "Transform list *x* into a heap, in-place, in linear time."
msgstr "" msgstr ""
"Transforme une liste *x* en un tas, sans utiliser de tampon et en temps "
"linéaire."
#: ../Doc/library/heapq.rst:69 #: ../Doc/library/heapq.rst:69
msgid "" msgid ""
@ -96,6 +128,9 @@ msgid ""
"*item*. The heap size doesn't change. If the heap is empty, :exc:" "*item*. The heap size doesn't change. If the heap is empty, :exc:"
"`IndexError` is raised." "`IndexError` is raised."
msgstr "" msgstr ""
"Extraie le plus petit élément de *heap* et introduit le nouvel élément "
"*item*. La taille du tas ne change pas. Si le tas est vide, une exception :"
"exc:`IndexError` est levée."
#: ../Doc/library/heapq.rst:72 #: ../Doc/library/heapq.rst:72
msgid "" msgid ""
@ -104,6 +139,10 @@ msgid ""
"heap. The pop/push combination always returns an element from the heap and " "heap. The pop/push combination always returns an element from the heap and "
"replaces it with *item*." "replaces it with *item*."
msgstr "" msgstr ""
"Cette opération en une étape est plus efficace qu'un appel à :func:`heappop` "
"suivi d'un appel à :func:`heappush` et est plus appropriée lorsque le tas "
"est de taille fixe. La combinaison *pop*/*push* renvoie toujours un élément "
"du tas et le remplace par *item*."
#: ../Doc/library/heapq.rst:77 #: ../Doc/library/heapq.rst:77
msgid "" msgid ""
@ -112,10 +151,15 @@ msgid ""
"combination returns the smaller of the two values, leaving the larger value " "combination returns the smaller of the two values, leaving the larger value "
"on the heap." "on the heap."
msgstr "" msgstr ""
"La valeur renvoyée peut être plus grande que l'élément *item* ajouté. Si "
"cela n'est pas souhaitable, utilisez plutôt :func:`heappushpop` à la place. "
"Sa combinaison *push*/*pop* renvoie le plus petit élément des deux valeurs "
"et laisse la plus grande sur le tas."
#: ../Doc/library/heapq.rst:83 #: ../Doc/library/heapq.rst:83
msgid "The module also offers three general purpose functions based on heaps." msgid "The module also offers three general purpose functions based on heaps."
msgstr "" msgstr ""
"Ce module contient également trois fonctions génériques utilisant les tas."
#: ../Doc/library/heapq.rst:88 #: ../Doc/library/heapq.rst:88
msgid "" msgid ""
@ -123,6 +167,9 @@ msgid ""
"timestamped entries from multiple log files). Returns an :term:`iterator` " "timestamped entries from multiple log files). Returns an :term:`iterator` "
"over the sorted values." "over the sorted values."
msgstr "" msgstr ""
"Fusionne plusieurs entrées ordonnées en une unique sortie ordonnée (par "
"exemple, fusionne des entrées datées provenant de multiples journaux "
"applicatifs). Renvoie un :term:`iterator` sur les valeurs ordonnées."
#: ../Doc/library/heapq.rst:92 #: ../Doc/library/heapq.rst:92
msgid "" msgid ""
@ -130,6 +177,9 @@ msgid ""
"does not pull the data into memory all at once, and assumes that each of the " "does not pull the data into memory all at once, and assumes that each of the "
"input streams is already sorted (smallest to largest)." "input streams is already sorted (smallest to largest)."
msgstr "" msgstr ""
"Similaire à ``sorted(itertools.chain(*iterables))`` mais renvoie un "
"itérable, ne stocke pas toutes les données en mémoire en une fois et suppose "
"que chaque flux d'entrée est déjà classé (en ordre croissant)."
#: ../Doc/library/heapq.rst:96 #: ../Doc/library/heapq.rst:96
msgid "" msgid ""
@ -183,10 +233,16 @@ msgid ""
"`max` functions. If repeated usage of these functions is required, consider " "`max` functions. If repeated usage of these functions is required, consider "
"turning the iterable into an actual heap." "turning the iterable into an actual heap."
msgstr "" msgstr ""
"Les deux fonctions précédentes sont les plus efficaces pour des petites "
"valeurs de *n*. Pour de grandes valeurs, il est préférable d'utiliser la "
"fonction :func:`sorted`. En outre, lorsque ``n==1``, il est plus efficace "
"d'utiliser les fonctions natives :func:`min` et :func:`max`. Si vous devez "
"utiliser ces fonctions de façon répétée, il est préférable de transformer "
"l'itérable en tas."
#: ../Doc/library/heapq.rst:134 #: ../Doc/library/heapq.rst:134
msgid "Basic Examples" msgid "Basic Examples"
msgstr "" msgstr "Exemples simples"
#: ../Doc/library/heapq.rst:136 #: ../Doc/library/heapq.rst:136
msgid "" msgid ""
@ -194,52 +250,71 @@ msgid ""
"pushing all values onto a heap and then popping off the smallest values one " "pushing all values onto a heap and then popping off the smallest values one "
"at a time::" "at a time::"
msgstr "" msgstr ""
"Un `tri par tas <https://fr.wikipedia.org/wiki/Tri_par_tas>`_ peut être "
"implémenté en introduisant toutes les valeurs dans un tas puis en effectuant "
"l'extraction des éléments un par un ::"
#: ../Doc/library/heapq.rst:149 #: ../Doc/library/heapq.rst:149
msgid "" msgid ""
"This is similar to ``sorted(iterable)``, but unlike :func:`sorted`, this " "This is similar to ``sorted(iterable)``, but unlike :func:`sorted`, this "
"implementation is not stable." "implementation is not stable."
msgstr "" msgstr ""
"Ceci est similaire à ``sorted(iterable)`` mais, contrairement à :func:"
"`sorted`, cette implémentation n'est pas stable."
#: ../Doc/library/heapq.rst:152 #: ../Doc/library/heapq.rst:152
msgid "" msgid ""
"Heap elements can be tuples. This is useful for assigning comparison values " "Heap elements can be tuples. This is useful for assigning comparison values "
"(such as task priorities) alongside the main record being tracked::" "(such as task priorities) alongside the main record being tracked::"
msgstr "" msgstr ""
"Les éléments d'un tas peuvent être des n-uplets. C'est pratique pour "
"assigner des valeurs de comparaison (par exemple, des priorités de tâches) "
"en plus de l'élément qui est suivi ::"
#: ../Doc/library/heapq.rst:165 #: ../Doc/library/heapq.rst:165
msgid "Priority Queue Implementation Notes" msgid "Priority Queue Implementation Notes"
msgstr "" msgstr "Notes d'implémentation de la file de priorité"
#: ../Doc/library/heapq.rst:167 #: ../Doc/library/heapq.rst:167
msgid "" msgid ""
"A `priority queue <https://en.wikipedia.org/wiki/Priority_queue>`_ is common " "A `priority queue <https://en.wikipedia.org/wiki/Priority_queue>`_ is common "
"use for a heap, and it presents several implementation challenges:" "use for a heap, and it presents several implementation challenges:"
msgstr "" msgstr ""
"Une `file de priorité <https://fr.wikipedia.org/wiki/File_de_priorit"
"%C3%A9>`_ est une application courante des tas et présente plusieurs défis "
"d'implémentation :"
#: ../Doc/library/heapq.rst:170 #: ../Doc/library/heapq.rst:170
msgid "" msgid ""
"Sort stability: how do you get two tasks with equal priorities to be " "Sort stability: how do you get two tasks with equal priorities to be "
"returned in the order they were originally added?" "returned in the order they were originally added?"
msgstr "" msgstr ""
"Stabilité du classement : comment s'assurer que deux tâches avec la même "
"priorité sont renvoyées dans l'ordre de leur ajout ?"
#: ../Doc/library/heapq.rst:173 #: ../Doc/library/heapq.rst:173
msgid "" msgid ""
"Tuple comparison breaks for (priority, task) pairs if the priorities are " "Tuple comparison breaks for (priority, task) pairs if the priorities are "
"equal and the tasks do not have a default comparison order." "equal and the tasks do not have a default comparison order."
msgstr "" msgstr ""
"La comparaison des couples (priorité, tâche) échoue si les priorités sont "
"identiques et que les tâches n'ont pas de relation d'ordre par défaut."
#: ../Doc/library/heapq.rst:176 #: ../Doc/library/heapq.rst:176
msgid "" msgid ""
"If the priority of a task changes, how do you move it to a new position in " "If the priority of a task changes, how do you move it to a new position in "
"the heap?" "the heap?"
msgstr "" msgstr ""
"Si la priorité d'une tâche change, comment la déplacer à sa nouvelle "
"position dans le tas ?"
#: ../Doc/library/heapq.rst:179 #: ../Doc/library/heapq.rst:179
msgid "" msgid ""
"Or if a pending task needs to be deleted, how do you find it and remove it " "Or if a pending task needs to be deleted, how do you find it and remove it "
"from the queue?" "from the queue?"
msgstr "" msgstr ""
"Si une tâche en attente doit être supprimée, comment la trouver et la "
"supprimer de la file ?"
#: ../Doc/library/heapq.rst:182 #: ../Doc/library/heapq.rst:182
msgid "" msgid ""
@ -249,6 +324,13 @@ msgid ""
"returned in the order they were added. And since no two entry counts are the " "returned in the order they were added. And since no two entry counts are the "
"same, the tuple comparison will never attempt to directly compare two tasks." "same, the tuple comparison will never attempt to directly compare two tasks."
msgstr "" msgstr ""
"Une solution aux deux premiers problèmes consiste à stocker les entrées sous "
"forme de liste à 3 éléments incluant la priorité, le numéro d'ajout et la "
"tâche. Le numéro d'ajout sert à briser les égalités de telle sorte que deux "
"tâches avec la même priorité sont renvoyées dans l'ordre de leur insertion. "
"Puisque deux tâches ne peuvent jamais avoir le même numéro d'ajout, la "
"comparaison des triplets ne va jamais chercher à comparer des tâches entre "
"elles."
#: ../Doc/library/heapq.rst:188 #: ../Doc/library/heapq.rst:188
msgid "" msgid ""
@ -256,6 +338,9 @@ msgid ""
"changes to its priority or removing it entirely. Finding a task can be done " "changes to its priority or removing it entirely. Finding a task can be done "
"with a dictionary pointing to an entry in the queue." "with a dictionary pointing to an entry in the queue."
msgstr "" msgstr ""
"Le problème restant consiste à trouver une tâche en attente et modifier sa "
"priorité ou la supprimer. Trouver une tâche peut être réalisé à l'aide d'un "
"dictionnaire pointant vers une entrée dans la file."
#: ../Doc/library/heapq.rst:192 #: ../Doc/library/heapq.rst:192
msgid "" msgid ""
@ -263,10 +348,14 @@ msgid ""
"would break the heap structure invariants. So, a possible solution is to " "would break the heap structure invariants. So, a possible solution is to "
"mark the entry as removed and add a new entry with the revised priority::" "mark the entry as removed and add a new entry with the revised priority::"
msgstr "" msgstr ""
"Supprimer une entrée ou changer sa priorité est plus difficile puisque cela "
"romprait l'invariant de la structure de tas. Une solution possible est de "
"marquer l'entrée comme supprimée et d'ajouter une nouvelle entrée avec sa "
"priorité modifiée ::"
#: ../Doc/library/heapq.rst:226 #: ../Doc/library/heapq.rst:226
msgid "Theory" msgid "Theory"
msgstr "" msgstr "Théorie"
#: ../Doc/library/heapq.rst:228 #: ../Doc/library/heapq.rst:228
msgid "" msgid ""
@ -275,12 +364,19 @@ msgid ""
"elements are considered to be infinite. The interesting property of a heap " "elements are considered to be infinite. The interesting property of a heap "
"is that ``a[0]`` is always its smallest element." "is that ``a[0]`` is always its smallest element."
msgstr "" msgstr ""
"Les tas sont des tableaux pour lesquels ``a[k] <= a[2*k+1]`` et ``a[k] <= "
"a[2*k+2]`` pour tout *k* en comptant les éléments à partir de 0. Pour "
"simplifier la comparaison, les éléments inexistants sont considérés comme "
"étant infinis. L'intérêt des tas est que ``a[0]`` est toujours leur plus "
"petit élément."
#: ../Doc/library/heapq.rst:233 #: ../Doc/library/heapq.rst:233
msgid "" msgid ""
"The strange invariant above is meant to be an efficient memory " "The strange invariant above is meant to be an efficient memory "
"representation for a tournament. The numbers below are *k*, not ``a[k]``::" "representation for a tournament. The numbers below are *k*, not ``a[k]``::"
msgstr "" msgstr ""
"L'invariant étrange ci-dessus est une représentation efficace en mémoire "
"d'un tournoi. Les nombres ci-dessous sont *k* et non ``a[k]`` ::"
#: ../Doc/library/heapq.rst:246 #: ../Doc/library/heapq.rst:246
msgid "" msgid ""
@ -294,6 +390,17 @@ msgid ""
"two cells it tops contain three different items, but the top cell \"wins\" " "two cells it tops contain three different items, but the top cell \"wins\" "
"over the two topped cells." "over the two topped cells."
msgstr "" msgstr ""
"Dans l'arbre ci-dessus, chaque nœud *k* a pour enfants ``2*k+1`` et ``2*k"
"+2``. Dans les tournois binaires habituels dans les compétitions sportives, "
"chaque nœud est le vainqueur des deux nœuds inférieurs et nous pouvons "
"tracer le chemin du vainqueur le long de l'arbre afin de voir qui étaient "
"ses adversaires. Cependant, dans de nombreuses applications informatiques de "
"ces tournois, nous n'avons pas besoin de produire l'historique du vainqueur. "
"Afin d'occuper moins de mémoire, on remplace le vainqueur lors de sa "
"promotion par un autre élément à un plus bas niveau. La règle devient alors "
"qu'un nœud et les deux nœuds qu'il chapeaute contiennent trois éléments "
"différents, mais le nœud supérieur « gagne » contre les deux nœuds "
"inférieurs."
#: ../Doc/library/heapq.rst:255 #: ../Doc/library/heapq.rst:255
msgid "" msgid ""
@ -305,6 +412,15 @@ msgid ""
"logarithmic on the total number of items in the tree. By iterating over all " "logarithmic on the total number of items in the tree. By iterating over all "
"items, you get an O(n log n) sort." "items, you get an O(n log n) sort."
msgstr "" msgstr ""
"Si cet invariant de tas est vérifié à tout instant, alors l'élément à "
"l'indice 0 est le vainqueur global. L'algorithme le plus simple pour le "
"retirer et trouver le vainqueur « suivant » consiste à déplacer un perdant "
"(par exemple le nœud 30 dans le diagramme ci-dessus) à la position 0, puis à "
"faire redescendre cette nouvelle racine dans l'arbre en échangeant sa valeur "
"avec celle d'un de ses fils jusqu'à ce que l'invariant soit rétabli. Cette "
"approche a un coût logarithmique par rapport au nombre total d'éléments dans "
"l'arbre. En itérant sur tous les éléments, le classement s'effectue en O(n "
"log n) opérations."
#: ../Doc/library/heapq.rst:262 #: ../Doc/library/heapq.rst:262
msgid "" msgid ""
@ -317,6 +433,16 @@ msgid ""
"easily go into the heap. So, a heap is a good structure for implementing " "easily go into the heap. So, a heap is a good structure for implementing "
"schedulers (this is what I used for my MIDI sequencer :-)." "schedulers (this is what I used for my MIDI sequencer :-)."
msgstr "" msgstr ""
"Une propriété agréable de cet algorithme est qu'il possible d'insérer "
"efficacement de nouveaux éléments en cours de classement, du moment que les "
"éléments insérés ne sont pas « meilleurs » que le dernier élément qui a été "
"extrait. Ceci s'avère très utile dans des simulations où l'arbre contient la "
"liste des événements arrivants et que la condition de « victoire » est le "
"plus petit temps d'exécution planifié. Lorsqu'un événement programme "
"l'exécution d'autres événements, ceux-ci sont planifiés pour le futur et "
"peuvent donc rejoindre le tas. Ainsi, le tas est une bonne structure pour "
"implémenter un ordonnanceur (et c'est ce que j'ai utilisé pour mon "
"séquenceur MIDI ☺)."
#: ../Doc/library/heapq.rst:271 #: ../Doc/library/heapq.rst:271
msgid "" msgid ""
@ -326,6 +452,11 @@ msgid ""
"average case. However, there are other representations which are more " "average case. However, there are other representations which are more "
"efficient overall, yet the worst cases might be terrible." "efficient overall, yet the worst cases might be terrible."
msgstr "" msgstr ""
"Plusieurs structures ont été étudiées en détail pour implémenter des "
"ordonnanceurs et les tas sont bien adaptés : ils sont raisonnablement "
"rapides, leur vitesse est presque constante et le pire cas ne diffère pas "
"trop du cas moyen. S'il existe des représentations qui sont plus efficaces "
"en général, les pires cas peuvent être terriblement mauvais."
#: ../Doc/library/heapq.rst:277 #: ../Doc/library/heapq.rst:277
msgid "" msgid ""
@ -340,6 +471,18 @@ msgid ""
"which are twice the size of the memory for random input, and much better for " "which are twice the size of the memory for random input, and much better for "
"input fuzzily ordered." "input fuzzily ordered."
msgstr "" msgstr ""
"Les tas sont également très utiles pour ordonner les données sur de gros "
"disques. Vous savez probablement qu'un gros tri implique la production de "
"séquences pré-classées (dont la taille est généralement liée à la quantité "
"de mémoire CPU disponible), suivie par une passe de fusion qui est "
"généralement organisée de façon très intelligente [#]_. Il est très "
"important que le classement initial produise des séquences les plus longues "
"possibles. Les tournois sont une bonne façon d'arriver à ce résultat. Si, en "
"utilisant toute la mémoire disponible pour stocker un tournoi, vous "
"remplacez et faites percoler les éléments qui s'avèrent acceptables pour la "
"séquence courante, vous produirez des séquences d'une taille égale au double "
"de la mémoire pour une entrée aléatoire et bien mieux pour une entrée "
"approximativement triée."
#: ../Doc/library/heapq.rst:287 #: ../Doc/library/heapq.rst:287
msgid "" msgid ""
@ -351,12 +494,23 @@ msgid ""
"the first heap is melting. When the first heap completely vanishes, you " "the first heap is melting. When the first heap completely vanishes, you "
"switch heaps and start a new run. Clever and quite effective!" "switch heaps and start a new run. Clever and quite effective!"
msgstr "" msgstr ""
"Qui plus est, si vous écrivez l'élément 0 sur le disque et que vous recevez "
"en entrée un élément qui n'est pas adapté au tournoi actuel (parce que sa "
"valeur « gagne » par rapport à la dernière valeur de sortie), alors il ne "
"peut pas être stocké dans le tas donc la taille de ce dernier diminue. La "
"mémoire libérée peut être réutilisée immédiatement pour progressivement "
"construire un deuxième tas, qui croit à la même vitesse que le premier "
"décroît. Lorsque le premier tas a complètement disparu, vous échangez les "
"tas et démarrez une nouvelle séquence. Malin et plutôt efficace !"
#: ../Doc/library/heapq.rst:295 #: ../Doc/library/heapq.rst:295
msgid "" msgid ""
"In a word, heaps are useful memory structures to know. I use them in a few " "In a word, heaps are useful memory structures to know. I use them in a few "
"applications, and I think it is good to keep a 'heap' module around. :-)" "applications, and I think it is good to keep a 'heap' module around. :-)"
msgstr "" msgstr ""
"Pour résumer, les tas sont des structures de données qu'il est bon de "
"connaître. Je les utilise dans quelques applications et je pense qu'il est "
"bon de garder le module *heap* sous le coude. ☺"
#: ../Doc/library/heapq.rst:299 #: ../Doc/library/heapq.rst:299
msgid "Footnotes" msgid "Footnotes"
@ -374,3 +528,14 @@ msgid ""
"Believe me, real good tape sorts were quite spectacular to watch! From all " "Believe me, real good tape sorts were quite spectacular to watch! From all "
"times, sorting has always been a Great Art! :-)" "times, sorting has always been a Great Art! :-)"
msgstr "" msgstr ""
"Les algorithmes de répartition de charge pour les disques, courants de nos "
"jours, sont plus embêtants qu'utiles, en raison de la capacité des disques à "
"réaliser des accès aléatoires. Sur les périphériques qui ne peuvent faire "
"que de la lecture séquentielle, comme les gros lecteurs à bandes, le besoin "
"était différent et il fallait être malin pour s'assurer (bien à l'avance) "
"que chaque mouvement de bande serait le plus efficace possible (c'est-à-dire "
"participerait au mieux à l'« avancée » de la fusion). Certaines cassettes "
"pouvaient même lire à l'envers et cela était aussi utilisé pour éviter de "
"remonter dans le temps. Croyez-moi, les bons tris sur bandes étaient "
"spectaculaires à regarder ! Depuis la nuit des temps, trier a toujours été "
"le Grand Art ! ☺"

File diff suppressed because it is too large Load Diff

View File

@ -1288,7 +1288,7 @@ msgstr ""
#: ../Doc/library/io.rst:955 #: ../Doc/library/io.rst:955
msgid "Performance" msgid "Performance"
msgstr "" msgstr "Performances"
#: ../Doc/library/io.rst:957 #: ../Doc/library/io.rst:957
msgid "" msgid ""

View File

@ -647,7 +647,7 @@ msgstr ""
#: ../Doc/library/ipaddress.rst:646 #: ../Doc/library/ipaddress.rst:646
msgid "Iteration" msgid "Iteration"
msgstr "" msgstr "Itération"
#: ../Doc/library/ipaddress.rst:648 #: ../Doc/library/ipaddress.rst:648
msgid "" msgid ""

View File

@ -18,11 +18,11 @@ msgstr ""
#: ../Doc/library/numbers.rst:2 #: ../Doc/library/numbers.rst:2
msgid ":mod:`numbers` --- Numeric abstract base classes" msgid ":mod:`numbers` --- Numeric abstract base classes"
msgstr "" msgstr ":mod:`numbers` — Classes de base abstraites numériques"
#: ../Doc/library/numbers.rst:7 #: ../Doc/library/numbers.rst:7
msgid "**Source code:** :source:`Lib/numbers.py`" msgid "**Source code:** :source:`Lib/numbers.py`"
msgstr "" msgstr "**Code source :** :source:`Lib/numbers.py`"
#: ../Doc/library/numbers.rst:11 #: ../Doc/library/numbers.rst:11
msgid "" msgid ""
@ -31,16 +31,23 @@ msgid ""
"more operations. None of the types defined in this module can be " "more operations. None of the types defined in this module can be "
"instantiated." "instantiated."
msgstr "" msgstr ""
"Le module :mod:`numbers` (:pep:`3141`) définit une hiérarchie de :term:"
"`classes de base abstraites<abstract base class>` numériques qui définissent "
"progressivement plus d'opérations. Aucun des types définis dans ce module ne "
"peut être instancié."
#: ../Doc/library/numbers.rst:18 #: ../Doc/library/numbers.rst:18
msgid "" msgid ""
"The root of the numeric hierarchy. If you just want to check if an argument " "The root of the numeric hierarchy. If you just want to check if an argument "
"*x* is a number, without caring what kind, use ``isinstance(x, Number)``." "*x* is a number, without caring what kind, use ``isinstance(x, Number)``."
msgstr "" msgstr ""
"La base de la hiérarchie numérique. Si vous voulez juste vérifier qu'un "
"argument *x* est un nombre, peu importe le type, utilisez ``isinstance(x, "
"Number)``."
#: ../Doc/library/numbers.rst:23 #: ../Doc/library/numbers.rst:23
msgid "The numeric tower" msgid "The numeric tower"
msgstr "" msgstr "La tour numérique"
#: ../Doc/library/numbers.rst:27 #: ../Doc/library/numbers.rst:27
msgid "" msgid ""
@ -50,26 +57,35 @@ msgid ""
"``, ``*``, ``/``, :func:`abs`, :meth:`conjugate`, ``==``, and ``!=``. All " "``, ``*``, ``/``, :func:`abs`, :meth:`conjugate`, ``==``, and ``!=``. All "
"except ``-`` and ``!=`` are abstract." "except ``-`` and ``!=`` are abstract."
msgstr "" msgstr ""
"Les sous-classes de ce type décrivent des nombres complexes et incluent les "
"opérations qui fonctionnent sur le type natif :class:`complex`. Ce sont : "
"les conversions vers :class:`complex` et :class:`bool`, :attr:`.real`, :attr:"
"`.imag`, ``+``, ``-``, ``*``, ``/``, :func:`abs`, :meth:`conjugate`, ``==`` "
"et ``!=``. Toutes sauf ``-`` et ``!=`` sont abstraites."
#: ../Doc/library/numbers.rst:35 #: ../Doc/library/numbers.rst:35
msgid "Abstract. Retrieves the real component of this number." msgid "Abstract. Retrieves the real component of this number."
msgstr "" msgstr "Abstrait. Récupère la partie réelle de ce nombre."
#: ../Doc/library/numbers.rst:39 #: ../Doc/library/numbers.rst:39
msgid "Abstract. Retrieves the imaginary component of this number." msgid "Abstract. Retrieves the imaginary component of this number."
msgstr "" msgstr "Abstrait. Retrouve la partie imaginaire de ce nombre."
#: ../Doc/library/numbers.rst:43 #: ../Doc/library/numbers.rst:43
msgid "" msgid ""
"Abstract. Returns the complex conjugate. For example, ``(1+3j).conjugate() " "Abstract. Returns the complex conjugate. For example, ``(1+3j).conjugate() "
"== (1-3j)``." "== (1-3j)``."
msgstr "" msgstr ""
"Abstrait. Renvoie le complexe conjugué. Par exemple, ``(1+3j).conjugate() == "
"(1-3j)``."
#: ../Doc/library/numbers.rst:48 #: ../Doc/library/numbers.rst:48
msgid "" msgid ""
"To :class:`Complex`, :class:`Real` adds the operations that work on real " "To :class:`Complex`, :class:`Real` adds the operations that work on real "
"numbers." "numbers."
msgstr "" msgstr ""
":class:`Real` ajoute les opérations qui fonctionnent sur les nombres réels "
"à :class:`Complex`."
#: ../Doc/library/numbers.rst:51 #: ../Doc/library/numbers.rst:51
msgid "" msgid ""
@ -77,12 +93,17 @@ msgid ""
"func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``, " "func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``, "
"``%``, ``<``, ``<=``, ``>``, and ``>=``." "``%``, ``<``, ``<=``, ``>``, and ``>=``."
msgstr "" msgstr ""
"En bref, celles-ci sont : une conversion vers :class:`float`, :func:`math."
"trunc`, :func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:"
"`divmod`, ``//``, ``%``, ``<``, ``<=``, ``>`` et ``>=``."
#: ../Doc/library/numbers.rst:55 #: ../Doc/library/numbers.rst:55
msgid "" msgid ""
"Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, :" "Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, :"
"attr:`~Complex.imag`, and :meth:`~Complex.conjugate`." "attr:`~Complex.imag`, and :meth:`~Complex.conjugate`."
msgstr "" msgstr ""
"*Real* fournit également des valeurs par défaut pour :func:`complex`, :attr:"
"`~Complex.real`, :attr:`~Complex.imag` et :meth:`~Complex.conjugate`."
#: ../Doc/library/numbers.rst:61 #: ../Doc/library/numbers.rst:61
msgid "" msgid ""
@ -90,6 +111,9 @@ msgid ""
"`~Rational.denominator` properties, which should be in lowest terms. With " "`~Rational.denominator` properties, which should be in lowest terms. With "
"these, it provides a default for :func:`float`." "these, it provides a default for :func:`float`."
msgstr "" msgstr ""
"Dérive :class:`Real` et ajoute les propriétés :attr:`~Rational.numerator` "
"et :attr:`~Rational.denominator` qui doivent être les plus petits possible. "
"Avec celles-ci, il fournit une valeur par défaut pour :func:`float`."
#: ../Doc/library/numbers.rst:68 ../Doc/library/numbers.rst:72 #: ../Doc/library/numbers.rst:68 ../Doc/library/numbers.rst:72
msgid "Abstract." msgid "Abstract."
@ -102,10 +126,15 @@ msgid ""
"`~Rational.denominator`. Adds abstract methods for ``**`` and bit-string " "`~Rational.denominator`. Adds abstract methods for ``**`` and bit-string "
"operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``." "operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``."
msgstr "" msgstr ""
"Dérive :class:`Rational` et ajoute une conversion en :class:`int`. Fournit "
"des valeurs par défaut pour :func:`float`, :attr:`~Rational.numerator` et :"
"attr:`~Rational.denominator`. Ajoute des méthodes abstraites pour ``**`` et "
"les opérations au niveau des bits: ``<<``, ``>>``, ``&``, ``^``, ``|``, "
"``~``."
#: ../Doc/library/numbers.rst:84 #: ../Doc/library/numbers.rst:84
msgid "Notes for type implementors" msgid "Notes for type implementors"
msgstr "" msgstr "Notes pour implémenter des types"
#: ../Doc/library/numbers.rst:86 #: ../Doc/library/numbers.rst:86
msgid "" msgid ""
@ -114,10 +143,15 @@ msgid ""
"the real numbers. For example, :class:`fractions.Fraction` implements :func:" "the real numbers. For example, :class:`fractions.Fraction` implements :func:"
"`hash` as follows::" "`hash` as follows::"
msgstr "" msgstr ""
"Les développeurs doivent veiller à ce que des nombres égaux soient bien "
"égaux lors de comparaisons et à ce qu'ils soient hachés aux mêmes valeurs. "
"Cela peut être subtil s'il y a deux dérivations différentes des nombres "
"réels. Par exemple, :class:`fractions.Fraction` implémente :func:`hash` "
"comme suit ::"
#: ../Doc/library/numbers.rst:105 #: ../Doc/library/numbers.rst:105
msgid "Adding More Numeric ABCs" msgid "Adding More Numeric ABCs"
msgstr "" msgstr "Ajouter plus d'ABC numériques"
#: ../Doc/library/numbers.rst:107 #: ../Doc/library/numbers.rst:107
msgid "" msgid ""
@ -125,10 +159,14 @@ msgid ""
"poor hierarchy if it precluded the possibility of adding those. You can add " "poor hierarchy if it precluded the possibility of adding those. You can add "
"``MyFoo`` between :class:`Complex` and :class:`Real` with::" "``MyFoo`` between :class:`Complex` and :class:`Real` with::"
msgstr "" msgstr ""
"Il est bien entendu possible de créer davantage dABC pour les nombres et "
"cette hiérarchie serait médiocre si elle excluait la possibilité d'en "
"ajouter. Vous pouvez ajouter ``MyFoo`` entre :class:`Complex` et :class:"
"`Real` ainsi ::"
#: ../Doc/library/numbers.rst:119 #: ../Doc/library/numbers.rst:119
msgid "Implementing the arithmetic operations" msgid "Implementing the arithmetic operations"
msgstr "" msgstr "Implémentation des opérations arithmétiques"
#: ../Doc/library/numbers.rst:121 #: ../Doc/library/numbers.rst:121
msgid "" msgid ""
@ -138,6 +176,12 @@ msgid ""
"there. For subtypes of :class:`Integral`, this means that :meth:`__add__` " "there. For subtypes of :class:`Integral`, this means that :meth:`__add__` "
"and :meth:`__radd__` should be defined as::" "and :meth:`__radd__` should be defined as::"
msgstr "" msgstr ""
"Nous voulons implémenter les opérations arithmétiques de sorte que les "
"opérations en mode mixte appellent une implémentation dont l'auteur connaît "
"les types des deux arguments, ou convertissent chacun dans le type natif le "
"plus proche et effectuent l'opération sur ces types. Pour les sous-types de :"
"class:`Integral`, cela signifie que :meth:`__add__` et :meth:`__radd__` "
"devraient être définis comme suit ::"
#: ../Doc/library/numbers.rst:152 #: ../Doc/library/numbers.rst:152
msgid "" msgid ""
@ -147,10 +191,16 @@ msgid ""
"an instance of ``A``, which is a subtype of :class:`Complex` (``a : A <: " "an instance of ``A``, which is a subtype of :class:`Complex` (``a : A <: "
"Complex``), and ``b : B <: Complex``. I'll consider ``a + b``:" "Complex``), and ``b : B <: Complex``. I'll consider ``a + b``:"
msgstr "" msgstr ""
"Il existe 5 cas différents pour une opération de type mixte sur des sous-"
"classes de :class:`Complex`. Nous nous référerons à tout le code ci-dessus "
"qui ne se réfère pas à ``MyIntegral`` et ``OtherTypeIKnowAbout`` comme "
"\"expression générique\". ``a`` est une instance de ``A``, qui est un sous-"
"type de :class:`Complex` (``a : A <: Complex``) et ``b : B <: Complex``. "
"Considérons ``a + b``:"
#: ../Doc/library/numbers.rst:159 #: ../Doc/library/numbers.rst:159
msgid "If ``A`` defines an :meth:`__add__` which accepts ``b``, all is well." msgid "If ``A`` defines an :meth:`__add__` which accepts ``b``, all is well."
msgstr "" msgstr "Si ``A`` définit une :meth:`__add__` qui accepte ``b``, tout va bien."
#: ../Doc/library/numbers.rst:161 #: ../Doc/library/numbers.rst:161
msgid "" msgid ""
@ -160,18 +210,27 @@ msgid ""
"`NotImplemented` from :meth:`__add__`. (Or ``A`` may not implement :meth:" "`NotImplemented` from :meth:`__add__`. (Or ``A`` may not implement :meth:"
"`__add__` at all.)" "`__add__` at all.)"
msgstr "" msgstr ""
"Si ``A`` fait appel au code générique et que celui-ci renvoie une valeur de :"
"meth:`__add__`, nous manquons la possibilité que ``B`` définisse une :meth:"
"`__radd__` plus intelligent, donc le code générique devrait retourner :const:"
"`NotImplemented` dans :meth:`__add__` (ou alors ``A`` ne doit pas "
"implémenter :meth:`__add__` du tout.)"
#: ../Doc/library/numbers.rst:167 #: ../Doc/library/numbers.rst:167
msgid "" msgid ""
"Then ``B``'s :meth:`__radd__` gets a chance. If it accepts ``a``, all is " "Then ``B``'s :meth:`__radd__` gets a chance. If it accepts ``a``, all is "
"well." "well."
msgstr "" msgstr ""
"Alors :meth:`__radd__` de ``B`` a une chance. si elle accepte ``a``, tout va "
"bien."
#: ../Doc/library/numbers.rst:169 #: ../Doc/library/numbers.rst:169
msgid "" msgid ""
"If it falls back to the boilerplate, there are no more possible methods to " "If it falls back to the boilerplate, there are no more possible methods to "
"try, so this is where the default implementation should live." "try, so this is where the default implementation should live."
msgstr "" msgstr ""
"Si elle fait appel au code générique, il n'y a plus de méthode possible à "
"essayer, c'est donc ici que l'implémentation par défaut intervient."
#: ../Doc/library/numbers.rst:172 #: ../Doc/library/numbers.rst:172
msgid "" msgid ""
@ -179,6 +238,9 @@ msgid ""
"because it was implemented with knowledge of ``A``, so it can handle those " "because it was implemented with knowledge of ``A``, so it can handle those "
"instances before delegating to :class:`Complex`." "instances before delegating to :class:`Complex`."
msgstr "" msgstr ""
"Si ``B < : A```, Python essaie ``B.__radd__`` avant ``A.__add__``. C'est "
"valable parce qu'elle est implémentée avec la connaissance de ``A``, donc "
"elle peut gérer ces instances avant de déléguer à :class:`Complex`."
#: ../Doc/library/numbers.rst:177 #: ../Doc/library/numbers.rst:177
msgid "" msgid ""
@ -186,6 +248,9 @@ msgid ""
"then the appropriate shared operation is the one involving the built in :" "then the appropriate shared operation is the one involving the built in :"
"class:`complex`, and both :meth:`__radd__` s land there, so ``a+b == b+a``." "class:`complex`, and both :meth:`__radd__` s land there, so ``a+b == b+a``."
msgstr "" msgstr ""
"Si ``A <: Complex`` et ``B <: Real`` sans autre information, alors "
"l'opération commune appropriée est celle impliquant :class:`complex` et les "
"deux :meth:`__radd__` atterrissent à cet endroit, donc ``a+b == b+a``."
#: ../Doc/library/numbers.rst:182 #: ../Doc/library/numbers.rst:182
msgid "" msgid ""
@ -194,3 +259,7 @@ msgid ""
"reverse instances of any given operator. For example, :class:`fractions." "reverse instances of any given operator. For example, :class:`fractions."
"Fraction` uses::" "Fraction` uses::"
msgstr "" msgstr ""
"Comme la plupart des opérations sur un type donné seront très similaires, il "
"peut être utile de définir une fonction accessoire qui génère les instances "
"résultantes et inverses d'un opérateur donné. Par exemple, :class:`fractions."
"Fraction` utilise ::"

View File

@ -18,7 +18,7 @@ msgstr ""
#: ../Doc/library/os.path.rst:2 #: ../Doc/library/os.path.rst:2
msgid ":mod:`os.path` --- Common pathname manipulations" msgid ":mod:`os.path` --- Common pathname manipulations"
msgstr "" msgstr ":mod:`os.path` — manipulation courante des chemins"
#: ../Doc/library/os.path.rst:7 #: ../Doc/library/os.path.rst:7
msgid "" msgid ""
@ -39,6 +39,20 @@ msgid ""
"encoding), hence Windows applications should use string objects to access " "encoding), hence Windows applications should use string objects to access "
"all files." "all files."
msgstr "" msgstr ""
"Ce module implémente certaines fonctions utiles sur le nom des chemins. Pour "
"lire ou écrire des fichiers, voir :func:`open`, et pour accéder au système "
"de fichier, voir le module :mod:`os`. Les paramètres de chemin daccès "
"peuvent être passés sous forme de chaînes de caractères ou de chaîne "
"d'octets. Les programmes sont encouragés à représenter les noms de fichiers "
"en tant que chaînes de caractères Unicode. Malheureusement, certains noms de "
"fichiers peuvent ne pas être représentés sous forme de chaînes de caractères "
"sous UNIX, ainsi, les programmes qui doivent prendre en charge les noms de "
"fichiers arbitraires sur UNIX doivent utiliser des chaînes d'octets pour "
"représenter leurs chemins daccès. Inversement, lutilisation de chaîne "
"d'octets ne peut pas représenter tous les noms de fichiers sous Windows "
"(dans le codage ``mbcs`` standard), par conséquent les applications Windows "
"doivent utiliser des chaînes de caractères Unicode pour accéder à tous les "
"fichiers."
#: ../Doc/library/os.path.rst:26 #: ../Doc/library/os.path.rst:26
msgid "" msgid ""
@ -47,6 +61,11 @@ msgid ""
"explicitly when an application desires shell-like path expansion. (See also " "explicitly when an application desires shell-like path expansion. (See also "
"the :mod:`glob` module.)" "the :mod:`glob` module.)"
msgstr "" msgstr ""
"Contrairement à une invite de commandes Unix, Python ne fait aucune "
"extension de chemin *automatique*. Des fonctions telles que :func:"
"`expanduser` et :func:`expandvars` peuvent être appelées explicitement "
"lorsqu'une application souhaite une extension de chemin semblable à celui "
"d'une invite de commande (voir aussi le module :mod:`glob`)."
#: ../Doc/library/os.path.rst:33 #: ../Doc/library/os.path.rst:33
msgid "The :mod:`pathlib` module offers high-level path objects." msgid "The :mod:`pathlib` module offers high-level path objects."
@ -60,6 +79,9 @@ msgid ""
"their parameters. The result is an object of the same type, if a path or " "their parameters. The result is an object of the same type, if a path or "
"file name is returned." "file name is returned."
msgstr "" msgstr ""
"Toutes ces fonctions n'acceptent que des chaînes d'octets ou des chaînes de "
"caractères en tant que paramètres. Le résultat est un objet du même type si "
"un chemin ou un nom de fichier est renvoyé."
#: ../Doc/library/os.path.rst:45 #: ../Doc/library/os.path.rst:45
msgid "" msgid ""
@ -71,14 +93,21 @@ msgid ""
"path that is *always* in one of the different formats. They all have the " "path that is *always* in one of the different formats. They all have the "
"same interface:" "same interface:"
msgstr "" msgstr ""
"Comme les différents systèmes d'exploitation ont des conventions de noms de "
"chemins différentes, il existe plusieurs versions de ce module dans la "
"bibliothèque standard. Le module :mod:`os.path` est toujours le module de "
"chemin adapté au système d'exploitation sur lequel Python tourne, et donc "
"adapté pour les chemins locaux. Cependant, vous pouvez également importer et "
"utiliser les modules individuels si vous voulez manipuler un chemin qui est "
"*toujours* dans l'un des différents formats. Ils ont tous la même interface :"
#: ../Doc/library/os.path.rst:53 #: ../Doc/library/os.path.rst:53
msgid ":mod:`posixpath` for UNIX-style paths" msgid ":mod:`posixpath` for UNIX-style paths"
msgstr "" msgstr ":mod:`posixpath` pour les chemins de type UNIX"
#: ../Doc/library/os.path.rst:54 #: ../Doc/library/os.path.rst:54
msgid ":mod:`ntpath` for Windows paths" msgid ":mod:`ntpath` for Windows paths"
msgstr "" msgstr ":mod:`ntpath` pour les chemins Windows"
#: ../Doc/library/os.path.rst:55 #: ../Doc/library/os.path.rst:55
msgid ":mod:`macpath` for old-style MacOS paths" msgid ":mod:`macpath` for old-style MacOS paths"
@ -90,6 +119,9 @@ msgid ""
"platforms, this is equivalent to calling the function :func:`normpath` as " "platforms, this is equivalent to calling the function :func:`normpath` as "
"follows: ``normpath(join(os.getcwd(), path))``." "follows: ``normpath(join(os.getcwd(), path))``."
msgstr "" msgstr ""
"Renvoie une version absolue et normalisée du chemin d'accès *path*. Sur la "
"plupart des plates-formes, cela équivaut à appeler la fonction :func:"
"`normpath` comme suit : ``normpath(join(os.getcwd(), chemin))```."
#: ../Doc/library/os.path.rst:67 #: ../Doc/library/os.path.rst:67
msgid "" msgid ""
@ -99,6 +131,11 @@ msgid ""
"program; where :program:`basename` for ``'/foo/bar/'`` returns ``'bar'``, " "program; where :program:`basename` for ``'/foo/bar/'`` returns ``'bar'``, "
"the :func:`basename` function returns an empty string (``''``)." "the :func:`basename` function returns an empty string (``''``)."
msgstr "" msgstr ""
"Renvoie le nom de base du chemin d'accès *path*. C'est le second élément de "
"la paire renvoyée en passant *path* à la fonction :func:`split`. Notez que "
"le résultat de cette fonction est différent de celui du programme Unix :"
"program:`basename` ; là où :program:`basename` pour ``'/foo/bar/'`` renvoie "
"``'bar'``, la fonction :func:`basename` renvoie une chaîne vide (``''``)."
#: ../Doc/library/os.path.rst:77 #: ../Doc/library/os.path.rst:77
msgid "" msgid ""

View File

@ -18,7 +18,7 @@ msgstr ""
#: ../Doc/library/parser.rst:2 #: ../Doc/library/parser.rst:2
msgid ":mod:`parser` --- Access Python parse trees" msgid ":mod:`parser` --- Access Python parse trees"
msgstr "" msgstr ":mod:`parser` — Accès aux arbres syntaxiques"
#: ../Doc/library/parser.rst:21 #: ../Doc/library/parser.rst:21
msgid "" msgid ""
@ -30,6 +30,13 @@ msgid ""
"in a manner identical to the code forming the application. It is also " "in a manner identical to the code forming the application. It is also "
"faster." "faster."
msgstr "" msgstr ""
"Le module :mod:`parser` expose une interface à l'analyseur et au compilateur "
"de byte-code internes de Python. Son objectif principal est de permettre à "
"du code Python de modifier l'arbre syntaxique d'une expression Python puis "
"de la rendre exécutable. Cette approche est plus fiable que celle consistant "
"à manipuler des chaines de caractères, puisque l'analyse est faite avec le "
"même analyseur que celui utilisé pour le code de l'application. C'est aussi "
"plus rapide."
#: ../Doc/library/parser.rst:30 #: ../Doc/library/parser.rst:30
msgid "" msgid ""
@ -37,6 +44,9 @@ msgid ""
"Syntax Tree (AST) generation and compilation stage, using the :mod:`ast` " "Syntax Tree (AST) generation and compilation stage, using the :mod:`ast` "
"module." "module."
msgstr "" msgstr ""
"À partir de Python 2.5, il est plus pratique de faire ces manipulations "
"entre la génération de l'AST (*Abstract Syntax Tree*) et la compilation, en "
"utilisant le module :mod:`ast`."
#: ../Doc/library/parser.rst:34 #: ../Doc/library/parser.rst:34
msgid "" msgid ""
@ -45,6 +55,10 @@ msgid ""
"editing the parse trees for Python code, but some examples of using the :mod:" "editing the parse trees for Python code, but some examples of using the :mod:"
"`parser` module are presented." "`parser` module are presented."
msgstr "" msgstr ""
"Certaines particularités de ce module sont importantes à retenir pour en "
"faire un bon usage. Ce n'est pas un tutoriel sur la modification d'arbres "
"syntaxiques Python, mais certains exemples d'utilisation du module :mod:"
"`parser` sont présentés."
#: ../Doc/library/parser.rst:39 #: ../Doc/library/parser.rst:39
msgid "" msgid ""

View File

@ -974,7 +974,7 @@ msgstr ""
#: ../Doc/library/pickle.rst:846 #: ../Doc/library/pickle.rst:846
msgid "Performance" msgid "Performance"
msgstr "" msgstr "Performances"
#: ../Doc/library/pickle.rst:848 #: ../Doc/library/pickle.rst:848
msgid "" msgid ""

View File

@ -36,7 +36,7 @@ msgstr ""
#: ../Doc/library/pickletools.rst:21 #: ../Doc/library/pickletools.rst:21
msgid "Command line usage" msgid "Command line usage"
msgstr "" msgstr "Utilisation de la ligne de commande"
#: ../Doc/library/pickletools.rst:25 #: ../Doc/library/pickletools.rst:25
msgid "" msgid ""

View File

@ -424,7 +424,7 @@ msgstr ""
#: ../Doc/library/random.rst:297 #: ../Doc/library/random.rst:297
msgid "Examples and Recipes" msgid "Examples and Recipes"
msgstr "" msgstr "Exemples et Recettes"
#: ../Doc/library/random.rst:299 #: ../Doc/library/random.rst:299
msgid "Basic usage::" msgid "Basic usage::"

View File

@ -31,12 +31,18 @@ msgid ""
"support file copying and removal. For operations on individual files, see " "support file copying and removal. For operations on individual files, see "
"also the :mod:`os` module." "also the :mod:`os` module."
msgstr "" msgstr ""
"Le module :mod:`shutil` propose des opérations de haut niveau sur les "
"fichiers et ensembles de fichiers. En particulier, des fonctions pour copier "
"et déplacer les fichiers sont proposées. Pour les opérations individuelles "
"sur les fichiers, reportez-vous au module :mod:`os`."
#: ../Doc/library/shutil.rst:25 #: ../Doc/library/shutil.rst:25
msgid "" msgid ""
"Even the higher-level file copying functions (:func:`shutil.copy`, :func:" "Even the higher-level file copying functions (:func:`shutil.copy`, :func:"
"`shutil.copy2`) cannot copy all file metadata." "`shutil.copy2`) cannot copy all file metadata."
msgstr "" msgstr ""
"Même les fonctions de copie haut niveau (:func:`shutil.copy`, :func:`shutil."
"copy2`) ne peuvent copier toutes les métadonnées des fichiers."
#: ../Doc/library/shutil.rst:28 #: ../Doc/library/shutil.rst:28
msgid "" msgid ""
@ -46,10 +52,16 @@ msgid ""
"be correct. On Windows, file owners, ACLs and alternate data streams are not " "be correct. On Windows, file owners, ACLs and alternate data streams are not "
"copied." "copied."
msgstr "" msgstr ""
"Sur les plateformes POSIX, cela signifie que le propriétaire et le groupe du "
"fichier sont perdus, ainsi que les *ACLs*. Sur Mac OS, le clonage de "
"ressource et autres métadonnées ne sont pas utilisés. Cela signifie que les "
"ressources seront perdues et que le type de fichier et les codes créateur ne "
"seront pas corrects. Sur Windows, les propriétaires des fichiers, *ACLs* et "
"flux de données alternatifs ne sont pas copiés."
#: ../Doc/library/shutil.rst:38 #: ../Doc/library/shutil.rst:38
msgid "Directory and files operations" msgid "Directory and files operations"
msgstr "" msgstr "Opérations sur les répertoires et les fichiers"
#: ../Doc/library/shutil.rst:42 #: ../Doc/library/shutil.rst:42
msgid "" msgid ""
@ -61,6 +73,13 @@ msgid ""
"the *fsrc* object is not 0, only the contents from the current file position " "the *fsrc* object is not 0, only the contents from the current file position "
"to the end of the file will be copied." "to the end of the file will be copied."
msgstr "" msgstr ""
"Copie le contenu de l'objet fichier *fsrc* dans l'objet fichier *fdst*. "
"L'entier *length*, si spécifié, est la taille du tampon. En particulier, une "
"valeur de *length* négative signifie la copie des données sans découper la "
"source en morceaux ; par défaut les données sont lues par morceaux pour "
"éviter la consommation mémoire non-contrôlée. À noter que si la position "
"courante dans l'objet *fsrc* n'est pas 0, seul le contenu depuis la position "
"courante jusqu'à la fin est copié."
#: ../Doc/library/shutil.rst:53 #: ../Doc/library/shutil.rst:53
msgid "" msgid ""
@ -78,30 +97,42 @@ msgid ""
"Special files such as character or block devices and pipes cannot be copied " "Special files such as character or block devices and pipes cannot be copied "
"with this function." "with this function."
msgstr "" msgstr ""
"La cible doit être accessible en écriture, sinon l'exception :exc:`OSError` "
"est levée. Si *dst* existe déjà, il est remplacé. Les fichiers spéciaux "
"comme les périphériques caractères ou bloc ainsi que les tubes (*pipes*) ne "
"peuvent pas être copiés avec cette fonction."
#: ../Doc/library/shutil.rst:64 #: ../Doc/library/shutil.rst:64
msgid "" msgid ""
"If *follow_symlinks* is false and *src* is a symbolic link, a new symbolic " "If *follow_symlinks* is false and *src* is a symbolic link, a new symbolic "
"link will be created instead of copying the file *src* points to." "link will be created instead of copying the file *src* points to."
msgstr "" msgstr ""
"Si *follow_symlinks* est faux et *src* est un lien symbolique, un nouveau "
"lien symbolique est créé au lieu de copier le fichier pointé par *src*."
#: ../Doc/library/shutil.rst:68 #: ../Doc/library/shutil.rst:68
msgid "" msgid ""
":exc:`IOError` used to be raised instead of :exc:`OSError`. Added " ":exc:`IOError` used to be raised instead of :exc:`OSError`. Added "
"*follow_symlinks* argument. Now returns *dst*." "*follow_symlinks* argument. Now returns *dst*."
msgstr "" msgstr ""
":exc:`IOError` était levée au lieu de :exc:`OSError`. Ajout de l'argument "
"*follow_symlinks*. Maintenant renvoie *dst*."
#: ../Doc/library/shutil.rst:73 #: ../Doc/library/shutil.rst:73
msgid "" msgid ""
"Raise :exc:`SameFileError` instead of :exc:`Error`. Since the former is a " "Raise :exc:`SameFileError` instead of :exc:`Error`. Since the former is a "
"subclass of the latter, this change is backward compatible." "subclass of the latter, this change is backward compatible."
msgstr "" msgstr ""
"Lève :exc:`SameFileError` au lieu de :exc:`Error`. Puisque la première est "
"une sous-classe de la seconde, le changement assure la rétrocompatibilité."
#: ../Doc/library/shutil.rst:80 #: ../Doc/library/shutil.rst:80
msgid "" msgid ""
"This exception is raised if source and destination in :func:`copyfile` are " "This exception is raised if source and destination in :func:`copyfile` are "
"the same file." "the same file."
msgstr "" msgstr ""
"Cette exception est levée si la source et la destination dans :func:"
"`copyfile` sont le même fichier."
#: ../Doc/library/shutil.rst:88 #: ../Doc/library/shutil.rst:88
msgid "" msgid ""
@ -117,7 +148,7 @@ msgstr ""
#: ../Doc/library/shutil.rst:97 #: ../Doc/library/shutil.rst:97
msgid "Added *follow_symlinks* argument." msgid "Added *follow_symlinks* argument."
msgstr "" msgstr "L'argument *follow_symlinks* a été ajouté."
#: ../Doc/library/shutil.rst:102 #: ../Doc/library/shutil.rst:102
msgid "" msgid ""
@ -140,12 +171,17 @@ msgid ""
"Not all platforms provide the ability to examine and modify symbolic links. " "Not all platforms provide the ability to examine and modify symbolic links. "
"Python itself can tell you what functionality is locally available." "Python itself can tell you what functionality is locally available."
msgstr "" msgstr ""
"Toutes les plateformes n'offrent pas la possibilité d'examiner et modifier "
"les liens symboliques. Python peut vous informer des fonctionnalités "
"effectivement disponibles."
#: ../Doc/library/shutil.rst:120 #: ../Doc/library/shutil.rst:120
msgid "" msgid ""
"If ``os.chmod in os.supports_follow_symlinks`` is ``True``, :func:`copystat` " "If ``os.chmod in os.supports_follow_symlinks`` is ``True``, :func:`copystat` "
"can modify the permission bits of a symbolic link." "can modify the permission bits of a symbolic link."
msgstr "" msgstr ""
"Si ``os.chmod in os.supports_follow_symlinks`` est ``True``, :func:"
"`copystat` peut modifier les octets de droits d'accès du lien symbolique."
#: ../Doc/library/shutil.rst:124 #: ../Doc/library/shutil.rst:124
msgid "" msgid ""

View File

@ -572,7 +572,7 @@ msgstr ""
#: ../Doc/library/socket.rst:488 #: ../Doc/library/socket.rst:488
msgid "Other functions" msgid "Other functions"
msgstr "" msgstr "Autres fonctions"
#: ../Doc/library/socket.rst:490 #: ../Doc/library/socket.rst:490
msgid "The :mod:`socket` module also offers various network-related services:" msgid "The :mod:`socket` module also offers various network-related services:"

View File

@ -124,7 +124,7 @@ msgstr "``'r'``"
#: ../Doc/library/sunau.rst:51 #: ../Doc/library/sunau.rst:51
msgid "Read only mode." msgid "Read only mode."
msgstr "" msgstr "Mode lecture seule."
#: ../Doc/library/sunau.rst:54 #: ../Doc/library/sunau.rst:54
msgid "``'w'``" msgid "``'w'``"
@ -132,7 +132,7 @@ msgstr "``'w'``"
#: ../Doc/library/sunau.rst:54 #: ../Doc/library/sunau.rst:54
msgid "Write only mode." msgid "Write only mode."
msgstr "" msgstr "Mode écriture seule."
#: ../Doc/library/sunau.rst:56 #: ../Doc/library/sunau.rst:56
msgid "Note that it does not allow read/write files." msgid "Note that it does not allow read/write files."
@ -146,7 +146,7 @@ msgstr ""
#: ../Doc/library/sunau.rst:64 #: ../Doc/library/sunau.rst:64
msgid "A synonym for :func:`.open`, maintained for backwards compatibility." msgid "A synonym for :func:`.open`, maintained for backwards compatibility."
msgstr "" msgstr "Un synonyme de :func:`.open`, maintenu pour la rétrocompatibilité."
#: ../Doc/library/sunau.rst:67 #: ../Doc/library/sunau.rst:67
msgid "The :mod:`sunau` module defines the following exception:" msgid "The :mod:`sunau` module defines the following exception:"
@ -202,15 +202,15 @@ msgstr ""
#: ../Doc/library/sunau.rst:126 #: ../Doc/library/sunau.rst:126
msgid "Returns sample width in bytes." msgid "Returns sample width in bytes."
msgstr "" msgstr "Renvoie la largeur de l'échantillon en octets."
#: ../Doc/library/sunau.rst:131 #: ../Doc/library/sunau.rst:131
msgid "Returns sampling frequency." msgid "Returns sampling frequency."
msgstr "" msgstr "Renvoie la fréquence d'échantillonnage."
#: ../Doc/library/sunau.rst:136 #: ../Doc/library/sunau.rst:136
msgid "Returns number of audio frames." msgid "Returns number of audio frames."
msgstr "" msgstr "Renvoie le nombre de trames audio."
#: ../Doc/library/sunau.rst:141 #: ../Doc/library/sunau.rst:141
msgid "" msgid ""
@ -231,6 +231,9 @@ msgid ""
"framerate, nframes, comptype, compname)``, equivalent to output of the :meth:" "framerate, nframes, comptype, compname)``, equivalent to output of the :meth:"
"`get\\*` methods." "`get\\*` methods."
msgstr "" msgstr ""
"Renvoie une :func:`~collections.namedtuple` ``(nchannels, sampwidth, "
"framerate, nframes, comptype, compname)``, équivalent à la sortie des "
"méthodes :meth:`get\\*`."
#: ../Doc/library/sunau.rst:161 #: ../Doc/library/sunau.rst:161
msgid "" msgid ""
@ -241,13 +244,17 @@ msgstr ""
#: ../Doc/library/sunau.rst:168 #: ../Doc/library/sunau.rst:168
msgid "Rewind the file pointer to the beginning of the audio stream." msgid "Rewind the file pointer to the beginning of the audio stream."
msgstr "" msgstr "Remet le pointeur de fichier au début du flux audio."
#: ../Doc/library/sunau.rst:170 #: ../Doc/library/sunau.rst:170
msgid "" msgid ""
"The following two methods define a term \"position\" which is compatible " "The following two methods define a term \"position\" which is compatible "
"between them, and is otherwise implementation dependent." "between them, and is otherwise implementation dependent."
msgstr "" msgstr ""
"Les deux fonctions suivantes utilisent le vocabulaire \"position\". Ces "
"positions sont compatible entre elles, la \"position\" de l'un est "
"compatible avec la \"position\" de l'autre. Cette position est dépendante de "
"l'implémentation."
#: ../Doc/library/sunau.rst:176 #: ../Doc/library/sunau.rst:176
msgid "" msgid ""
@ -269,11 +276,11 @@ msgstr ""
#: ../Doc/library/sunau.rst:191 #: ../Doc/library/sunau.rst:191
msgid "Returns ``None``." msgid "Returns ``None``."
msgstr "" msgstr "Renvoie ``None``."
#: ../Doc/library/sunau.rst:196 #: ../Doc/library/sunau.rst:196
msgid "Raise an error." msgid "Raise an error."
msgstr "" msgstr "Lève une erreur."
#: ../Doc/library/sunau.rst:202 #: ../Doc/library/sunau.rst:202
msgid "AU_write Objects" msgid "AU_write Objects"
@ -287,7 +294,7 @@ msgstr ""
#: ../Doc/library/sunau.rst:209 #: ../Doc/library/sunau.rst:209
msgid "Set the number of channels." msgid "Set the number of channels."
msgstr "" msgstr "Définit le nombre de canaux."
#: ../Doc/library/sunau.rst:214 #: ../Doc/library/sunau.rst:214
msgid "Set the sample width (in bytes.)" msgid "Set the sample width (in bytes.)"
@ -328,7 +335,7 @@ msgstr ""
#: ../Doc/library/sunau.rst:252 #: ../Doc/library/sunau.rst:252
msgid "Write audio frames, without correcting *nframes*." msgid "Write audio frames, without correcting *nframes*."
msgstr "" msgstr "Écrit les trames audio sans corriger *nframes*."
#: ../Doc/library/sunau.rst:254 ../Doc/library/sunau.rst:262 #: ../Doc/library/sunau.rst:254 ../Doc/library/sunau.rst:262
msgid "Any :term:`bytes-like object` is now accepted." msgid "Any :term:`bytes-like object` is now accepted."

View File

@ -266,7 +266,7 @@ msgstr ""
#: ../Doc/library/sysconfig.rst:162 #: ../Doc/library/sysconfig.rst:162
msgid "Other functions" msgid "Other functions"
msgstr "" msgstr "Autres fonctions"
#: ../Doc/library/sysconfig.rst:166 #: ../Doc/library/sysconfig.rst:166
msgid "" msgid ""

View File

@ -689,6 +689,7 @@ msgstr "Le paramètre *timeout* est nouveau."
#: ../Doc/library/threading.rst:401 #: ../Doc/library/threading.rst:401
msgid "Lock acquires can now be interrupted by signals on POSIX." msgid "Lock acquires can now be interrupted by signals on POSIX."
msgstr "" msgstr ""
"Le verrou acquis peut maintenant être interrompu par des signaux sur POSIX."
#: ../Doc/library/threading.rst:407 #: ../Doc/library/threading.rst:407
msgid "" msgid ""

View File

@ -18,7 +18,7 @@ msgstr ""
#: ../Doc/library/timeit.rst:2 #: ../Doc/library/timeit.rst:2
msgid ":mod:`timeit` --- Measure execution time of small code snippets" msgid ":mod:`timeit` --- Measure execution time of small code snippets"
msgstr "" msgstr ":mod:`timeit` — Mesurer le temps d'exécution de fragments de code"
#: ../Doc/library/timeit.rst:7 #: ../Doc/library/timeit.rst:7
msgid "**Source code:** :source:`Lib/timeit.py`" msgid "**Source code:** :source:`Lib/timeit.py`"
@ -32,20 +32,29 @@ msgid ""
"execution times. See also Tim Peters' introduction to the \"Algorithms\" " "execution times. See also Tim Peters' introduction to the \"Algorithms\" "
"chapter in the *Python Cookbook*, published by O'Reilly." "chapter in the *Python Cookbook*, published by O'Reilly."
msgstr "" msgstr ""
"Ce module fournit une façon simple de mesurer le temps d'exécution de "
"fragments de code Python. Il expose une :ref:`timeit-command-line-interface` "
"ainsi qu'une :ref:`interface Python <python-interface>`. Ce module permet "
"d'éviter un certain nombre de problèmes classiques liés à la mesure des "
"temps d'exécution. Voir par exemple à ce sujet l'introduction par Tim Peters "
"du chapitre « Algorithmes » dans le livre *Python Cookbook*, aux éditions "
"O'Reilly."
#: ../Doc/library/timeit.rst:23 #: ../Doc/library/timeit.rst:23
msgid "Basic Examples" msgid "Basic Examples"
msgstr "" msgstr "Exemples simples"
#: ../Doc/library/timeit.rst:25 #: ../Doc/library/timeit.rst:25
msgid "" msgid ""
"The following example shows how the :ref:`timeit-command-line-interface` can " "The following example shows how the :ref:`timeit-command-line-interface` can "
"be used to compare three different expressions:" "be used to compare three different expressions:"
msgstr "" msgstr ""
"L'exemple suivant illustre l'utilisation de l':ref:`timeit-command-line-"
"interface` afin de comparer trois expressions différentes :"
#: ../Doc/library/timeit.rst:37 #: ../Doc/library/timeit.rst:37
msgid "This can be achieved from the :ref:`python-interface` with::" msgid "This can be achieved from the :ref:`python-interface` with::"
msgstr "" msgstr "L':ref:`python-interface` peut être utilisée aux mêmes fins avec : ::"
#: ../Doc/library/timeit.rst:48 #: ../Doc/library/timeit.rst:48
msgid "" msgid ""
@ -56,11 +65,13 @@ msgstr ""
#: ../Doc/library/timeit.rst:56 #: ../Doc/library/timeit.rst:56
msgid "Python Interface" msgid "Python Interface"
msgstr "" msgstr "Interface Python"
#: ../Doc/library/timeit.rst:58 #: ../Doc/library/timeit.rst:58
msgid "The module defines three convenience functions and a public class:" msgid "The module defines three convenience functions and a public class:"
msgstr "" msgstr ""
"Ce module définit une classe publique ainsi que trois fonctions destinées à "
"simplifier son usage :"
#: ../Doc/library/timeit.rst:63 #: ../Doc/library/timeit.rst:63
msgid "" msgid ""
@ -69,11 +80,15 @@ msgid ""
"executions. The optional *globals* argument specifies a namespace in which " "executions. The optional *globals* argument specifies a namespace in which "
"to execute the code." "to execute the code."
msgstr "" msgstr ""
"Crée une instance d'objet :class:`Timer` à partir de l'instruction donnée, "
"du code *setup* et de la fonction *timer*, puis exécute sa méthode :meth:`."
"timeit` à *number* reprises. L'argument optionnel *globals* spécifie un "
"espace de nommage dans lequel exécuter le code."
#: ../Doc/library/timeit.rst:68 ../Doc/library/timeit.rst:79 #: ../Doc/library/timeit.rst:68 ../Doc/library/timeit.rst:79
#: ../Doc/library/timeit.rst:113 #: ../Doc/library/timeit.rst:113
msgid "The optional *globals* parameter was added." msgid "The optional *globals* parameter was added."
msgstr "" msgstr "Le paramètre optionnel *globals* a été ajouté."
#: ../Doc/library/timeit.rst:74 #: ../Doc/library/timeit.rst:74
msgid "" msgid ""
@ -82,18 +97,23 @@ msgid ""
"count and *number* executions. The optional *globals* argument specifies a " "count and *number* executions. The optional *globals* argument specifies a "
"namespace in which to execute the code." "namespace in which to execute the code."
msgstr "" msgstr ""
"Crée une instance d'objet :class:`Timer` à partir de l'instruction donnée, "
"du code *setup* et de la fonction *timer*, puis exécute sa méthode :meth:`."
"repeat` à *number* reprises, *repeat* fois. L'argument optionnel *globals* "
"spécifie un espace de nommage dans lequel exécuter le code."
#: ../Doc/library/timeit.rst:84 #: ../Doc/library/timeit.rst:84
msgid "The default timer, which is always :func:`time.perf_counter`." msgid "The default timer, which is always :func:`time.perf_counter`."
msgstr "" msgstr "Le minuteur par défaut, qui est toujours :func:`time.perf_counter`."
#: ../Doc/library/timeit.rst:86 #: ../Doc/library/timeit.rst:86
msgid ":func:`time.perf_counter` is now the default timer." msgid ":func:`time.perf_counter` is now the default timer."
msgstr "" msgstr ":func:`time.perf_counter` est désormais le minuteur par défaut."
#: ../Doc/library/timeit.rst:92 #: ../Doc/library/timeit.rst:92
msgid "Class for timing execution speed of small code snippets." msgid "Class for timing execution speed of small code snippets."
msgstr "" msgstr ""
"Classe permettant de mesurer le temps d'exécution de fragments de code."
#: ../Doc/library/timeit.rst:94 #: ../Doc/library/timeit.rst:94
msgid "" msgid ""
@ -105,6 +125,16 @@ msgid ""
"will by default be executed within timeit's namespace; this behavior can be " "will by default be executed within timeit's namespace; this behavior can be "
"controlled by passing a namespace to *globals*." "controlled by passing a namespace to *globals*."
msgstr "" msgstr ""
"Ce constructeur prend en argument une instruction dont le temps d'exécution "
"doit être mesuré, une instruction additionnelle de mise en place et une "
"fonction de chronométrage. Les deux instructions valent ``'pass'`` par "
"défaut; la fonction de chronométrage dépend de la plateforme d'exécution (se "
"référer au *doc string* du module). *stmt* et *setup* peuvent contenir "
"plusieurs instructions séparées par des ``;`` ou des sauts de lignes tant "
"qu'ils ne comportent pas de littéraux sur plusieurs lignes. L'instruction "
"est exécutée dans l'espace de nommage de *timeit* par défaut ; ce "
"comportement peut être modifié en passant un espace de nommage au paramètre "
"*globals*."
#: ../Doc/library/timeit.rst:102 #: ../Doc/library/timeit.rst:102
msgid "" msgid ""
@ -118,6 +148,8 @@ msgid ""
"The execution time of *setup* is excluded from the overall timed execution " "The execution time of *setup* is excluded from the overall timed execution "
"run." "run."
msgstr "" msgstr ""
"Le temps d'exécution de *setup* n'est pas pris en compte dans le temps "
"global d'exécution."
#: ../Doc/library/timeit.rst:108 #: ../Doc/library/timeit.rst:108
msgid "" msgid ""
@ -126,6 +158,11 @@ msgid ""
"will then be executed by :meth:`.timeit`. Note that the timing overhead is " "will then be executed by :meth:`.timeit`. Note that the timing overhead is "
"a little larger in this case because of the extra function calls." "a little larger in this case because of the extra function calls."
msgstr "" msgstr ""
"Les paramètres *stmt* et *setup* peuvent également recevoir des objets "
"appelables sans argument. Ceci transforme alors les appels à ces objets en "
"fonction de chronométrage qui seront exécutées par :meth:`.timeit`. Notez "
"que le surcoût lié à la mesure du temps d'exécution dans ce cas est "
"légèrement supérieur en raisons des appels de fonction supplémentaires."
#: ../Doc/library/timeit.rst:118 #: ../Doc/library/timeit.rst:118
msgid "" msgid ""
@ -136,6 +173,13 @@ msgid ""
"statement, the setup statement and the timer function to be used are passed " "statement, the setup statement and the timer function to be used are passed "
"to the constructor." "to the constructor."
msgstr "" msgstr ""
"Mesure le temps *number* exécution de l'instruction principale. Ceci exécute "
"l'instruction de mise en place une seule fois puis renvoie un flottant "
"correspondant au temps nécessaire à l'exécution de l'instruction principale "
"à plusieurs reprises, mesuré en secondes. L'argument correspond au nombre "
"d'itérations dans la boucle, par défaut un million. L'instruction "
"principale, l'instruction de mise en place et la fonction de chronométrage "
"utilisée sont passées au constructeur."
#: ../Doc/library/timeit.rst:127 #: ../Doc/library/timeit.rst:127
msgid "" msgid ""
@ -149,7 +193,7 @@ msgstr ""
#: ../Doc/library/timeit.rst:139 #: ../Doc/library/timeit.rst:139
msgid "Call :meth:`.timeit` a few times." msgid "Call :meth:`.timeit` a few times."
msgstr "" msgstr "Appelle :meth:`.timeit` plusieurs fois."
#: ../Doc/library/timeit.rst:141 #: ../Doc/library/timeit.rst:141
msgid "" msgid ""
@ -158,6 +202,10 @@ msgid ""
"call :meth:`.timeit`. The second argument specifies the *number* argument " "call :meth:`.timeit`. The second argument specifies the *number* argument "
"for :meth:`.timeit`." "for :meth:`.timeit`."
msgstr "" msgstr ""
"Cette fonction d'agrément appelle :meth:`.timeit` à plusieurs reprises et "
"renvoie une liste de résultats. Le premier argument spécifie le nombre "
"d'appels à :meth:`.timeit`. Le second argument spécifie l'argument *number* "
"de :meth:`.timeit`."
#: ../Doc/library/timeit.rst:148 #: ../Doc/library/timeit.rst:148
msgid "" msgid ""
@ -170,6 +218,16 @@ msgid ""
"only number you should be interested in. After that, you should look at the " "only number you should be interested in. After that, you should look at the "
"entire vector and apply common sense rather than statistics." "entire vector and apply common sense rather than statistics."
msgstr "" msgstr ""
"Il est tentant de vouloir calculer la moyenne et l'écart-type des résultats "
"et notifier ces valeurs. Ce n'est cependant pas très utile. En pratique, la "
"valeur la plus basse donne une estimation basse de la vitesse maximale à "
"laquelle votre machine peut exécuter le fragment de code spécifié ; les "
"valeurs hautes de la liste sont typiquement provoquées non pas par une "
"variabilité de la vitesse d'exécution de Python, mais par d'autres processus "
"interférant avec la précision du chronométrage. Le :func:`min` du résultat "
"est probablement la seule valeur à laquelle vous devriez vous intéresser. "
"Pour aller plus loin, vous devriez regarder l'intégralité des résultats et "
"utiliser le bon sens plutôt que les statistiques."
#: ../Doc/library/timeit.rst:161 #: ../Doc/library/timeit.rst:161
msgid "Helper to print a traceback from the timed code." msgid "Helper to print a traceback from the timed code."
@ -177,7 +235,7 @@ msgstr ""
#: ../Doc/library/timeit.rst:163 #: ../Doc/library/timeit.rst:163
msgid "Typical use::" msgid "Typical use::"
msgstr "" msgstr "Usage typique : ::"
#: ../Doc/library/timeit.rst:171 #: ../Doc/library/timeit.rst:171
msgid "" msgid ""
@ -194,14 +252,16 @@ msgstr "Interface en ligne de commande"
msgid "" msgid ""
"When called as a program from the command line, the following form is used::" "When called as a program from the command line, the following form is used::"
msgstr "" msgstr ""
"Lorsque le module est appelé comme un programme en ligne de commande, la "
"syntaxe suivante est utilisée : ::"
#: ../Doc/library/timeit.rst:185 #: ../Doc/library/timeit.rst:185
msgid "Where the following options are understood:" msgid "Where the following options are understood:"
msgstr "" msgstr "Les options suivantes sont gérées :"
#: ../Doc/library/timeit.rst:191 #: ../Doc/library/timeit.rst:191
msgid "how many times to execute 'statement'" msgid "how many times to execute 'statement'"
msgstr "" msgstr "nombre d'exécutions de l'instruction *statement*"
#: ../Doc/library/timeit.rst:195 #: ../Doc/library/timeit.rst:195
msgid "how many times to repeat the timer (default 3)" msgid "how many times to repeat the timer (default 3)"
@ -210,12 +270,16 @@ msgstr ""
#: ../Doc/library/timeit.rst:199 #: ../Doc/library/timeit.rst:199
msgid "statement to be executed once initially (default ``pass``)" msgid "statement to be executed once initially (default ``pass``)"
msgstr "" msgstr ""
"instruction exécutée une seule fois à l'initialisation (``pass`` par défaut)"
#: ../Doc/library/timeit.rst:203 #: ../Doc/library/timeit.rst:203
msgid "" msgid ""
"measure process time, not wallclock time, using :func:`time.process_time` " "measure process time, not wallclock time, using :func:`time.process_time` "
"instead of :func:`time.perf_counter`, which is the default" "instead of :func:`time.perf_counter`, which is the default"
msgstr "" msgstr ""
"mesure le temps au niveau du processus et non au niveau du système, en "
"utilisant :func:`time.process_time` plutôt que :func:`time.perf_counter` qui "
"est utilisée par défaut"
#: ../Doc/library/timeit.rst:210 #: ../Doc/library/timeit.rst:210
msgid "use :func:`time.time` (deprecated)" msgid "use :func:`time.time` (deprecated)"
@ -235,7 +299,7 @@ msgstr ""
#: ../Doc/library/timeit.rst:228 #: ../Doc/library/timeit.rst:228
msgid "print a short usage message and exit" msgid "print a short usage message and exit"
msgstr "" msgstr "affiche un court message d'aide puis quitte"
#: ../Doc/library/timeit.rst:230 #: ../Doc/library/timeit.rst:230
msgid "" msgid ""
@ -244,12 +308,19 @@ msgid ""
"quotes and using leading spaces. Multiple :option:`-s` options are treated " "quotes and using leading spaces. Multiple :option:`-s` options are treated "
"similarly." "similarly."
msgstr "" msgstr ""
"Une instruction sur plusieurs lignes peut être donnée en entrée en "
"spécifiant chaque ligne comme un argument séparé. Indenter une ligne est "
"possible en encadrant l'argument de guillemets et en le préfixant par des "
"espaces. Plusieurs :option:`-s` sont gérées de la même façon."
#: ../Doc/library/timeit.rst:235 #: ../Doc/library/timeit.rst:235
msgid "" msgid ""
"If :option:`-n` is not given, a suitable number of loops is calculated by " "If :option:`-n` is not given, a suitable number of loops is calculated by "
"trying successive powers of 10 until the total time is at least 0.2 seconds." "trying successive powers of 10 until the total time is at least 0.2 seconds."
msgstr "" msgstr ""
"Si :option:`-n` n'est pas donnée, le nombre de boucles adapté est déterminé "
"automatiquement en essayant les puissances de 10 successives jusqu'à ce que "
"le temps total d'exécution dépasse 0,2 secondes."
#: ../Doc/library/timeit.rst:238 #: ../Doc/library/timeit.rst:238
msgid "" msgid ""
@ -268,6 +339,11 @@ msgid ""
"it. The baseline overhead can be measured by invoking the program without " "it. The baseline overhead can be measured by invoking the program without "
"arguments, and it might differ between Python versions." "arguments, and it might differ between Python versions."
msgstr "" msgstr ""
"Il existe un surcoût minimal associé à l'exécution de l'instruction `pass`. "
"Le code présenté ici ne tente pas de le masquer, mais vous devez être "
"conscient de son existence. Ce surcoût minimal peut être mesuré en invoquant "
"le programme sans argument ; il peut différer en fonction des versions de "
"Python."
#: ../Doc/library/timeit.rst:255 #: ../Doc/library/timeit.rst:255
msgid "Examples" msgid "Examples"
@ -278,10 +354,14 @@ msgid ""
"It is possible to provide a setup statement that is executed only once at " "It is possible to provide a setup statement that is executed only once at "
"the beginning:" "the beginning:"
msgstr "" msgstr ""
"Il est possible de fournir une instruction de mise en place exécutée une "
"seule fois au début du chronométrage :"
#: ../Doc/library/timeit.rst:274 #: ../Doc/library/timeit.rst:274
msgid "The same can be done using the :class:`Timer` class and its methods::" msgid "The same can be done using the :class:`Timer` class and its methods::"
msgstr "" msgstr ""
"La même chose peut être réalisée en utilisant la classe :class:`Timer` et "
"ses méthodes : ::"
#: ../Doc/library/timeit.rst:284 #: ../Doc/library/timeit.rst:284
msgid "" msgid ""
@ -289,12 +369,19 @@ msgid ""
"lines. Here we compare the cost of using :func:`hasattr` vs. :keyword:`try`/:" "lines. Here we compare the cost of using :func:`hasattr` vs. :keyword:`try`/:"
"keyword:`except` to test for missing and present object attributes:" "keyword:`except` to test for missing and present object attributes:"
msgstr "" msgstr ""
"Les exemples qui suivent montrent comment chronométrer des expressions sur "
"plusieurs lignes. Nous comparons ici le coût d'utilisation de :func:"
"`hasattr` par rapport à :keyword:`try`/:keyword:`except` pour tester la "
"présence ou l'absence d'attributs d'un objet :"
#: ../Doc/library/timeit.rst:330 #: ../Doc/library/timeit.rst:330
msgid "" msgid ""
"To give the :mod:`timeit` module access to functions you define, you can " "To give the :mod:`timeit` module access to functions you define, you can "
"pass a *setup* parameter which contains an import statement::" "pass a *setup* parameter which contains an import statement::"
msgstr "" msgstr ""
"Afin de permettre à :mod:`timeit` d'accéder aux fonctions que vous avez "
"définies, vous pouvez passer au paramètre *setup* une instruction "
"d'importation: ::"
#: ../Doc/library/timeit.rst:341 #: ../Doc/library/timeit.rst:341
msgid "" msgid ""
@ -302,3 +389,6 @@ msgid ""
"will cause the code to be executed within your current global namespace. " "will cause the code to be executed within your current global namespace. "
"This can be more convenient than individually specifying imports::" "This can be more convenient than individually specifying imports::"
msgstr "" msgstr ""
"Une autre possibilité est de passer :func:`globals` au paramètre *globals*, "
"ceci qui exécutera le code dans l'espace de nommage global courant. Cela "
"peut être plus pratique que de spécifier manuellement des importations: ::"

File diff suppressed because it is too large Load Diff

View File

@ -179,7 +179,7 @@ msgstr ""
#: ../Doc/library/tkinter.ttk.rst:121 #: ../Doc/library/tkinter.ttk.rst:121
msgid "cursor" msgid "cursor"
msgstr "" msgstr "*cursor*"
#: ../Doc/library/tkinter.ttk.rst:121 #: ../Doc/library/tkinter.ttk.rst:121
msgid "" msgid ""
@ -539,7 +539,7 @@ msgstr ""
#: ../Doc/library/tkinter.ttk.rst:325 #: ../Doc/library/tkinter.ttk.rst:325
msgid "justify" msgid "justify"
msgstr "" msgstr "*justify*"
#: ../Doc/library/tkinter.ttk.rst:325 #: ../Doc/library/tkinter.ttk.rst:325
msgid "" msgid ""
@ -1246,7 +1246,7 @@ msgstr ""
#: ../Doc/library/tkinter.ttk.rst:814 #: ../Doc/library/tkinter.ttk.rst:814
msgid "font" msgid "font"
msgstr "" msgstr "*font*"
#: ../Doc/library/tkinter.ttk.rst:814 #: ../Doc/library/tkinter.ttk.rst:814
msgid "Specifies the font to use when drawing text." msgid "Specifies the font to use when drawing text."
@ -1550,7 +1550,7 @@ msgstr ""
#: ../Doc/library/tkinter.ttk.rst:1002 #: ../Doc/library/tkinter.ttk.rst:1002
msgid "region" msgid "region"
msgstr "" msgstr "*region*"
#: ../Doc/library/tkinter.ttk.rst:1002 #: ../Doc/library/tkinter.ttk.rst:1002
msgid "meaning" msgid "meaning"

View File

@ -22,35 +22,40 @@ msgstr ""
#: ../Doc/library/unittest.mock-examples.rst:13 #: ../Doc/library/unittest.mock-examples.rst:13
msgid "Using Mock" msgid "Using Mock"
msgstr "" msgstr "Utilisation de Mock ou l'art de singer"
#: ../Doc/library/unittest.mock-examples.rst:16 #: ../Doc/library/unittest.mock-examples.rst:16
msgid "Mock Patching Methods" msgid "Mock Patching Methods"
msgstr "" msgstr "Simulation des méthodes"
#: ../Doc/library/unittest.mock-examples.rst:18 #: ../Doc/library/unittest.mock-examples.rst:18
msgid "Common uses for :class:`Mock` objects include:" msgid "Common uses for :class:`Mock` objects include:"
msgstr "" msgstr "Usages courant de :class:`Mock` :"
#: ../Doc/library/unittest.mock-examples.rst:20 #: ../Doc/library/unittest.mock-examples.rst:20
msgid "Patching methods" msgid "Patching methods"
msgstr "" msgstr "Substitution des méthodes"
#: ../Doc/library/unittest.mock-examples.rst:21 #: ../Doc/library/unittest.mock-examples.rst:21
msgid "Recording method calls on objects" msgid "Recording method calls on objects"
msgstr "" msgstr "Enregistrement des appels faits sur les objets"
#: ../Doc/library/unittest.mock-examples.rst:23 #: ../Doc/library/unittest.mock-examples.rst:23
msgid "" msgid ""
"You might want to replace a method on an object to check that it is called " "You might want to replace a method on an object to check that it is called "
"with the correct arguments by another part of the system:" "with the correct arguments by another part of the system:"
msgstr "" msgstr ""
"On peut remplacer une méthode sur un objet pour contrôler qu'elle est bien "
"appelée avec le nombre correct d'arguments :"
#: ../Doc/library/unittest.mock-examples.rst:31 #: ../Doc/library/unittest.mock-examples.rst:31
msgid "" msgid ""
"Once our mock has been used (``real.method`` in this example) it has methods " "Once our mock has been used (``real.method`` in this example) it has methods "
"and attributes that allow you to make assertions about how it has been used." "and attributes that allow you to make assertions about how it has been used."
msgstr "" msgstr ""
"Une fois notre objet simulacre appelé (via ``real.method`` dans notre "
"exemple), il fournit des méthodes et attributs permettant de valider comment "
"il a été appelé."
#: ../Doc/library/unittest.mock-examples.rst:36 #: ../Doc/library/unittest.mock-examples.rst:36
msgid "" msgid ""
@ -58,6 +63,10 @@ msgid ""
"are interchangeable. As the ``MagicMock`` is the more capable class it makes " "are interchangeable. As the ``MagicMock`` is the more capable class it makes "
"a sensible one to use by default." "a sensible one to use by default."
msgstr "" msgstr ""
"Dans la majeure partie des exemples donnés ici, les classes :class:`Mock` "
"et :class:`MagicMock` sont interchangeables. Étant donné que ``MagicMock`` "
"est la classe la plus puissante des deux, cela fait sens de l'utiliser par "
"défaut."
#: ../Doc/library/unittest.mock-examples.rst:40 #: ../Doc/library/unittest.mock-examples.rst:40
msgid "" msgid ""
@ -66,16 +75,22 @@ msgid ""
"or :meth:`~Mock.assert_called_once_with` method to check that it was called " "or :meth:`~Mock.assert_called_once_with` method to check that it was called "
"with the correct arguments." "with the correct arguments."
msgstr "" msgstr ""
"Une fois l'objet Mock appelé, son attribut :attr:`~Mock.called` est défini à "
"``True``. Qui plus est, nous pouvons utiliser les méthodes :meth:`~Mock."
"assert_called_with` ou :meth:`~Mock.assert_called_once_with` pour contrôler "
"qu'il a été appelé avec les bons arguments."
#: ../Doc/library/unittest.mock-examples.rst:45 #: ../Doc/library/unittest.mock-examples.rst:45
msgid "" msgid ""
"This example tests that calling ``ProductionClass().method`` results in a " "This example tests that calling ``ProductionClass().method`` results in a "
"call to the ``something`` method:" "call to the ``something`` method:"
msgstr "" msgstr ""
"Cet exemple teste que l'appel de la méthode ``ProductionClass().method`` "
"implique bien celui de la méthode ``something`` :"
#: ../Doc/library/unittest.mock-examples.rst:62 #: ../Doc/library/unittest.mock-examples.rst:62
msgid "Mock for Method Calls on an Object" msgid "Mock for Method Calls on an Object"
msgstr "" msgstr "S'assurer de la bonne utilisation d'un objet"
#: ../Doc/library/unittest.mock-examples.rst:64 #: ../Doc/library/unittest.mock-examples.rst:64
msgid "" msgid ""
@ -84,18 +99,27 @@ msgid ""
"method (or some part of the system under test) and then check that it is " "method (or some part of the system under test) and then check that it is "
"used in the correct way." "used in the correct way."
msgstr "" msgstr ""
"Dans l'exemple précédent, nous avons directement remplacé une méthode par un "
"objet (afin de valider que l'appel était correct). Une autre façon de faire "
"est de passer un objet Mock en argument d'une méthode (ou de tout autre "
"partie du code à tester) et ensuite de contrôler que notre objet a été "
"utilisé de la façon attendue."
#: ../Doc/library/unittest.mock-examples.rst:69 #: ../Doc/library/unittest.mock-examples.rst:69
msgid "" msgid ""
"The simple ``ProductionClass`` below has a ``closer`` method. If it is " "The simple ``ProductionClass`` below has a ``closer`` method. If it is "
"called with an object then it calls ``close`` on it." "called with an object then it calls ``close`` on it."
msgstr "" msgstr ""
"Ci-dessous, ``ProductionClass`` dispose d'une méthode ``closer``. Si on "
"l'appelle avec un objet, alors elle appelle la méthode ``close`` dessus."
#: ../Doc/library/unittest.mock-examples.rst:77 #: ../Doc/library/unittest.mock-examples.rst:77
msgid "" msgid ""
"So to test it we need to pass in an object with a ``close`` method and check " "So to test it we need to pass in an object with a ``close`` method and check "
"that it was called correctly." "that it was called correctly."
msgstr "" msgstr ""
"Ainsi, pour tester cette classe, nous devons lui passer un objet ayant une "
"méthode ``close``, puis vérifier qu'elle a bien été appelée."
#: ../Doc/library/unittest.mock-examples.rst:85 #: ../Doc/library/unittest.mock-examples.rst:85
msgid "" msgid ""
@ -104,10 +128,15 @@ msgid ""
"accessing it in the test will create it, but :meth:`~Mock." "accessing it in the test will create it, but :meth:`~Mock."
"assert_called_with` will raise a failure exception." "assert_called_with` will raise a failure exception."
msgstr "" msgstr ""
"En fait, nous n'avons pas à nous soucier de fournir la méthode ``close`` "
"dans notre objet « simulé ». Le simple fait d'accéder à la méthode ``close`` "
"l'a crée. Si par contre la méthode ``close`` n'a pas été appelée alors, bien "
"que le test la créée en y accédant, :meth:`~Mock.assert_called_with` lèvera "
"une exception."
#: ../Doc/library/unittest.mock-examples.rst:92 #: ../Doc/library/unittest.mock-examples.rst:92
msgid "Mocking Classes" msgid "Mocking Classes"
msgstr "" msgstr "Simulation des classes"
#: ../Doc/library/unittest.mock-examples.rst:94 #: ../Doc/library/unittest.mock-examples.rst:94
msgid "" msgid ""
@ -116,6 +145,11 @@ msgid ""
"Instances are created by *calling the class*. This means you access the " "Instances are created by *calling the class*. This means you access the "
"\"mock instance\" by looking at the return value of the mocked class." "\"mock instance\" by looking at the return value of the mocked class."
msgstr "" msgstr ""
"Un cas d'utilisation courant consiste à émuler les classes instanciées par "
"le code que nous testons. Quand on *patch* une classe, alors cette classe "
"est remplacée par un objet *mock*. Les instances de la classe étant créées "
"en *appelant la classe*, on accède à « l'instance *mock* » via la valeur de "
"retour de la classe émulée."
#: ../Doc/library/unittest.mock-examples.rst:99 #: ../Doc/library/unittest.mock-examples.rst:99
msgid "" msgid ""

View File

@ -18,7 +18,7 @@ msgstr ""
#: ../Doc/library/wave.rst:2 #: ../Doc/library/wave.rst:2
msgid ":mod:`wave` --- Read and write WAV files" msgid ":mod:`wave` --- Read and write WAV files"
msgstr "" msgstr ":mod:`wave` --- Lecture et écriture des fichiers WAV"
#: ../Doc/library/wave.rst:10 #: ../Doc/library/wave.rst:10
msgid "**Source code:** :source:`Lib/wave.py`" msgid "**Source code:** :source:`Lib/wave.py`"
@ -30,16 +30,21 @@ msgid ""
"format. It does not support compression/decompression, but it does support " "format. It does not support compression/decompression, but it does support "
"mono/stereo." "mono/stereo."
msgstr "" msgstr ""
"Le module :mod:`wave` fournit une interface pratique pour le format de son "
"WAV. Il ne gère pas la compression ni la décompression, mais gère le mono et "
"le stéréo."
#: ../Doc/library/wave.rst:17 #: ../Doc/library/wave.rst:17
msgid "The :mod:`wave` module defines the following function and exception:" msgid "The :mod:`wave` module defines the following function and exception:"
msgstr "" msgstr "Le module :mod:`wave` définit la fonction et l'exception suivante :"
#: ../Doc/library/wave.rst:22 #: ../Doc/library/wave.rst:22
msgid "" msgid ""
"If *file* is a string, open the file by that name, otherwise treat it as a " "If *file* is a string, open the file by that name, otherwise treat it as a "
"file-like object. *mode* can be:" "file-like object. *mode* can be:"
msgstr "" msgstr ""
"Si *file* est une chaîne de caractères, ouvre le fichier sous ce nom, sinon, "
"il est traité comme un objet de type fichier. *mode* peut être :"
#: ../Doc/library/wave.rst:26 #: ../Doc/library/wave.rst:26
msgid "``'rb'``" msgid "``'rb'``"
@ -47,7 +52,7 @@ msgstr "``'rb'``"
#: ../Doc/library/wave.rst:26 #: ../Doc/library/wave.rst:26
msgid "Read only mode." msgid "Read only mode."
msgstr "" msgstr "Mode lecture seule."
#: ../Doc/library/wave.rst:29 #: ../Doc/library/wave.rst:29
msgid "``'wb'``" msgid "``'wb'``"
@ -55,11 +60,13 @@ msgstr "``'wb'``"
#: ../Doc/library/wave.rst:29 #: ../Doc/library/wave.rst:29
msgid "Write only mode." msgid "Write only mode."
msgstr "" msgstr "Mode écriture seule."
#: ../Doc/library/wave.rst:31 #: ../Doc/library/wave.rst:31
msgid "Note that it does not allow read/write WAV files." msgid "Note that it does not allow read/write WAV files."
msgstr "" msgstr ""
"Notez que ce module ne permet pas de manipuler des fichiers WAV en lecture/"
"écriture."
#: ../Doc/library/wave.rst:33 #: ../Doc/library/wave.rst:33
msgid "" msgid ""
@ -68,6 +75,10 @@ msgid ""
"file-like object is passed as *file*, ``file.mode`` is used as the default " "file-like object is passed as *file*, ``file.mode`` is used as the default "
"value for *mode*." "value for *mode*."
msgstr "" msgstr ""
"Un *mode* ``'rb'`` renvoie un objet :class:`Wave_read`, alors qu'un *mode* "
"``'wb'`` renvoie un objet :class:`Wave_write`. Si *mode* est omis et qu'un "
"objet de type fichier est donné au paramètre *file*, ``file.mode`` est "
"utilisé comme valeur par défaut pour *mode*."
#: ../Doc/library/wave.rst:38 #: ../Doc/library/wave.rst:38
msgid "" msgid ""
@ -75,6 +86,9 @@ msgid ""
"its :meth:`close` method is called; it is the caller's responsibility to " "its :meth:`close` method is called; it is the caller's responsibility to "
"close the file object." "close the file object."
msgstr "" msgstr ""
"Si vous donnez un objet de type fichier, l'objet *wave* ne le ferme pas "
"lorsque sa méthode :meth:`close` est appelée car c'est l'appelant qui est "
"responsable de la fermeture."
#: ../Doc/library/wave.rst:42 #: ../Doc/library/wave.rst:42
msgid "" msgid ""
@ -86,58 +100,67 @@ msgstr ""
#: ../Doc/library/wave.rst:47 ../Doc/library/wave.rst:168 #: ../Doc/library/wave.rst:47 ../Doc/library/wave.rst:168
msgid "Added support for unseekable files." msgid "Added support for unseekable files."
msgstr "" msgstr "Ajout de la gestion des fichiers non navigables."
#: ../Doc/library/wave.rst:52 #: ../Doc/library/wave.rst:52
msgid "A synonym for :func:`.open`, maintained for backwards compatibility." msgid "A synonym for :func:`.open`, maintained for backwards compatibility."
msgstr "" msgstr "Un synonyme de :func:`.open`, maintenu pour la rétrocompatibilité."
#: ../Doc/library/wave.rst:57 #: ../Doc/library/wave.rst:57
msgid "" msgid ""
"An error raised when something is impossible because it violates the WAV " "An error raised when something is impossible because it violates the WAV "
"specification or hits an implementation deficiency." "specification or hits an implementation deficiency."
msgstr "" msgstr ""
"Une erreur est levée lorsque quelque chose est impossible car elle enfreint "
"la spécification WAV ou rencontre un problème d'implémentation."
#: ../Doc/library/wave.rst:64 #: ../Doc/library/wave.rst:64
msgid "Wave_read Objects" msgid "Wave_read Objects"
msgstr "" msgstr "Objets Wave_read"
#: ../Doc/library/wave.rst:66 #: ../Doc/library/wave.rst:66
msgid "" msgid ""
"Wave_read objects, as returned by :func:`.open`, have the following methods:" "Wave_read objects, as returned by :func:`.open`, have the following methods:"
msgstr "" msgstr ""
"Les objets Wave_read, tels qu'ils sont renvoyés par :func:`.open`, ont les "
"méthodes suivantes :"
#: ../Doc/library/wave.rst:71 #: ../Doc/library/wave.rst:71
msgid "" msgid ""
"Close the stream if it was opened by :mod:`wave`, and make the instance " "Close the stream if it was opened by :mod:`wave`, and make the instance "
"unusable. This is called automatically on object collection." "unusable. This is called automatically on object collection."
msgstr "" msgstr ""
"Ferme le flux s'il a été ouvert par :mod:`wave` et rend l'instance "
"inutilisable. Ceci est appelé automatiquement lorsque l'objet est détruit ."
#: ../Doc/library/wave.rst:77 #: ../Doc/library/wave.rst:77
msgid "Returns number of audio channels (``1`` for mono, ``2`` for stereo)." msgid "Returns number of audio channels (``1`` for mono, ``2`` for stereo)."
msgstr "" msgstr ""
"Renvoie le nombre de canaux audio (``1`` pour mono, ``2`` pour stéréo)."
#: ../Doc/library/wave.rst:82 #: ../Doc/library/wave.rst:82
msgid "Returns sample width in bytes." msgid "Returns sample width in bytes."
msgstr "" msgstr "Renvoie la largeur de l'échantillon en octets."
#: ../Doc/library/wave.rst:87 #: ../Doc/library/wave.rst:87
msgid "Returns sampling frequency." msgid "Returns sampling frequency."
msgstr "" msgstr "Renvoie la fréquence d'échantillonnage."
#: ../Doc/library/wave.rst:92 #: ../Doc/library/wave.rst:92
msgid "Returns number of audio frames." msgid "Returns number of audio frames."
msgstr "" msgstr "Renvoie le nombre de trames audio."
#: ../Doc/library/wave.rst:97 #: ../Doc/library/wave.rst:97
msgid "Returns compression type (``'NONE'`` is the only supported type)." msgid "Returns compression type (``'NONE'`` is the only supported type)."
msgstr "" msgstr "Renvoie le type de compression (``'NONE'`` est le seul type géré)."
#: ../Doc/library/wave.rst:102 #: ../Doc/library/wave.rst:102
msgid "" msgid ""
"Human-readable version of :meth:`getcomptype`. Usually ``'not compressed'`` " "Human-readable version of :meth:`getcomptype`. Usually ``'not compressed'`` "
"parallels ``'NONE'``." "parallels ``'NONE'``."
msgstr "" msgstr ""
"Version compréhensible de :meth:`getcomptype`. Généralement, ``'not "
"compressed'`` équivaut à ``'NONE'``."
#: ../Doc/library/wave.rst:108 #: ../Doc/library/wave.rst:108
msgid "" msgid ""
@ -145,47 +168,57 @@ msgid ""
"framerate, nframes, comptype, compname)``, equivalent to output of the :meth:" "framerate, nframes, comptype, compname)``, equivalent to output of the :meth:"
"`get\\*` methods." "`get\\*` methods."
msgstr "" msgstr ""
"Renvoie une :func:`~collections.namedtuple` ``(nchannels, sampwidth, "
"framerate, nframes, comptype, compname)``, équivalent à la sortie des "
"méthodes :meth:`get\\*`."
#: ../Doc/library/wave.rst:115 #: ../Doc/library/wave.rst:115
msgid "" msgid ""
"Reads and returns at most *n* frames of audio, as a :class:`bytes` object." "Reads and returns at most *n* frames of audio, as a :class:`bytes` object."
msgstr "" msgstr ""
"Lit et renvoie au plus *n* trames audio, sous forme d'objet :class:`bytes`."
#: ../Doc/library/wave.rst:120 #: ../Doc/library/wave.rst:120
msgid "Rewind the file pointer to the beginning of the audio stream." msgid "Rewind the file pointer to the beginning of the audio stream."
msgstr "" msgstr "Remet le pointeur de fichier au début du flux audio."
#: ../Doc/library/wave.rst:122 #: ../Doc/library/wave.rst:122
msgid "" msgid ""
"The following two methods are defined for compatibility with the :mod:`aifc` " "The following two methods are defined for compatibility with the :mod:`aifc` "
"module, and don't do anything interesting." "module, and don't do anything interesting."
msgstr "" msgstr ""
"Les deux méthodes suivantes sont définies pour la compatibilité avec le "
"module :mod:`aifc` ; elles ne font rien dintéressant."
#: ../Doc/library/wave.rst:128 #: ../Doc/library/wave.rst:128
msgid "Returns ``None``." msgid "Returns ``None``."
msgstr "" msgstr "Renvoie ``None``."
#: ../Doc/library/wave.rst:133 #: ../Doc/library/wave.rst:133
msgid "Raise an error." msgid "Raise an error."
msgstr "" msgstr "Lève une erreur."
#: ../Doc/library/wave.rst:135 #: ../Doc/library/wave.rst:135
msgid "" msgid ""
"The following two methods define a term \"position\" which is compatible " "The following two methods define a term \"position\" which is compatible "
"between them, and is otherwise implementation dependent." "between them, and is otherwise implementation dependent."
msgstr "" msgstr ""
"Les deux fonctions suivantes utilisent le vocabulaire \"position\". Ces "
"positions sont compatible entre elles, la \"position\" de l'un est "
"compatible avec la \"position\" de l'autre. Cette position est dépendante de "
"l'implémentation."
#: ../Doc/library/wave.rst:141 #: ../Doc/library/wave.rst:141
msgid "Set the file pointer to the specified position." msgid "Set the file pointer to the specified position."
msgstr "" msgstr "Place le pointeur du fichier sur la position spécifiée."
#: ../Doc/library/wave.rst:146 #: ../Doc/library/wave.rst:146
msgid "Return current file pointer position." msgid "Return current file pointer position."
msgstr "" msgstr "Renvoie la position actuelle du pointeur du fichier."
#: ../Doc/library/wave.rst:152 #: ../Doc/library/wave.rst:152
msgid "Wave_write Objects" msgid "Wave_write Objects"
msgstr "" msgstr "Objets Wave_write"
#: ../Doc/library/wave.rst:154 #: ../Doc/library/wave.rst:154
msgid "" msgid ""
@ -201,11 +234,25 @@ msgid ""
"calculate the number of frames in the data and set *nframes* accordingly " "calculate the number of frames in the data and set *nframes* accordingly "
"before writing the frame data." "before writing the frame data."
msgstr "" msgstr ""
"Pour les flux de sortie navigables, l'en-tête ``wave`` est automatiquement "
"mis à jour pour refléter le nombre de trames réellement écrites. Pour les "
"flux non indexables, la valeur *nframes* doit être précise lorsque la "
"première trame est écrite. Une valeur précise de *nframes* peut être obtenue "
"en appelant les méthodes :meth:`~Wave_write.setnframes` ou :meth:"
"`~Wave_write.setparams` en passant en paramètre le nombre de trames qui "
"seront écrites avant que :meth:`~Wave_write.close` soit appelé puis en "
"utilisant la méthode :meth:`~Wave_write.writeframesraw` pour écrire les "
"trames audio, ou en appelant la méthode :meth:`~Wave_write.writeframes` avec "
"toutes les trames audio. Dans ce dernier cas, la méthode :meth:`~Wave_write."
"writeframes` calcule le nombre de trames dans le flux audio et définit "
"*nframes* en conséquence avant d'écrire les données des trames."
#: ../Doc/library/wave.rst:166 #: ../Doc/library/wave.rst:166
msgid "" msgid ""
"Wave_write objects, as returned by :func:`.open`, have the following methods:" "Wave_write objects, as returned by :func:`.open`, have the following methods:"
msgstr "" msgstr ""
"Les objets Wave_write, tels qu'ils sont renvoyés par :func:`.open`, ont les "
"méthodes suivantes :"
#: ../Doc/library/wave.rst:174 #: ../Doc/library/wave.rst:174
msgid "" msgid ""
@ -214,22 +261,28 @@ msgid ""
"exception if the output stream is not seekable and *nframes* does not match " "exception if the output stream is not seekable and *nframes* does not match "
"the number of frames actually written." "the number of frames actually written."
msgstr "" msgstr ""
"Assurez-vous que *nframes* soit correct et fermez le fichier s'il a été "
"ouvert par :mod:`wave`. Cette méthode est appelée à la destruction de "
"l'objet. Il lève une erreur si le flux de sortie n'est pas navigable et si "
"*nframes* ne correspond pas au nombre de trames réellement écrites."
#: ../Doc/library/wave.rst:182 #: ../Doc/library/wave.rst:182
msgid "Set the number of channels." msgid "Set the number of channels."
msgstr "" msgstr "Définit le nombre de canaux."
#: ../Doc/library/wave.rst:187 #: ../Doc/library/wave.rst:187
msgid "Set the sample width to *n* bytes." msgid "Set the sample width to *n* bytes."
msgstr "" msgstr "Définit la largeur de l'échantillon à *n* octets."
#: ../Doc/library/wave.rst:192 #: ../Doc/library/wave.rst:192
msgid "Set the frame rate to *n*." msgid "Set the frame rate to *n*."
msgstr "" msgstr "Définit la fréquence des trames à *n*."
#: ../Doc/library/wave.rst:194 #: ../Doc/library/wave.rst:194
msgid "A non-integral input to this method is rounded to the nearest integer." msgid "A non-integral input to this method is rounded to the nearest integer."
msgstr "" msgstr ""
"Un paramètre non-entier passé à cette méthode est arrondi à l'entier le plus "
"proche."
#: ../Doc/library/wave.rst:201 #: ../Doc/library/wave.rst:201
msgid "" msgid ""
@ -237,12 +290,17 @@ msgid ""
"of frames actually written is different (this update attempt will raise an " "of frames actually written is different (this update attempt will raise an "
"error if the output stream is not seekable)." "error if the output stream is not seekable)."
msgstr "" msgstr ""
"Définit le nombre de trames à *n*. Cela sera modifié ultérieurement si le "
"nombre de trames réellement écrites est différent (la tentative de mise à "
"jour générera une erreur si le flux de sortie n'est pas indexable)."
#: ../Doc/library/wave.rst:208 #: ../Doc/library/wave.rst:208
msgid "" msgid ""
"Set the compression type and description. At the moment, only compression " "Set the compression type and description. At the moment, only compression "
"type ``NONE`` is supported, meaning no compression." "type ``NONE`` is supported, meaning no compression."
msgstr "" msgstr ""
"Définit le type de compression et la description. Pour le moment, seul le "
"type de compression ``NONE`` est géré, c'est-à-dire aucune compression."
#: ../Doc/library/wave.rst:214 #: ../Doc/library/wave.rst:214
msgid "" msgid ""
@ -250,16 +308,21 @@ msgid ""
"compname)``, with values valid for the :meth:`set\\*` methods. Sets all " "compname)``, with values valid for the :meth:`set\\*` methods. Sets all "
"parameters." "parameters."
msgstr "" msgstr ""
"Le *tuple* doit être ``(nchannels, sampwidth, framerate, nframes, comptype, "
"compname)``, avec des valeurs valides pour les méthodes :meth:`set\\*`. Tous "
"les paramètres sont obligatoires et doivent être définis."
#: ../Doc/library/wave.rst:221 #: ../Doc/library/wave.rst:221
msgid "" msgid ""
"Return current position in the file, with the same disclaimer for the :meth:" "Return current position in the file, with the same disclaimer for the :meth:"
"`Wave_read.tell` and :meth:`Wave_read.setpos` methods." "`Wave_read.tell` and :meth:`Wave_read.setpos` methods."
msgstr "" msgstr ""
"Renvoie la position actuelle dans le fichier, avec les mêmes réserves que "
"pour les méthodes :meth:`Wave_read.tell` et :meth:`Wave_read.setpos`."
#: ../Doc/library/wave.rst:227 #: ../Doc/library/wave.rst:227
msgid "Write audio frames, without correcting *nframes*." msgid "Write audio frames, without correcting *nframes*."
msgstr "" msgstr "Écrit les trames audio sans corriger *nframes*."
#: ../Doc/library/wave.rst:229 ../Doc/library/wave.rst:240 #: ../Doc/library/wave.rst:229 ../Doc/library/wave.rst:240
msgid "Any :term:`bytes-like object` is now accepted." msgid "Any :term:`bytes-like object` is now accepted."
@ -272,6 +335,10 @@ msgid ""
"that have been written after *data* has been written does not match the " "that have been written after *data* has been written does not match the "
"previously set value for *nframes*." "previously set value for *nframes*."
msgstr "" msgstr ""
"Écrit des trames audio et s'assure que *nframes* est correct. Une erreur est "
"levée si le flux de sortie est non-navigable et si le nombre total de trames "
"écrites après que *data* soit écrit ne correspond pas à la valeur "
"précédemment définie pour *nframes*."
#: ../Doc/library/wave.rst:244 #: ../Doc/library/wave.rst:244
msgid "" msgid ""
@ -279,3 +346,6 @@ msgid ""
"`writeframes` or :meth:`writeframesraw`, and any attempt to do so will " "`writeframes` or :meth:`writeframesraw`, and any attempt to do so will "
"raise :exc:`wave.Error`." "raise :exc:`wave.Error`."
msgstr "" msgstr ""
"Notez qu'il est impossible de définir des paramètres après avoir appelé :"
"meth:`writeframes` ou :meth:`writeframesraw`, et toute tentative en ce sens "
"lève une :exc:`wave.Error`."

View File

@ -31,10 +31,15 @@ msgid ""
"<using-on-interface-options>`. The module provides both a :ref:`zipapp-" "<using-on-interface-options>`. The module provides both a :ref:`zipapp-"
"command-line-interface` and a :ref:`zipapp-python-api`." "command-line-interface` and a :ref:`zipapp-python-api`."
msgstr "" msgstr ""
"Ce module fournit des outils pour gérer la création de fichiers zip "
"contenant du code Python, qui peuvent être :ref:`exécutés directement par "
"l'interpréteur Python <using-on-interface-options>`. Le module fournit à la "
"fois une interface de ligne de commande :ref:`zipapp-command-line-interface` "
"et une interface :ref:`zipapp-python-api`."
#: ../Doc/library/zipapp.rst:23 #: ../Doc/library/zipapp.rst:23
msgid "Basic Example" msgid "Basic Example"
msgstr "" msgstr "Exemple de base"
#: ../Doc/library/zipapp.rst:25 #: ../Doc/library/zipapp.rst:25
msgid "" msgid ""
@ -43,6 +48,11 @@ msgid ""
"code. When run, the archive will execute the ``main`` function from the " "code. When run, the archive will execute the ``main`` function from the "
"module ``myapp`` in the archive." "module ``myapp`` in the archive."
msgstr "" msgstr ""
"L'exemple suivant montre comment l'interface de ligne de commande :ref:"
"`zipapp-command-line-interface` peut être utilisée pour créer une archive "
"exécutable depuis un répertoire contenant du code Python. Lors de "
"l'exécution, l'archive exécutera la fonction ``main`` du module ``myapp`` "
"dans l'archive."
#: ../Doc/library/zipapp.rst:40 #: ../Doc/library/zipapp.rst:40
msgid "Command-Line Interface" msgid "Command-Line Interface"
@ -52,6 +62,8 @@ msgstr "Interface en ligne de commande"
msgid "" msgid ""
"When called as a program from the command line, the following form is used:" "When called as a program from the command line, the following form is used:"
msgstr "" msgstr ""
"Lorsqu'il est appelé en tant que programme à partir de la ligne de commande, "
"la syntaxe suivante est utilisée :"
#: ../Doc/library/zipapp.rst:48 #: ../Doc/library/zipapp.rst:48
msgid "" msgid ""
@ -60,10 +72,14 @@ msgid ""
"copied to the target archive (or the contents of its shebang line will be " "copied to the target archive (or the contents of its shebang line will be "
"displayed if the --info option is specified)." "displayed if the --info option is specified)."
msgstr "" msgstr ""
"Si *source* est un répertoire, une archive est créée à partir du contenu de "
"*source*. Si *source* est un fichier, ce doit être une archive et il est "
"copié dans l'archive cible (ou le contenu de sa ligne `shebang` est affiché "
"si l'option ``--info`` est indiquée)."
#: ../Doc/library/zipapp.rst:53 #: ../Doc/library/zipapp.rst:53
msgid "The following options are understood:" msgid "The following options are understood:"
msgstr "" msgstr "Les options suivantes sont disponibles :"
#: ../Doc/library/zipapp.rst:59 #: ../Doc/library/zipapp.rst:59
msgid "" msgid ""
@ -72,12 +88,20 @@ msgid ""
"extension ``.pyz`` added. If an explicit filename is given, it is used as " "extension ``.pyz`` added. If an explicit filename is given, it is used as "
"is (so a ``.pyz`` extension should be included if required)." "is (so a ``.pyz`` extension should be included if required)."
msgstr "" msgstr ""
"Écrit la sortie dans un fichier nommé *output*. Si cette option n'est pas "
"spécifiée, le nom du fichier de sortie sera le même que celui de l'entrée "
"*source*, avec l'extension ``.pyz``. Si un nom de fichier explicite est "
"donné, il est utilisé tel quel (une extension ``.pyz`` doit donc être "
"incluse si nécessaire)."
#: ../Doc/library/zipapp.rst:64 #: ../Doc/library/zipapp.rst:64
msgid "" msgid ""
"An output filename must be specified if the *source* is an archive (and in " "An output filename must be specified if the *source* is an archive (and in "
"that case, *output* must not be the same as *source*)." "that case, *output* must not be the same as *source*)."
msgstr "" msgstr ""
"Un nom de fichier de sortie doit être spécifié si la *source* est une "
"archive (et, dans ce cas, la *sortie* ne doit pas être la même que la "
"*source*)."
#: ../Doc/library/zipapp.rst:69 #: ../Doc/library/zipapp.rst:69
msgid "" msgid ""
@ -85,6 +109,10 @@ msgid ""
"run. Also, on POSIX, make the archive executable. The default is to write " "run. Also, on POSIX, make the archive executable. The default is to write "
"no ``#!`` line, and not make the file executable." "no ``#!`` line, and not make the file executable."
msgstr "" msgstr ""
"Ajoute une ligne ``#!`` à l'archive en spécifiant *interpreter* comme "
"commande à exécuter. Aussi, sur un système POSIX, cela rend l'archive "
"exécutable. Le comportement par défaut est de ne pas écrire la ligne ``#!`` "
"et de ne pas rendre le fichier exécutable."
#: ../Doc/library/zipapp.rst:75 #: ../Doc/library/zipapp.rst:75
msgid "" msgid ""
@ -93,10 +121,15 @@ msgid ""
"a package/module in the archive, and \"fn\" is a callable in the given " "a package/module in the archive, and \"fn\" is a callable in the given "
"module. The ``__main__.py`` file will execute that callable." "module. The ``__main__.py`` file will execute that callable."
msgstr "" msgstr ""
"Écrit un fichier ``__main__.py`` dans l'archive qui exécute *mainfn*. "
"L'argument *mainfn* est de la forme « *pkg.mod:fn* », où « *pkg.mod* » est "
"un paquet/module dans l'archive, et « *fn* » est un appelable dans le module "
"donné. Le fichier ``__main__.py`` réalise cet appel."
#: ../Doc/library/zipapp.rst:80 #: ../Doc/library/zipapp.rst:80
msgid ":option:`--main` cannot be specified when copying an archive." msgid ":option:`--main` cannot be specified when copying an archive."
msgstr "" msgstr ""
":option:`--main` ne peut pas être spécifié lors de la copie d'une archive."
#: ../Doc/library/zipapp.rst:84 #: ../Doc/library/zipapp.rst:84
msgid "" msgid ""
@ -104,10 +137,13 @@ msgid ""
"In this case, any other options are ignored and SOURCE must be an archive, " "In this case, any other options are ignored and SOURCE must be an archive, "
"not a directory." "not a directory."
msgstr "" msgstr ""
"Affiche l'interpréteur intégré dans l'archive, à des fins de diagnostic. "
"Dans ce cas, toutes les autres options sont ignorées et SOURCE doit être une "
"archive et non un répertoire."
#: ../Doc/library/zipapp.rst:90 #: ../Doc/library/zipapp.rst:90
msgid "Print a short usage message and exit." msgid "Print a short usage message and exit."
msgstr "" msgstr "Affiche un court message d'aide et quitte."
#: ../Doc/library/zipapp.rst:96 #: ../Doc/library/zipapp.rst:96
msgid "Python API" msgid "Python API"
@ -115,13 +151,15 @@ msgstr "API Python"
#: ../Doc/library/zipapp.rst:98 #: ../Doc/library/zipapp.rst:98
msgid "The module defines two convenience functions:" msgid "The module defines two convenience functions:"
msgstr "" msgstr "Ce module définit deux fonctions utilitaires :"
#: ../Doc/library/zipapp.rst:103 #: ../Doc/library/zipapp.rst:103
msgid "" msgid ""
"Create an application archive from *source*. The source can be any of the " "Create an application archive from *source*. The source can be any of the "
"following:" "following:"
msgstr "" msgstr ""
"Crée une archive d'application à partir de *source*. La source peut être de "
"natures suivantes :"
#: ../Doc/library/zipapp.rst:106 #: ../Doc/library/zipapp.rst:106
msgid "" msgid ""
@ -144,11 +182,14 @@ msgid ""
"should be an application archive, and the file object is assumed to be " "should be an application archive, and the file object is assumed to be "
"positioned at the start of the archive." "positioned at the start of the archive."
msgstr "" msgstr ""
"Un objet fichier ouvert pour la lecture en mode binaire. Le contenu du "
"fichier doit être une archive d'application et Python suppose que l'objet "
"fichier est positionné au début de l'archive."
#: ../Doc/library/zipapp.rst:117 #: ../Doc/library/zipapp.rst:117
msgid "" msgid ""
"The *target* argument determines where the resulting archive will be written:" "The *target* argument determines where the resulting archive will be written:"
msgstr "" msgstr "L'argument *target* détermine où l'archive résultante sera écrite :"
#: ../Doc/library/zipapp.rst:120 #: ../Doc/library/zipapp.rst:120
msgid "" msgid ""
@ -161,6 +202,8 @@ msgid ""
"If it is an open file object, the archive will be written to that file " "If it is an open file object, the archive will be written to that file "
"object, which must be open for writing in bytes mode." "object, which must be open for writing in bytes mode."
msgstr "" msgstr ""
"S'il s'agit d'un objet fichier ouvert, l'archive sera écrite dans cet objet "
"fichier, qui doit être ouvert pour l'écriture en mode octets."
#: ../Doc/library/zipapp.rst:124 #: ../Doc/library/zipapp.rst:124
msgid "" msgid ""
@ -168,6 +211,9 @@ msgid ""
"the target will be a file with the same name as the source, with a ``.pyz`` " "the target will be a file with the same name as the source, with a ``.pyz`` "
"extension added." "extension added."
msgstr "" msgstr ""
"Si la cible est omise (ou ``None``), la source doit être un répertoire et la "
"cible sera un fichier portant le même nom que la source, avec une extension "
"``.pyz`` ajoutée."
#: ../Doc/library/zipapp.rst:128 #: ../Doc/library/zipapp.rst:128
msgid "" msgid ""
@ -179,6 +225,13 @@ msgid ""
"is specified, and the target is a filename, the executable bit of the target " "is specified, and the target is a filename, the executable bit of the target "
"file will be set." "file will be set."
msgstr "" msgstr ""
"L'argument *interpreter* spécifie le nom de l'interpréteur Python avec "
"lequel l'archive sera exécutée. Il est écrit dans une ligne *shebang* au "
"début de l'archive. Sur un système POSIX, cela est interprété par le "
"système d'exploitation et, sur Windows, il sera géré par le lanceur Python. "
"L'omission de l'*interpreter* n'entraîne pas l'écriture d'une ligne "
"*shebang*. Si un interpréteur est spécifié et que la cible est un nom de "
"fichier, le bit exécutable du fichier cible sera mis à 1."
#: ../Doc/library/zipapp.rst:136 #: ../Doc/library/zipapp.rst:136
msgid "" msgid ""
@ -191,12 +244,23 @@ msgid ""
"a directory and does not contain a ``__main__.py`` file, as otherwise the " "a directory and does not contain a ``__main__.py`` file, as otherwise the "
"resulting archive would not be executable." "resulting archive would not be executable."
msgstr "" msgstr ""
"L'argument *main* spécifie le nom d'un appelable, utilisé comme programme "
"principal pour l'archive. Il ne peut être spécifié que si la source est un "
"répertoire et si la source ne contient pas déjà un fichier ``__main__.py``. "
"L'argument *main* doit prendre la forme ``pkg.module:callable`` et l'archive "
"sera exécutée en important ``pkg.module`` et en exécutant l'appelable donné "
"sans argument. Omettre *main* est une erreur si la source est un répertoire "
"et ne contient pas un fichier ``__main__.py`` car, dans ce cas, l'archive "
"résultante ne serait pas exécutable."
#: ../Doc/library/zipapp.rst:146 #: ../Doc/library/zipapp.rst:146
msgid "" msgid ""
"If a file object is specified for *source* or *target*, it is the caller's " "If a file object is specified for *source* or *target*, it is the caller's "
"responsibility to close it after calling create_archive." "responsibility to close it after calling create_archive."
msgstr "" msgstr ""
"Si un objet fichier est spécifié pour *source* ou *target*, il est de la "
"responsabilité de l'appelant de le fermer après avoir appelé "
"``create_archive``."
#: ../Doc/library/zipapp.rst:149 #: ../Doc/library/zipapp.rst:149
msgid "" msgid ""
@ -205,6 +269,11 @@ msgid ""
"directory, if the target is a file object it will be passed to the ``zipfile." "directory, if the target is a file object it will be passed to the ``zipfile."
"ZipFile`` class, and must supply the methods needed by that class." "ZipFile`` class, and must supply the methods needed by that class."
msgstr "" msgstr ""
"Lors de la copie d'une archive existante, les objets fichier fournis n'ont "
"besoin que des méthodes ``read`` et ``readline`` ou ``write``. Lors de la "
"création d'une archive à partir d'un répertoire, si la cible est un objet "
"fichier, elle sera passée à la classe ``zipfile.ZipFile`` et devra fournir "
"les méthodes nécessaires à cette classe."
#: ../Doc/library/zipapp.rst:157 #: ../Doc/library/zipapp.rst:157
msgid "" msgid ""
@ -213,6 +282,10 @@ msgid ""
"argument can be a filename or a file-like object open for reading in bytes " "argument can be a filename or a file-like object open for reading in bytes "
"mode. It is assumed to be at the start of the archive." "mode. It is assumed to be at the start of the archive."
msgstr "" msgstr ""
"Renvoie l'interpréteur spécifié dans la ligne ``#!`` au début de l'archive. "
"S'il n'y a pas de ligne ``#!``, renvoie :const:`None`. L'argument *archive* "
"peut être un nom de fichier ou un objet de type fichier ouvert à la lecture "
"en mode binaire. Python suppose qu'il est au début de l'archive."
#: ../Doc/library/zipapp.rst:166 #: ../Doc/library/zipapp.rst:166
msgid "Examples" msgid "Examples"
@ -220,7 +293,7 @@ msgstr "Exemples"
#: ../Doc/library/zipapp.rst:168 #: ../Doc/library/zipapp.rst:168
msgid "Pack up a directory into an archive, and run it." msgid "Pack up a directory into an archive, and run it."
msgstr "" msgstr "Regroupe le contenu d'un répertoire dans une archive, puis l'exécute."
#: ../Doc/library/zipapp.rst:176 #: ../Doc/library/zipapp.rst:176
msgid "The same can be done using the :func:`create_archive` functon::" msgid "The same can be done using the :func:`create_archive` functon::"
@ -231,12 +304,16 @@ msgid ""
"To make the application directly executable on POSIX, specify an interpreter " "To make the application directly executable on POSIX, specify an interpreter "
"to use." "to use."
msgstr "" msgstr ""
"Pour rendre l'application directement exécutable sur un système POSIX, "
"spécifiez un interpréteur à utiliser."
#: ../Doc/library/zipapp.rst:190 #: ../Doc/library/zipapp.rst:190
msgid "" msgid ""
"To replace the shebang line on an existing archive, create a modified " "To replace the shebang line on an existing archive, create a modified "
"archive using the :func:`create_archive` function::" "archive using the :func:`create_archive` function::"
msgstr "" msgstr ""
"Pour remplacer la ligne *shebang* sur une archive existante, créez une "
"archive modifiée en utilisant la fonction :func:`create_archive` : ::"
#: ../Doc/library/zipapp.rst:196 #: ../Doc/library/zipapp.rst:196
msgid "" msgid ""
@ -247,6 +324,13 @@ msgid ""
"but production code should do so. Also, this method will only work if the " "but production code should do so. Also, this method will only work if the "
"archive fits in memory::" "archive fits in memory::"
msgstr "" msgstr ""
"Pour mettre à jour le fichier sans créer de copie locale, effectuez le "
"remplacement en mémoire à l'aide d'un objet :class:`BytesIO`, puis écrasez "
"la source par la suite. Notez qu'il y a un risque lors de l'écrasement d'un "
"fichier local qu'une erreur entraîne la perte du fichier original. Ce code "
"ne protège pas contre de telles erreurs, assurez-vous de prendre les mesures "
"nécessaires en production. De plus, cette méthode ne fonctionnera que si "
"l'archive tient en mémoire : ::"
#: ../Doc/library/zipapp.rst:210 #: ../Doc/library/zipapp.rst:210
msgid "" msgid ""
@ -255,6 +339,11 @@ msgid ""
"Python launcher for Windows supports most common forms of POSIX ``#!`` line, " "Python launcher for Windows supports most common forms of POSIX ``#!`` line, "
"but there are other issues to consider:" "but there are other issues to consider:"
msgstr "" msgstr ""
"Notez que si vous spécifiez un interpréteur et que vous distribuez ensuite "
"votre archive d'application, vous devez vous assurer que l'interpréteur "
"utilisé est portable. Le lanceur Python pour Windows gère la plupart des "
"formes courantes de la ligne POSIX ``#!``, mais il y a d'autres problèmes à "
"considérer :"
#: ../Doc/library/zipapp.rst:215 #: ../Doc/library/zipapp.rst:215
msgid "" msgid ""
@ -263,6 +352,10 @@ msgid ""
"may have either Python 2 or Python 3 as their default, and write your code " "may have either Python 2 or Python 3 as their default, and write your code "
"to work under both versions." "to work under both versions."
msgstr "" msgstr ""
"Si vous utilisez ``/usr/bin/env python`` (ou d'autres formes de la commande "
"*python*, comme ``/usr/bin/python``), vous devez considérer que vos "
"utilisateurs peuvent avoir Python 2 ou Python 3 par défaut, et écrire votre "
"code pour fonctionner dans les deux versions."
#: ../Doc/library/zipapp.rst:219 #: ../Doc/library/zipapp.rst:219
msgid "" msgid ""
@ -270,6 +363,10 @@ msgid ""
"application will not work for users who do not have that version. (This may " "application will not work for users who do not have that version. (This may "
"be what you want if you have not made your code Python 2 compatible)." "be what you want if you have not made your code Python 2 compatible)."
msgstr "" msgstr ""
"Si vous utilisez une version explicite, par exemple ``/usr/bin/env python3`` "
"votre application ne fonctionnera pas pour les utilisateurs qui n'ont pas "
"cette version. (C'est peut-être ce que vous voulez si vous n'avez pas rendu "
"votre code compatible Python 2)."
#: ../Doc/library/zipapp.rst:222 #: ../Doc/library/zipapp.rst:222
msgid "" msgid ""
@ -277,10 +374,14 @@ msgid ""
"exact version like \"/usr/bin/env python3.4\" as you will need to change " "exact version like \"/usr/bin/env python3.4\" as you will need to change "
"your shebang line for users of Python 3.5, for example." "your shebang line for users of Python 3.5, for example."
msgstr "" msgstr ""
"Il n'y a aucun moyen de dire « python X.Y ou supérieur » donc faites "
"attention si vous utilisez une version exacte comme ``/usr/bin/env "
"python3.4`` car vous devrez changer votre ligne *shebang* pour les "
"utilisateurs de Python 3.5, par exemple."
#: ../Doc/library/zipapp.rst:227 #: ../Doc/library/zipapp.rst:227
msgid "The Python Zip Application Archive Format" msgid "The Python Zip Application Archive Format"
msgstr "" msgstr "Le format d'archive d'application Zip Python"
#: ../Doc/library/zipapp.rst:229 #: ../Doc/library/zipapp.rst:229
msgid "" msgid ""
@ -292,6 +393,13 @@ msgid ""
"be placed on :data:`sys.path` and thus further modules can be imported from " "be placed on :data:`sys.path` and thus further modules can be imported from "
"the zip file." "the zip file."
msgstr "" msgstr ""
"Python est capable d'exécuter des fichiers zip qui contiennent un fichier "
"``__main__.py`` depuis la version 2.6. Pour être exécutée par Python, une "
"archive d'application doit simplement être un fichier zip standard contenant "
"un fichier ``__main__.py`` qui sera exécuté comme point d'entrée de "
"l'application. Comme d'habitude pour tout script Python, le parent du "
"script (dans ce cas le fichier zip) sera placé sur :data:`sys.path` et ainsi "
"d'autres modules pourront être importés depuis le fichier zip."
#: ../Doc/library/zipapp.rst:236 #: ../Doc/library/zipapp.rst:236
msgid "" msgid ""
@ -299,10 +407,14 @@ msgid ""
"The zip application format uses this ability to prepend a standard POSIX " "The zip application format uses this ability to prepend a standard POSIX "
"\"shebang\" line to the file (``#!/path/to/interpreter``)." "\"shebang\" line to the file (``#!/path/to/interpreter``)."
msgstr "" msgstr ""
"Le format de fichier zip permet d'ajouter des données arbitraires à un "
"fichier zip. Le format de l'application zip utilise cette possibilité pour "
"préfixer une ligne *shebang* POSIX standard dans le fichier (``#!/path/to/"
"interpreter``)."
#: ../Doc/library/zipapp.rst:240 #: ../Doc/library/zipapp.rst:240
msgid "Formally, the Python zip application format is therefore:" msgid "Formally, the Python zip application format is therefore:"
msgstr "" msgstr "Formellement, le format d'application zip de Python est donc :"
#: ../Doc/library/zipapp.rst:242 #: ../Doc/library/zipapp.rst:242
msgid "" msgid ""
@ -313,6 +425,12 @@ msgid ""
"encoded in UTF-8 on Windows, and in :func:`sys.getfilesystemencoding()` on " "encoded in UTF-8 on Windows, and in :func:`sys.getfilesystemencoding()` on "
"POSIX." "POSIX."
msgstr "" msgstr ""
"Une ligne *shebang* facultative, contenant les caractères ``b'#!`` suivis "
"d'un nom dinterpréteur, puis un caractère fin de ligne (``b'\\n'``). Le "
"nom de l'interpréteur peut être n'importe quoi acceptable pour le traitement "
"*shebang* de l'OS, ou le lanceur Python sous Windows. L'interpréteur doit "
"être encodé en UTF-8 sous Windows, et en :func:`sys.getfilesystemencoding()` "
"sur POSIX."
#: ../Doc/library/zipapp.rst:247 #: ../Doc/library/zipapp.rst:247
msgid "" msgid ""
@ -321,12 +439,20 @@ msgid ""
"in the \"root\" of the zipfile - i.e., it cannot be in a subdirectory). The " "in the \"root\" of the zipfile - i.e., it cannot be in a subdirectory). The "
"zipfile data can be compressed or uncompressed." "zipfile data can be compressed or uncompressed."
msgstr "" msgstr ""
"Des données *zipfile* standards, telles que générées par le module :mod:"
"`zipfile`. Le contenu du fichier zip *doit* inclure un fichier appelé "
"``__main__.py`` (qui doit se trouver à la racine du fichier zip — c'est-à-"
"dire qu'il ne peut se trouver dans un sous-répertoire). Les données du "
"fichier zip peuvent être compressées ou non."
#: ../Doc/library/zipapp.rst:252 #: ../Doc/library/zipapp.rst:252
msgid "" msgid ""
"If an application archive has a shebang line, it may have the executable bit " "If an application archive has a shebang line, it may have the executable bit "
"set on POSIX systems, to allow it to be executed directly." "set on POSIX systems, to allow it to be executed directly."
msgstr "" msgstr ""
"Si une archive d'application a une ligne *shebang*, elle peut avoir le bit "
"exécutable activé sur les systèmes POSIX, pour lui permettre d'être exécutée "
"directement."
#: ../Doc/library/zipapp.rst:255 #: ../Doc/library/zipapp.rst:255
msgid "" msgid ""
@ -334,3 +460,7 @@ msgid ""
"application archives - the module is a convenience, but archives in the " "application archives - the module is a convenience, but archives in the "
"above format created by any means are acceptable to Python." "above format created by any means are acceptable to Python."
msgstr "" msgstr ""
"Vous pouvez créer des archives d'applications sans utiliser les outils de ce "
"module — le module existe pour faciliter les choses, mais les archives, "
"créées par n'importe quel moyen tout en respectant le format ci-dessus, sont "
"valides pour Python."

View File

@ -18,7 +18,7 @@ msgstr ""
#: ../Doc/library/zipimport.rst:2 #: ../Doc/library/zipimport.rst:2
msgid ":mod:`zipimport` --- Import modules from Zip archives" msgid ":mod:`zipimport` --- Import modules from Zip archives"
msgstr "" msgstr ":mod:`zipimport` — Importer des modules à partir d'archives Zip"
#: ../Doc/library/zipimport.rst:11 #: ../Doc/library/zipimport.rst:11
msgid "" msgid ""
@ -39,6 +39,14 @@ msgid ""
"lib/` would only import from the :file:`lib/` subdirectory within the " "lib/` would only import from the :file:`lib/` subdirectory within the "
"archive." "archive."
msgstr "" msgstr ""
"Typiquement, :data:`sys.path` est une liste de noms de répertoires sous "
"forme de chaînes. Ce module permet également à un élément de :data:`sys."
"path` d'être une chaîne nommant une archive de fichier ZIP. L'archive ZIP "
"peut contenir une structure de sous-répertoire pour prendre en charge les "
"importations de paquets, et un chemin dans l'archive peut être spécifié pour "
"importer uniquement à partir d'un sous-répertoire. Par exemple, le chemin "
"d'accès :file:`example.zip/lib/` importerait uniquement depuis le sous-"
"répertoire :file:`lib/` dans l'archive."
#: ../Doc/library/zipimport.rst:24 #: ../Doc/library/zipimport.rst:24
msgid "" msgid ""
@ -49,6 +57,13 @@ msgid ""
"the corresponding :file:`.pyc` file, meaning that if a ZIP archive doesn't " "the corresponding :file:`.pyc` file, meaning that if a ZIP archive doesn't "
"contain :file:`.pyc` files, importing may be rather slow." "contain :file:`.pyc` files, importing may be rather slow."
msgstr "" msgstr ""
"Tous les fichiers peuvent être présents dans l'archive ZIP, mais seuls les "
"fichiers :file:`.py` et :file:`.pyc` sont disponibles pour importation. "
"L'importation ZIP des modules dynamiques (:file:`.pyd`, :file:`.so`) est "
"interdite. Notez que si une archive ne contient que des fichiers :file:`."
"py` , Python n'essaiera pas de modifier l'archive en ajoutant le fichier "
"correspondant :file:`.pyc`, ce qui signifie que si une archive ZIP ne "
"contient pas de fichier: :file:`.pyc`, l'importation peut être assez lente."
#: ../Doc/library/zipimport.rst:31 #: ../Doc/library/zipimport.rst:31
msgid "ZIP archives with an archive comment are currently not supported." msgid "ZIP archives with an archive comment are currently not supported."
@ -59,6 +74,8 @@ msgid ""
"`PKZIP Application Note <https://pkware.cachefly.net/webdocs/casestudies/" "`PKZIP Application Note <https://pkware.cachefly.net/webdocs/casestudies/"
"APPNOTE.TXT>`_" "APPNOTE.TXT>`_"
msgstr "" msgstr ""
"`PKZIP Application Note <https://pkware.cachefly.net/webdocs/casestudies/"
"APPNOTE.TXT>`_"
#: ../Doc/library/zipimport.rst:36 #: ../Doc/library/zipimport.rst:36
msgid "" msgid ""
@ -70,7 +87,7 @@ msgstr ""
#: ../Doc/library/zipimport.rst:42 #: ../Doc/library/zipimport.rst:42
msgid ":pep:`273` - Import Modules from Zip Archives" msgid ":pep:`273` - Import Modules from Zip Archives"
msgstr "" msgstr ":pep:`273` - Import Modules from Zip Archives"
#: ../Doc/library/zipimport.rst:40 #: ../Doc/library/zipimport.rst:40
msgid "" msgid ""
@ -81,29 +98,33 @@ msgstr ""
#: ../Doc/library/zipimport.rst:44 #: ../Doc/library/zipimport.rst:44
msgid ":pep:`302` - New Import Hooks" msgid ":pep:`302` - New Import Hooks"
msgstr "" msgstr ":pep:`302` — Nouveaux crochets d'importation"
#: ../Doc/library/zipimport.rst:45 #: ../Doc/library/zipimport.rst:45
msgid "The PEP to add the import hooks that help this module work." msgid "The PEP to add the import hooks that help this module work."
msgstr "" msgstr ""
"Le PEP pour ajouter les crochets d'importation qui aident ce module à "
"fonctionner."
#: ../Doc/library/zipimport.rst:48 #: ../Doc/library/zipimport.rst:48
msgid "This module defines an exception:" msgid "This module defines an exception:"
msgstr "" msgstr "Ce module définit une exception :"
#: ../Doc/library/zipimport.rst:52 #: ../Doc/library/zipimport.rst:52
msgid "" msgid ""
"Exception raised by zipimporter objects. It's a subclass of :exc:" "Exception raised by zipimporter objects. It's a subclass of :exc:"
"`ImportError`, so it can be caught as :exc:`ImportError`, too." "`ImportError`, so it can be caught as :exc:`ImportError`, too."
msgstr "" msgstr ""
"Exception levée par les objets *zipimporter*. C'est une sous-classe de :exc:"
"`ImportError`, donc il peut être pris comme :exc:`ImportError`, aussi."
#: ../Doc/library/zipimport.rst:59 #: ../Doc/library/zipimport.rst:59
msgid "zipimporter Objects" msgid "zipimporter Objects"
msgstr "" msgstr "Objets *zimporter*"
#: ../Doc/library/zipimport.rst:61 #: ../Doc/library/zipimport.rst:61
msgid ":class:`zipimporter` is the class for importing ZIP files." msgid ":class:`zipimporter` is the class for importing ZIP files."
msgstr "" msgstr ":class:`zipimporter` est la classe pour importer des fichiers ZIP."
#: ../Doc/library/zipimport.rst:65 #: ../Doc/library/zipimport.rst:65
msgid "" msgid ""
@ -113,12 +134,19 @@ msgid ""
"`lib` directory inside the ZIP file :file:`foo/bar.zip` (provided that it " "`lib` directory inside the ZIP file :file:`foo/bar.zip` (provided that it "
"exists)." "exists)."
msgstr "" msgstr ""
"Créez une nouvelle instance de `zipimporter`. *archivepath* doit être un "
"chemin vers un fichier ZIP, ou vers un chemin spécifique dans un fichier "
"ZIP. Par exemple, un *archivepath* de :file:`foo/bar.zip/lib` cherchera les "
"modules dans le répertoire :file:`lib` du fichier ZIP :file:`foo/bar.zip` "
"(si celui-ci existe)."
#: ../Doc/library/zipimport.rst:70 #: ../Doc/library/zipimport.rst:70
msgid "" msgid ""
":exc:`ZipImportError` is raised if *archivepath* doesn't point to a valid " ":exc:`ZipImportError` is raised if *archivepath* doesn't point to a valid "
"ZIP archive." "ZIP archive."
msgstr "" msgstr ""
":exc:`ZipImportError` est levée si *archivepath* ne pointe pas vers une "
"archive ZIP valide."
#: ../Doc/library/zipimport.rst:75 #: ../Doc/library/zipimport.rst:75
msgid "" msgid ""
@ -128,18 +156,27 @@ msgid ""
"argument is ignored---it's there for compatibility with the importer " "argument is ignored---it's there for compatibility with the importer "
"protocol." "protocol."
msgstr "" msgstr ""
"Rechercher un module spécifié par *fullname*. *fullname* doit être le nom du "
"module entièrement qualifié (`dotted`). Elle retourne l'instance "
"`zipimporter` elle-même si le module a été trouvé, ou :const:`None` si ce "
"n'est pas le cas. L'argument optionnel *path* est ignoré --- il est là pour "
"la compatibilité avec le protocole de l'importateur."
#: ../Doc/library/zipimport.rst:84 #: ../Doc/library/zipimport.rst:84
msgid "" msgid ""
"Return the code object for the specified module. Raise :exc:`ZipImportError` " "Return the code object for the specified module. Raise :exc:`ZipImportError` "
"if the module couldn't be found." "if the module couldn't be found."
msgstr "" msgstr ""
"Retourne l'objet de code pour le module spécifié. Lève :exc:`ZipImportError` "
"si le module n'a pas pu être trouvé."
#: ../Doc/library/zipimport.rst:90 #: ../Doc/library/zipimport.rst:90
msgid "" msgid ""
"Return the data associated with *pathname*. Raise :exc:`OSError` if the file " "Return the data associated with *pathname*. Raise :exc:`OSError` if the file "
"wasn't found." "wasn't found."
msgstr "" msgstr ""
"Renvoie les données associées à *pathname*. Lève :exc:`OSError` si le "
"fichier n'a pas été trouvé."
#: ../Doc/library/zipimport.rst:93 #: ../Doc/library/zipimport.rst:93
msgid ":exc:`IOError` used to be raised instead of :exc:`OSError`." msgid ":exc:`IOError` used to be raised instead of :exc:`OSError`."
@ -152,6 +189,9 @@ msgid ""
"Return the value ``__file__`` would be set to if the specified module was " "Return the value ``__file__`` would be set to if the specified module was "
"imported. Raise :exc:`ZipImportError` if the module couldn't be found." "imported. Raise :exc:`ZipImportError` if the module couldn't be found."
msgstr "" msgstr ""
"Renvoie la valeur ``__file____`` qui serait définie si le module spécifié "
"était importé. Lève :exc:`ZipImportError` si le module n'a pas pu être "
"trouvé."
#: ../Doc/library/zipimport.rst:108 #: ../Doc/library/zipimport.rst:108
msgid "" msgid ""
@ -159,12 +199,17 @@ msgid ""
"if the module couldn't be found, return :const:`None` if the archive does " "if the module couldn't be found, return :const:`None` if the archive does "
"contain the module, but has no source for it." "contain the module, but has no source for it."
msgstr "" msgstr ""
"Renvoie le code source du module spécifié. Lève :exc:`ZipImportError` si le "
"module n'a pas pu être trouvé, renvoie :const:`None` si l'archive contient "
"le module, mais n'en a pas la source."
#: ../Doc/library/zipimport.rst:116 #: ../Doc/library/zipimport.rst:116
msgid "" msgid ""
"Return ``True`` if the module specified by *fullname* is a package. Raise :" "Return ``True`` if the module specified by *fullname* is a package. Raise :"
"exc:`ZipImportError` if the module couldn't be found." "exc:`ZipImportError` if the module couldn't be found."
msgstr "" msgstr ""
"Renvoie ``True`` si le module spécifié par *fullname* est un paquet. Lève :"
"exc:`ZipImportError` si le module n'a pas pu être trouvé."
#: ../Doc/library/zipimport.rst:122 #: ../Doc/library/zipimport.rst:122
msgid "" msgid ""
@ -172,18 +217,26 @@ msgid ""
"qualified (dotted) module name. It returns the imported module, or raises :" "qualified (dotted) module name. It returns the imported module, or raises :"
"exc:`ZipImportError` if it wasn't found." "exc:`ZipImportError` if it wasn't found."
msgstr "" msgstr ""
"Charge le module spécifié par *fullname*. *fullname* doit être le nom du "
"module entièrement qualifié (`dotted`). Il renvoie le module importé, ou "
"augmente :exc:`ZipImportError` s'il n'a pas été trouvé."
#: ../Doc/library/zipimport.rst:129 #: ../Doc/library/zipimport.rst:129
msgid "" msgid ""
"The file name of the importer's associated ZIP file, without a possible " "The file name of the importer's associated ZIP file, without a possible "
"subpath." "subpath."
msgstr "" msgstr ""
"Le nom de fichier de l'archive ZIP associé à l'importateur, sans sous-chemin "
"possible."
#: ../Doc/library/zipimport.rst:135 #: ../Doc/library/zipimport.rst:135
msgid "" msgid ""
"The subpath within the ZIP file where modules are searched. This is the " "The subpath within the ZIP file where modules are searched. This is the "
"empty string for zipimporter objects which point to the root of the ZIP file." "empty string for zipimporter objects which point to the root of the ZIP file."
msgstr "" msgstr ""
"Le sous-chemin du fichier ZIP où les modules sont recherchés. C'est la "
"chaîne vide pour les objets `zipimporter` qui pointent vers la racine du "
"fichier ZIP."
#: ../Doc/library/zipimport.rst:139 #: ../Doc/library/zipimport.rst:139
msgid "" msgid ""
@ -191,6 +244,9 @@ msgid ""
"slash, equal the original *archivepath* argument given to the :class:" "slash, equal the original *archivepath* argument given to the :class:"
"`zipimporter` constructor." "`zipimporter` constructor."
msgstr "" msgstr ""
"Les attributs :attr:`archive` et :attr:`prefix`, lorsqu'ils sont combinés "
"avec une barre oblique, égalent l'argument original *archivepath* donné au "
"constructeur :class:`zipimporter`."
#: ../Doc/library/zipimport.rst:147 #: ../Doc/library/zipimport.rst:147
msgid "Examples" msgid "Examples"
@ -201,3 +257,5 @@ msgid ""
"Here is an example that imports a module from a ZIP archive - note that the :" "Here is an example that imports a module from a ZIP archive - note that the :"
"mod:`zipimport` module is not explicitly used." "mod:`zipimport` module is not explicitly used."
msgstr "" msgstr ""
"Voici un exemple qui importe un module d'une archive ZIP — notez que le "
"module :mod:`zipimport` n'est pas explicitement utilisé."

View File

@ -324,7 +324,7 @@ msgstr ""
#: ../Doc/whatsnew/2.3.rst:331 #: ../Doc/whatsnew/2.3.rst:331
msgid ":pep:`273` - Import Modules from Zip Archives" msgid ":pep:`273` - Import Modules from Zip Archives"
msgstr "" msgstr ":pep:`273` - Import Modules from Zip Archives"
#: ../Doc/whatsnew/2.3.rst:329 #: ../Doc/whatsnew/2.3.rst:329
msgid "" msgid ""
@ -784,7 +784,7 @@ msgstr ""
#: ../Doc/whatsnew/2.3.rst:760 #: ../Doc/whatsnew/2.3.rst:760
msgid ":pep:`302` - New Import Hooks" msgid ":pep:`302` - New Import Hooks"
msgstr "" msgstr ":pep:`302` — Nouveaux crochets d'importation"
#: ../Doc/whatsnew/2.3.rst:761 #: ../Doc/whatsnew/2.3.rst:761
msgid "" msgid ""

View File

@ -592,6 +592,9 @@ msgid ""
"The cumulative effect of these changes is to turn generators from one-way " "The cumulative effect of these changes is to turn generators from one-way "
"producers of information into both producers and consumers." "producers of information into both producers and consumers."
msgstr "" msgstr ""
"Ces changements cumulés transforment les générateurs de producteurs "
"unidirectionnels d'information vers un statut hybride à la fois producteur "
"et consommateur."
#: ../Doc/whatsnew/2.5.rst:517 #: ../Doc/whatsnew/2.5.rst:517
msgid "" msgid ""

View File

@ -1255,7 +1255,7 @@ msgstr ""
#: ../Doc/whatsnew/3.0.rst:884 #: ../Doc/whatsnew/3.0.rst:884
msgid "Performance" msgid "Performance"
msgstr "" msgstr "Performances"
#: ../Doc/whatsnew/3.0.rst:886 #: ../Doc/whatsnew/3.0.rst:886
msgid "" msgid ""