forked from AFPy/python-docs-fr
Translate functools
This commit is contained in:
parent
4061f3b4b7
commit
b728c37835
|
@ -3,25 +3,27 @@
|
||||||
# This file is distributed under the same license as the Python package.
|
# This file is distributed under the same license as the Python package.
|
||||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
#
|
#
|
||||||
#, fuzzy
|
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Python 3.6\n"
|
"Project-Id-Version: Python 3.6\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2017-04-02 22:11+0200\n"
|
"POT-Creation-Date: 2017-04-02 22:11+0200\n"
|
||||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
"PO-Revision-Date: 2017-09-23 19:18+0200\n"
|
||||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
||||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
||||||
"Language: fr\n"
|
"Language: fr\n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
"Last-Translator: \n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"X-Generator: Poedit 1.8.6\n"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:2
|
#: ../Doc/library/functools.rst:2
|
||||||
msgid ""
|
msgid ""
|
||||||
":mod:`functools` --- Higher-order functions and operations on callable "
|
":mod:`functools` --- Higher-order functions and operations on callable "
|
||||||
"objects"
|
"objects"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
":mod:`functools` --- Fonctions de haut niveau et opération sur des objets "
|
||||||
|
"appelables"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:13
|
#: ../Doc/library/functools.rst:13
|
||||||
msgid "**Source code:** :source:`Lib/functools.py`"
|
msgid "**Source code:** :source:`Lib/functools.py`"
|
||||||
|
@ -33,10 +35,14 @@ msgid ""
|
||||||
"act on or return other functions. In general, any callable object can be "
|
"act on or return other functions. In general, any callable object can be "
|
||||||
"treated as a function for the purposes of this module."
|
"treated as a function for the purposes of this module."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Le module :mod:`functools` est utilisé pour des fonctions de haut niveau : "
|
||||||
|
"des fonctions qui agissent sur ou retournent d'autres fonctions. En général, "
|
||||||
|
"tout objet appelable peut être utilisé comme une fonction pour les besoins "
|
||||||
|
"de ce module."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:21
|
#: ../Doc/library/functools.rst:21
|
||||||
msgid "The :mod:`functools` module defines the following functions:"
|
msgid "The :mod:`functools` module defines the following functions:"
|
||||||
msgstr ""
|
msgstr "Le module :mod:`functools` définit les fonctions suivantes :"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:25
|
#: ../Doc/library/functools.rst:25
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -47,6 +53,13 @@ msgid ""
|
||||||
"for programs being converted from Python 2 which supported the use of "
|
"for programs being converted from Python 2 which supported the use of "
|
||||||
"comparison functions."
|
"comparison functions."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Transforme une fonction de comparaison à l'ancienne en une :term:`fonction "
|
||||||
|
"clef`. Utilisé avec des outils qui acceptent des fonctions clef (comme :"
|
||||||
|
"func:`sorted`, :func:`min`, :func:`max`, :func:`heapq.nlargest`, :func:"
|
||||||
|
"`heapq.nsmallest`, :func:`itertools.groupby`). Cette fonction est "
|
||||||
|
"principalement utilisée comme outil de transition pour des programmes à "
|
||||||
|
"convertir depuis Python 2 qui supportaient l'utilisation de fonctions de "
|
||||||
|
"comparaison."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:32
|
#: ../Doc/library/functools.rst:32
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -55,6 +68,11 @@ msgid ""
|
||||||
"positive number for greater-than. A key function is a callable that accepts "
|
"positive number for greater-than. A key function is a callable that accepts "
|
||||||
"one argument and returns another value to be used as the sort key."
|
"one argument and returns another value to be used as the sort key."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Une fonction de comparaison est un appelable qui prend deux arguments, les "
|
||||||
|
"compare, et retourne un nombre négatif pour l'infériorité, zéro pour "
|
||||||
|
"l'égalité ou un nombre positif pour la supériorité. Une fonction de clé est "
|
||||||
|
"un appelable qui prend un argument et retourne une autre valeur qui sera "
|
||||||
|
"utilisée comme clé de tri."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:37 ../Doc/library/functools.rst:220
|
#: ../Doc/library/functools.rst:37 ../Doc/library/functools.rst:220
|
||||||
msgid "Example::"
|
msgid "Example::"
|
||||||
|
@ -64,20 +82,27 @@ msgstr "Exemples ::"
|
||||||
msgid ""
|
msgid ""
|
||||||
"For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`."
|
"For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Pour des exemple de tris et un bref tutoriel, consultez :ref:`sortinghowto`."
|
"Pour des exemples de tris et un bref tutoriel, consultez :ref:`sortinghowto`."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:48
|
#: ../Doc/library/functools.rst:48
|
||||||
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
"Decorator to wrap a function with a memoizing callable that saves up to the "
|
"Decorator to wrap a function with a memoizing callable that saves up to the "
|
||||||
"*maxsize* most recent calls. It can save time when an expensive or I/O "
|
"*maxsize* most recent calls. It can save time when an expensive or I/O "
|
||||||
"bound function is periodically called with the same arguments."
|
"bound function is periodically called with the same arguments."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Décorateur qui englobe une fonction avec un appelable memoizant qui "
|
||||||
|
"enregistre jusqu'à *maxsize* appels récents. Cela peut gagner du temps quand "
|
||||||
|
"une fonction coûteuse en ressources est souvent appelée avec les mêmes "
|
||||||
|
"arguments."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:52
|
#: ../Doc/library/functools.rst:52
|
||||||
msgid ""
|
msgid ""
|
||||||
"Since a dictionary is used to cache results, the positional and keyword "
|
"Since a dictionary is used to cache results, the positional and keyword "
|
||||||
"arguments to the function must be hashable."
|
"arguments to the function must be hashable."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Comme un dictionnaire est utilisé pour mettre en cache les résultats, les "
|
||||||
|
"arguments positionnels et nommés de la fonction doivent être hachables."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:55
|
#: ../Doc/library/functools.rst:55
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -85,6 +110,9 @@ msgid ""
|
||||||
"can grow without bound. The LRU feature performs best when *maxsize* is a "
|
"can grow without bound. The LRU feature performs best when *maxsize* is a "
|
||||||
"power-of-two."
|
"power-of-two."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Si *maxsize* est à ``None``, la fonctionnalité LRU est désactivée et le "
|
||||||
|
"cache peut grossir sans limite. La fonctionnalité LRU fonctionne mieux "
|
||||||
|
"quand *maxsize* est une puissance de deux."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:59
|
#: ../Doc/library/functools.rst:59
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -92,6 +120,9 @@ msgid ""
|
||||||
"cached separately. For example, ``f(3)`` and ``f(3.0)`` will be treated as "
|
"cached separately. For example, ``f(3)`` and ``f(3.0)`` will be treated as "
|
||||||
"distinct calls with distinct results."
|
"distinct calls with distinct results."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Si *typed* est vrai, les arguments de la fonction de différents types seront "
|
||||||
|
"mis en cache séparément. Par exemple, ``f(3)`` et ``f(3.0)`` seront "
|
||||||
|
"considérés comme des appels distincts avec des résultats distincts."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:63
|
#: ../Doc/library/functools.rst:63
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -101,12 +132,19 @@ msgid ""
|
||||||
"*maxsize* and *currsize*. In a multi-threaded environment, the hits and "
|
"*maxsize* and *currsize*. In a multi-threaded environment, the hits and "
|
||||||
"misses are approximate."
|
"misses are approximate."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Pour aider à mesurer l'efficacité du cache et ajuster le paramètre "
|
||||||
|
"*maxsize*, la fonction englobée est is instrumented avec une fonction :func:"
|
||||||
|
"`cache_info` qui retourne un :term:`named tuple` affichant les *hits*, "
|
||||||
|
"*misses*, *maxsize* et *currsize*. Dans un environnement multi-thread, les "
|
||||||
|
"succès et échecs d'appel du cache sont approximatifs."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:69
|
#: ../Doc/library/functools.rst:69
|
||||||
msgid ""
|
msgid ""
|
||||||
"The decorator also provides a :func:`cache_clear` function for clearing or "
|
"The decorator also provides a :func:`cache_clear` function for clearing or "
|
||||||
"invalidating the cache."
|
"invalidating the cache."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Le décorateur fournit également une fonction :func:`cache_clear` pour vider "
|
||||||
|
"ou invalider le cache."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:72
|
#: ../Doc/library/functools.rst:72
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -114,6 +152,9 @@ msgid ""
|
||||||
"`__wrapped__` attribute. This is useful for introspection, for bypassing "
|
"`__wrapped__` attribute. This is useful for introspection, for bypassing "
|
||||||
"the cache, or for rewrapping the function with a different cache."
|
"the cache, or for rewrapping the function with a different cache."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"La fonction sous-jacente originale est accessible à travers l'attribut :attr:"
|
||||||
|
"`__wrapped__`. Ceci est utile pour l'introspection, pour outrepasser le "
|
||||||
|
"cache, ou pour ré-englober la fonction avec un cache différent."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:76
|
#: ../Doc/library/functools.rst:76
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -124,10 +165,17 @@ msgid ""
|
||||||
"the cache does not grow without bound on long-running processes such as web "
|
"the cache does not grow without bound on long-running processes such as web "
|
||||||
"servers."
|
"servers."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Un `cache LRU (*least recently used*) <https://fr.wikipedia.org/wiki/"
|
||||||
|
"Algorithmes_de_remplacement_des_lignes_de_cache#LRU_.28Least_Recently_Used.29>`_ "
|
||||||
|
"fonctionne très bien lorsque les appels récents sont les prochains appels "
|
||||||
|
"les plus probables (par exemple, les articles les plus lus d'un serveur "
|
||||||
|
"d'actualités ont tendance à changer tous les jours). La taille limite du "
|
||||||
|
"cache permet de s'assurer que le cache ne grossisse pas sans limite sur les "
|
||||||
|
"processus longs comme les serveurs web."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:83
|
#: ../Doc/library/functools.rst:83
|
||||||
msgid "Example of an LRU cache for static web content::"
|
msgid "Example of an LRU cache for static web content::"
|
||||||
msgstr ""
|
msgstr "Exemple d'un cache LRU pour du contenu web statique ::"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:102
|
#: ../Doc/library/functools.rst:102
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -135,10 +183,14 @@ msgid ""
|
||||||
"org/wiki/Fibonacci_number>`_ using a cache to implement a `dynamic "
|
"org/wiki/Fibonacci_number>`_ using a cache to implement a `dynamic "
|
||||||
"programming <https://en.wikipedia.org/wiki/Dynamic_programming>`_ technique::"
|
"programming <https://en.wikipedia.org/wiki/Dynamic_programming>`_ technique::"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Exemple de calcul efficace de `la suite de Fibonacci <https://fr.wikipedia."
|
||||||
|
"org/wiki/Suite_de_Fibonacci>`_ en utilisant un cache pour implémenter la "
|
||||||
|
"technique de `programmation dynamique <https://fr.wikipedia.org/wiki/"
|
||||||
|
"Programmation_dynamique>`_ ::"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:122
|
#: ../Doc/library/functools.rst:122
|
||||||
msgid "Added the *typed* option."
|
msgid "Added the *typed* option."
|
||||||
msgstr ""
|
msgstr "L'option *typed* a été ajoutée."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:127
|
#: ../Doc/library/functools.rst:127
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -146,6 +198,9 @@ msgid ""
|
||||||
"class decorator supplies the rest. This simplifies the effort involved in "
|
"class decorator supplies the rest. This simplifies the effort involved in "
|
||||||
"specifying all of the possible rich comparison operations:"
|
"specifying all of the possible rich comparison operations:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"A partir d'une classe définissant une ou plusieurs méthodes de comparaison "
|
||||||
|
"riches, ce décorateur de classe fournit le reste. Ceci simplifie l'effort à "
|
||||||
|
"fournir dans la spécification de toutes les opérations de comparaison riche :"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:131
|
#: ../Doc/library/functools.rst:131
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -153,10 +208,13 @@ msgid ""
|
||||||
"or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` "
|
"or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` "
|
||||||
"method."
|
"method."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"La classe doit définir au moins une de ces méthodes :meth:`__lt__`, :meth:"
|
||||||
|
"`__le__`, :meth:`__gt__`, or :meth:`__ge__`. De plus, la classe doit fournir "
|
||||||
|
"une méthode :meth:`__eq__`."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:135
|
#: ../Doc/library/functools.rst:135
|
||||||
msgid "For example::"
|
msgid "For example::"
|
||||||
msgstr "Par exemple : ::"
|
msgstr "Par exemple ::"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:155
|
#: ../Doc/library/functools.rst:155
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -166,12 +224,19 @@ msgid ""
|
||||||
"indicates this is a bottleneck for a given application, implementing all six "
|
"indicates this is a bottleneck for a given application, implementing all six "
|
||||||
"rich comparison methods instead is likely to provide an easy speed boost."
|
"rich comparison methods instead is likely to provide an easy speed boost."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Même si ce décorateur permet de créer des types ordonnables facilement, cela "
|
||||||
|
"vient avec un *coût* d'exécution et des traces d'exécution complexes for les "
|
||||||
|
"méthodes de comparaison dérivées. Si des tests de performances le révèlent "
|
||||||
|
"comme un goulot d'étranglement, l'implémentation manuelle des six méthodes "
|
||||||
|
"de comparaison riches résoudra normalement vos problèmes de rapidité."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:164
|
#: ../Doc/library/functools.rst:164
|
||||||
msgid ""
|
msgid ""
|
||||||
"Returning NotImplemented from the underlying comparison function for "
|
"Returning NotImplemented from the underlying comparison function for "
|
||||||
"unrecognised types is now supported."
|
"unrecognised types is now supported."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Retourner NotImplemented dans les fonction de comparaison sous-jacentes pour "
|
||||||
|
"les types non reconnus est maintenant supporté."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:170
|
#: ../Doc/library/functools.rst:170
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -181,6 +246,11 @@ msgid ""
|
||||||
"*args*. If additional keyword arguments are supplied, they extend and "
|
"*args*. If additional keyword arguments are supplied, they extend and "
|
||||||
"override *keywords*. Roughly equivalent to::"
|
"override *keywords*. Roughly equivalent to::"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Retourne un nouvel objet :class:`partial` qui, quand il est appelé, "
|
||||||
|
"fonctionne comme *func* appelée avec les arguments positionels *args* et les "
|
||||||
|
"arguments nommés *keywords*. Si plus d'arguments sont fournis à l'appel, ils "
|
||||||
|
"sont ajoutés à *args*. Si plus d'arguments nommés sont fournis, ils étendent "
|
||||||
|
"et surchargent *keywords*. A peu près équivalent à ::"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:186
|
#: ../Doc/library/functools.rst:186
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -190,6 +260,11 @@ msgid ""
|
||||||
"used to create a callable that behaves like the :func:`int` function where "
|
"used to create a callable that behaves like the :func:`int` function where "
|
||||||
"the *base* argument defaults to two:"
|
"the *base* argument defaults to two:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
":func:`partial` est utilisé pour une application de fonction partielle qui "
|
||||||
|
"\"gèle\" une portion des arguments et/ou mots-clés d'une fonction donnant un "
|
||||||
|
"nouvel objet avec une signature simplifiée. Par exemple, :func:`partial` "
|
||||||
|
"peut être utilisé pour créer un appelable qui se comporte comme la fonction :"
|
||||||
|
"func:`int` ou l'argument *base* est deux par défaut :"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:201
|
#: ../Doc/library/functools.rst:201
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -197,12 +272,17 @@ msgid ""
|
||||||
"`partial` except that it is designed to be used as a method definition "
|
"`partial` except that it is designed to be used as a method definition "
|
||||||
"rather than being directly callable."
|
"rather than being directly callable."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Retourne un nouveau descripteur :class:`partialmethod` qui se comporte "
|
||||||
|
"comme :class:`partial` sauf qu'il est fait pour être utilisé comme une "
|
||||||
|
"définition de méthode plutôt que d'être appelé directement."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:205
|
#: ../Doc/library/functools.rst:205
|
||||||
msgid ""
|
msgid ""
|
||||||
"*func* must be a :term:`descriptor` or a callable (objects which are both, "
|
"*func* must be a :term:`descriptor` or a callable (objects which are both, "
|
||||||
"like normal functions, are handled as descriptors)."
|
"like normal functions, are handled as descriptors)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"*func* doit être un :term:`descriptor` ou un appelable (les objets qui sont "
|
||||||
|
"les deux, comme les fonction normales, sont gérés comme des descripteurs)."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:208
|
#: ../Doc/library/functools.rst:208
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -212,6 +292,11 @@ msgid ""
|
||||||
"the underlying descriptor, and an appropriate :class:`partial` object "
|
"the underlying descriptor, and an appropriate :class:`partial` object "
|
||||||
"returned as the result."
|
"returned as the result."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Quand *func* est un descripteur (comme une fonction Python normale, :func:"
|
||||||
|
"`classmethod`, :func:`staticmethod`, :func:`abstractmethod` ou une autre "
|
||||||
|
"instance de :class:`partialmethod`), les appels à ``__get__`` sont délégués "
|
||||||
|
"au descripteur sous-jacent, et un objet :class:`partial` approprié est "
|
||||||
|
"retourné comme résultat."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:214
|
#: ../Doc/library/functools.rst:214
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -221,6 +306,11 @@ msgid ""
|
||||||
"argument, even before the *args* and *keywords* supplied to the :class:"
|
"argument, even before the *args* and *keywords* supplied to the :class:"
|
||||||
"`partialmethod` constructor."
|
"`partialmethod` constructor."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Quand *func* est un appelable non-descripteur, une méthode liée appropriée "
|
||||||
|
"est crée dynamiquement. Elle se comporte comme une fonction Python normale "
|
||||||
|
"quand elle est utilisée comme méthode : l'argument *self* sera inséré comme "
|
||||||
|
"premier argument positionnel, avant les *args* et *keywords* fournis au "
|
||||||
|
"constructeur :class:`partialmethod`."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:245
|
#: ../Doc/library/functools.rst:245
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -234,16 +324,27 @@ msgid ""
|
||||||
"empty. If *initializer* is not given and *sequence* contains only one item, "
|
"empty. If *initializer* is not given and *sequence* contains only one item, "
|
||||||
"the first item is returned."
|
"the first item is returned."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Applique *function* avec deux arguments cumulativement aux éléments de "
|
||||||
|
"*sequence*, de gauche à droite, pour réduire la séquence à une valeur "
|
||||||
|
"unique. Par exemple, ``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` calcule "
|
||||||
|
"``((((1+2)+3)+4)+5)``. Le premier argument, *x*, et la valeur de cumul et le "
|
||||||
|
"deuxième, *y*, est la valeur de mise à jour depuis *sequence*. Si "
|
||||||
|
"l'argument optionnel *initializer* est présent, il est placé avant les "
|
||||||
|
"éléments de la séquence dans le calcul, et sert de valeur par défaut quand "
|
||||||
|
"la séquence est vide. Si *initializer* n'est pas renseigné et que "
|
||||||
|
"*sequence* ne contient qu'un élément, le premier élément est retourné."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:254
|
#: ../Doc/library/functools.rst:254
|
||||||
msgid "Roughly equivalent to::"
|
msgid "Roughly equivalent to::"
|
||||||
msgstr ""
|
msgstr "A peu près équivalent à ::"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:269
|
#: ../Doc/library/functools.rst:269
|
||||||
msgid ""
|
msgid ""
|
||||||
"Transforms a function into a :term:`single-dispatch <single dispatch>` :term:"
|
"Transforms a function into a :term:`single-dispatch <single dispatch>` :term:"
|
||||||
"`generic function`."
|
"`generic function`."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Transforme une fonction en une :term:`fonction générique <generic "
|
||||||
|
"function>` :term:`single-dispatch <single dispatch>`."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:272
|
#: ../Doc/library/functools.rst:272
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -251,6 +352,9 @@ msgid ""
|
||||||
"decorator. Note that the dispatch happens on the type of the first argument, "
|
"decorator. Note that the dispatch happens on the type of the first argument, "
|
||||||
"create your function accordingly::"
|
"create your function accordingly::"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Pour définir une fonction générique, il faut la décorer avec le décorateur "
|
||||||
|
"``@singledispatch``. Noter que la distribution est effectuée sur le type du "
|
||||||
|
"premier argument, donc la fonction doit être créée en conséquence ::"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:283
|
#: ../Doc/library/functools.rst:283
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -259,12 +363,18 @@ msgid ""
|
||||||
"parameter and decorating a function implementing the operation for that "
|
"parameter and decorating a function implementing the operation for that "
|
||||||
"type::"
|
"type::"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Pour ajouter des surcharges d'implémentation à la fonction, utiliser "
|
||||||
|
"l'attribut :func:`register` de la fonction générique. C'est un décorateur, "
|
||||||
|
"prenant un type en paramètre et décorant une fonction implémentant "
|
||||||
|
"l'opération pour ce type ::"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:301
|
#: ../Doc/library/functools.rst:301
|
||||||
msgid ""
|
msgid ""
|
||||||
"To enable registering lambdas and pre-existing functions, the :func:"
|
"To enable registering lambdas and pre-existing functions, the :func:"
|
||||||
"`register` attribute can be used in a functional form::"
|
"`register` attribute can be used in a functional form::"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Pour permettre l'enregistrement de lambdas et de fonctions pré-existantes, "
|
||||||
|
"l'attribut :func:`register` peut être utilisé sous forme fonctionnelle ::"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:309
|
#: ../Doc/library/functools.rst:309
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -272,12 +382,17 @@ msgid ""
|
||||||
"enables decorator stacking, pickling, as well as creating unit tests for "
|
"enables decorator stacking, pickling, as well as creating unit tests for "
|
||||||
"each variant independently::"
|
"each variant independently::"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"L'attribut :func:`register` retourne la fonction non décorée ce qui permet "
|
||||||
|
"d'empiler les décorateurs, la sérialisation, et la création de tests "
|
||||||
|
"unitaires pour chaque variante indépendamment ::"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:323
|
#: ../Doc/library/functools.rst:323
|
||||||
msgid ""
|
msgid ""
|
||||||
"When called, the generic function dispatches on the type of the first "
|
"When called, the generic function dispatches on the type of the first "
|
||||||
"argument::"
|
"argument::"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Quand elle est appelée, la fonction générique distribue sur le type du "
|
||||||
|
"premier argument ::"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:343
|
#: ../Doc/library/functools.rst:343
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -286,20 +401,30 @@ msgid ""
|
||||||
"function decorated with ``@singledispatch`` is registered for the base "
|
"function decorated with ``@singledispatch`` is registered for the base "
|
||||||
"``object`` type, which means it is used if no better implementation is found."
|
"``object`` type, which means it is used if no better implementation is found."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Quand il n'y a pas d'implémentation enregistrée pour un type spécifique, son "
|
||||||
|
"ordre de résolution de méthode est utilisé pour trouver une implémentation "
|
||||||
|
"plus générique. La fonction originale est décorée avec ``@singledispatch`` "
|
||||||
|
"est enregistrée pour le type d'``object``, et elle sera utilisée si aucune "
|
||||||
|
"implémentation n'est trouvée."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:349
|
#: ../Doc/library/functools.rst:349
|
||||||
msgid ""
|
msgid ""
|
||||||
"To check which implementation will the generic function choose for a given "
|
"To check which implementation will the generic function choose for a given "
|
||||||
"type, use the ``dispatch()`` attribute::"
|
"type, use the ``dispatch()`` attribute::"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Pour vérifier quelle implémentation la fonction générique choisira pour un "
|
||||||
|
"type donné, utiliser l'attribut ``dispatch()`` ::"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:357
|
#: ../Doc/library/functools.rst:357
|
||||||
msgid ""
|
msgid ""
|
||||||
"To access all registered implementations, use the read-only ``registry`` "
|
"To access all registered implementations, use the read-only ``registry`` "
|
||||||
"attribute::"
|
"attribute::"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Pour accéder à toutes les implémentations enregistrées, utiliser l'attribut "
|
||||||
|
"en lecture seule ``registry`` ::"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:374
|
#: ../Doc/library/functools.rst:374
|
||||||
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
"Update a *wrapper* function to look like the *wrapped* function. The "
|
"Update a *wrapper* function to look like the *wrapped* function. The "
|
||||||
"optional arguments are tuples to specify which attributes of the original "
|
"optional arguments are tuples to specify which attributes of the original "
|
||||||
|
@ -312,6 +437,17 @@ msgid ""
|
||||||
"string) and ``WRAPPER_UPDATES`` (which updates the wrapper function's "
|
"string) and ``WRAPPER_UPDATES`` (which updates the wrapper function's "
|
||||||
"``__dict__``, i.e. the instance dictionary)."
|
"``__dict__``, i.e. the instance dictionary)."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Met à jour la fonction *wrapper* pour ressembler à la fonction *wrapped*. "
|
||||||
|
"Les arguments optionnels sont des tuples pour spécifier quels attributs de "
|
||||||
|
"la fonction originale sont assignés directement aux attributs correspondants "
|
||||||
|
"sur la fonction englobante et quels attributs de la fonction englobante sont "
|
||||||
|
"mis à jour avec les attributs de la fonction originale. Les valeurs par "
|
||||||
|
"défaut de ces arguments sont les constantes au niveau du module "
|
||||||
|
"``WRAPPER_ASSIGNMENTS`` (qui assigne``__module__``, ``__name__``, "
|
||||||
|
"``__qualname__``, ``__annotations__`` et ``__doc__``, la chaîne de "
|
||||||
|
"documentation, depuis la fonction englobante) et ``WRAPPER_UPDATES`` (qui "
|
||||||
|
"met à jour le ``__dict__`` de la fonction englobante, c'est-à-dire le "
|
||||||
|
"dictionnaire de l'instance)."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:384
|
#: ../Doc/library/functools.rst:384
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -320,8 +456,13 @@ msgid ""
|
||||||
"this function automatically adds a ``__wrapped__`` attribute to the wrapper "
|
"this function automatically adds a ``__wrapped__`` attribute to the wrapper "
|
||||||
"that refers to the function being wrapped."
|
"that refers to the function being wrapped."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Pour autoriser l'accès à la fonction originale pour l'introspection ou à "
|
||||||
|
"d'autres fins (par ex. outrepasser l'accès à un décorateur de cache comme :"
|
||||||
|
"func:`lru_cache`), cette fonction ajoute automatiquement un attribut "
|
||||||
|
"``__wrapped__`` qui référence la fonction englobée."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:389
|
#: ../Doc/library/functools.rst:389
|
||||||
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
"The main intended use for this function is in :term:`decorator` functions "
|
"The main intended use for this function is in :term:`decorator` functions "
|
||||||
"which wrap the decorated function and return the wrapper. If the wrapper "
|
"which wrap the decorated function and return the wrapper. If the wrapper "
|
||||||
|
@ -329,6 +470,12 @@ msgid ""
|
||||||
"the wrapper definition rather than the original function definition, which "
|
"the wrapper definition rather than the original function definition, which "
|
||||||
"is typically less than helpful."
|
"is typically less than helpful."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"La principale utilisation de cette fonction est dans les fonctions de :term:"
|
||||||
|
"`décoration <decorator>` qui englobent la fonction décorée et retourne "
|
||||||
|
"l'englobeur. Si la fonction englobante n'est pas mise à jour, les "
|
||||||
|
"métadonnées de la fonction retournée reflèteront la définition de "
|
||||||
|
"l'englobeur au lieu de la définition de la fonction originale, qui souvent "
|
||||||
|
"peu utile."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:395
|
#: ../Doc/library/functools.rst:395
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -338,18 +485,24 @@ msgid ""
|
||||||
"on the wrapper function). :exc:`AttributeError` is still raised if the "
|
"on the wrapper function). :exc:`AttributeError` is still raised if the "
|
||||||
"wrapper function itself is missing any attributes named in *updated*."
|
"wrapper function itself is missing any attributes named in *updated*."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
":func:`update_wrapper` peut être utilisé avec des appelables autres que des "
|
||||||
|
"fonction. Tout attribut défini dans *assigned* ou *updated* qui ne sont pas "
|
||||||
|
"l'objet englobé sont ignorés (cette fonction n'essaiera pas de les définir "
|
||||||
|
"dans la fonction englobante). :exc:`AttributeError` est toujours levée si le "
|
||||||
|
"fonction englobante elle même a des attributs non existants dans *updated*."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:401
|
#: ../Doc/library/functools.rst:401
|
||||||
msgid "Automatic addition of the ``__wrapped__`` attribute."
|
msgid "Automatic addition of the ``__wrapped__`` attribute."
|
||||||
msgstr ""
|
msgstr "Ajout automatique de l'attribut ``__wrapped__``."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:404
|
#: ../Doc/library/functools.rst:404
|
||||||
msgid "Copying of the ``__annotations__`` attribute by default."
|
msgid "Copying of the ``__annotations__`` attribute by default."
|
||||||
msgstr ""
|
msgstr "Copie de l'attribut ``__annotations__`` par défaut."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:407
|
#: ../Doc/library/functools.rst:407
|
||||||
msgid "Missing attributes no longer trigger an :exc:`AttributeError`."
|
msgid "Missing attributes no longer trigger an :exc:`AttributeError`."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Les attributs manquants ne lèvent plus d'exception :exc:`AttributeError`."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:410
|
#: ../Doc/library/functools.rst:410
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -357,6 +510,8 @@ msgid ""
|
||||||
"even if that function defined a ``__wrapped__`` attribute. (see :issue:"
|
"even if that function defined a ``__wrapped__`` attribute. (see :issue:"
|
||||||
"`17482`)"
|
"`17482`)"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"L'attribut ``__wrapped__`` renvoie toujours la fonction englobée, même si "
|
||||||
|
"cette fonction définit un attribut ``__wrapped__``. (voir :issue:`17482`)"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:418
|
#: ../Doc/library/functools.rst:418
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -365,6 +520,10 @@ msgid ""
|
||||||
"``partial(update_wrapper, wrapped=wrapped, assigned=assigned, "
|
"``partial(update_wrapper, wrapped=wrapped, assigned=assigned, "
|
||||||
"updated=updated)``. For example::"
|
"updated=updated)``. For example::"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Ceci est une fonction d'aide pour appeler :func:`update_wrapper` comme "
|
||||||
|
"décorateur de fonction lors de la définition d'une fonction englobante. "
|
||||||
|
"C'est équivalent à ``partial(update_wrapper, wrapped=wrapped, "
|
||||||
|
"assigned=assigned, updated=updated)``. Par exemple ::"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:444
|
#: ../Doc/library/functools.rst:444
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -372,34 +531,45 @@ msgid ""
|
||||||
"would have been ``'wrapper'``, and the docstring of the original :func:"
|
"would have been ``'wrapper'``, and the docstring of the original :func:"
|
||||||
"`example` would have been lost."
|
"`example` would have been lost."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Sans l'utilisation de cette usine à décorateur, le nom de la fonction "
|
||||||
|
"d'exemple aurait été ``'wrapper'``, et la chaîne de documentation de la "
|
||||||
|
"fonction :func:`example` originale aurait été perdue."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:452
|
#: ../Doc/library/functools.rst:452
|
||||||
msgid ":class:`partial` Objects"
|
msgid ":class:`partial` Objects"
|
||||||
msgstr ""
|
msgstr "Objets :class:`partial`"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:454
|
#: ../Doc/library/functools.rst:454
|
||||||
msgid ""
|
msgid ""
|
||||||
":class:`partial` objects are callable objects created by :func:`partial`. "
|
":class:`partial` objects are callable objects created by :func:`partial`. "
|
||||||
"They have three read-only attributes:"
|
"They have three read-only attributes:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Les objets :class:`partial` sont des objets appelables créés par :func:"
|
||||||
|
"`partial`. Ils ont trois attributs en lecture seule :"
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:460
|
#: ../Doc/library/functools.rst:460
|
||||||
msgid ""
|
msgid ""
|
||||||
"A callable object or function. Calls to the :class:`partial` object will be "
|
"A callable object or function. Calls to the :class:`partial` object will be "
|
||||||
"forwarded to :attr:`func` with new arguments and keywords."
|
"forwarded to :attr:`func` with new arguments and keywords."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Un objet ou une fonction appelable. Les appels à l'objet :class:`partial` "
|
||||||
|
"seront transmis à :attr:`func` avec les nouveaux arguments et mots-clés."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:466
|
#: ../Doc/library/functools.rst:466
|
||||||
msgid ""
|
msgid ""
|
||||||
"The leftmost positional arguments that will be prepended to the positional "
|
"The leftmost positional arguments that will be prepended to the positional "
|
||||||
"arguments provided to a :class:`partial` object call."
|
"arguments provided to a :class:`partial` object call."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Les arguments positionnels qui seront ajoutés avant les arguments fournis "
|
||||||
|
"lors de l'appel d'un objet :class:`partial`."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:472
|
#: ../Doc/library/functools.rst:472
|
||||||
msgid ""
|
msgid ""
|
||||||
"The keyword arguments that will be supplied when the :class:`partial` object "
|
"The keyword arguments that will be supplied when the :class:`partial` object "
|
||||||
"is called."
|
"is called."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Les arguments nommés qui seront fournis quand l'objet :class:`partial` est "
|
||||||
|
"appelé."
|
||||||
|
|
||||||
#: ../Doc/library/functools.rst:475
|
#: ../Doc/library/functools.rst:475
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@ -410,3 +580,10 @@ msgid ""
|
||||||
"`partial` objects defined in classes behave like static methods and do not "
|
"`partial` objects defined in classes behave like static methods and do not "
|
||||||
"transform into bound methods during instance attribute look-up."
|
"transform into bound methods during instance attribute look-up."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
"Les objets :class:`partial` sont comme des objets :class:`function` de par "
|
||||||
|
"le fait qu'il sont appelables, référençables, et peuvent avoir des "
|
||||||
|
"attributs. Il y a cependant des différences importantes. Par exemple, les "
|
||||||
|
"attributs :attr:`~definition.__name__` et :attr:`__doc__` ne sont pas créés "
|
||||||
|
"automatiquement. De plus, les objets :class:`partial` définis dans les "
|
||||||
|
"classes se comportent comme des méthodes statiques et ne se transforment pas "
|
||||||
|
"en méthodes liées durant la recherche d'attributs dans l'instance."
|
||||||
|
|
Loading…
Reference in New Issue
Block a user