1
0
Fork 0
python-docs-fr/library/functools.po

837 lines
36 KiB
Plaintext
Raw Normal View History

2018-07-04 09:06:45 +00:00
# Copyright (C) 2001-2018, Python Software Foundation
2018-07-04 09:08:42 +00:00
# For licence information, see README file.
2016-10-30 09:46:26 +00:00
#
msgid ""
msgstr ""
2019-12-05 22:15:54 +00:00
"Project-Id-Version: Python 3\n"
2016-10-30 09:46:26 +00:00
"Report-Msgid-Bugs-To: \n"
2023-04-14 11:20:40 +00:00
"POT-Creation-Date: 2023-04-14 13:19+0200\n"
2022-11-14 15:08:57 +00:00
"PO-Revision-Date: 2022-10-18 15:58+0200\n"
"Last-Translator: Antoine Wecxsteen\n"
2018-07-04 09:14:25 +00:00
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
2017-05-23 22:40:56 +00:00
"Language: fr\n"
2016-10-30 09:46:26 +00:00
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.3\n"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:2
2016-10-30 09:46:26 +00:00
msgid ""
":mod:`functools` --- Higher-order functions and operations on callable "
"objects"
msgstr ""
":mod:`functools` — Fonctions d'ordre supérieur et opérations sur des objets "
2017-09-23 17:20:26 +00:00
"appelables"
2016-10-30 09:46:26 +00:00
2020-07-20 08:56:42 +00:00
#: library/functools.rst:14
2016-10-30 09:46:26 +00:00
msgid "**Source code:** :source:`Lib/functools.py`"
msgstr "**Code source :** :source:`Lib/functools.py`"
2020-07-20 08:56:42 +00:00
#: library/functools.rst:23
2016-10-30 09:46:26 +00:00
msgid ""
"The :mod:`functools` module is for higher-order functions: functions that "
"act on or return other functions. In general, any callable object can be "
"treated as a function for the purposes of this module."
msgstr ""
"Le module :mod:`functools` concerne les fonctions d'ordre supérieur : des "
"fonctions qui agissent sur, ou renvoient, d'autres fonctions. En général, "
"tout objet appelable peut être considéré comme une fonction dans la "
"description de ce module."
2016-10-30 09:46:26 +00:00
2020-07-20 08:56:42 +00:00
#: library/functools.rst:27
2016-10-30 09:46:26 +00:00
msgid "The :mod:`functools` module defines the following functions:"
msgstr "Le module :mod:`functools` définit les fonctions suivantes :"
2016-10-30 09:46:26 +00:00
2020-07-20 08:56:42 +00:00
#: library/functools.rst:31
msgid ""
"Simple lightweight unbounded function cache. Sometimes called `\"memoize\" "
"<https://en.wikipedia.org/wiki/Memoization>`_."
msgstr ""
"Fonction de cache très simple et sans limite de taille. Cette technique est "
"parfois appelée `« mémoïsation » <https://fr.wikipedia.org/wiki/"
"M%C3%A9mo%C3%AFsation>`_."
2020-07-20 08:56:42 +00:00
#: library/functools.rst:34
msgid ""
"Returns the same as ``lru_cache(maxsize=None)``, creating a thin wrapper "
"around a dictionary lookup for the function arguments. Because it never "
"needs to evict old values, this is smaller and faster than :func:"
"`lru_cache()` with a size limit."
msgstr ""
"Identique à ``lru_cache(maxsize=None)``. Crée une surcouche légère avec une "
"recherche dans un dictionnaire indexé par les arguments de la fonction. "
"Comme elle ne nettoie jamais les anciennes entrées, elle est plus simple et "
"plus rapide que :func:`lru_cache()` avec une limite."
2020-07-20 08:56:42 +00:00
#: library/functools.rst:273
2020-07-20 08:56:42 +00:00
msgid "For example::"
msgstr "Par exemple ::"
#: library/functools.rst:146
msgid ""
"The cache is threadsafe so the wrapped function can be used in multiple "
"threads."
msgstr ""
#: library/functools.rst:60
2016-10-30 09:46:26 +00:00
msgid ""
2019-09-04 09:35:23 +00:00
"Transform a method of a class into a property whose value is computed once "
"and then cached as a normal attribute for the life of the instance. Similar "
"to :func:`property`, with the addition of caching. Useful for expensive "
"computed properties of instances that are otherwise effectively immutable."
msgstr ""
#: library/functools.rst:130 library/functools.rst:365
2019-09-04 09:35:23 +00:00
msgid "Example::"
msgstr "Exemple ::"
#: library/functools.rst:76
2021-01-27 19:42:04 +00:00
msgid ""
"The mechanics of :func:`cached_property` are somewhat different from :func:"
"`property`. A regular property blocks attribute writes unless a setter is "
"defined. In contrast, a *cached_property* allows writes."
msgstr ""
#: library/functools.rst:80
2021-01-27 19:42:04 +00:00
msgid ""
"The *cached_property* decorator only runs on lookups and only when an "
"attribute of the same name doesn't exist. When it does run, the "
"*cached_property* writes to the attribute with the same name. Subsequent "
"attribute reads and writes take precedence over the *cached_property* method "
"and it works like a normal attribute."
msgstr ""
#: library/functools.rst:86
2021-01-27 19:42:04 +00:00
msgid ""
"The cached value can be cleared by deleting the attribute. This allows the "
"*cached_property* method to run again."
msgstr ""
#: library/functools.rst:89
2020-12-18 06:09:57 +00:00
msgid ""
"Note, this decorator interferes with the operation of :pep:`412` key-sharing "
"dictionaries. This means that instance dictionaries can take more space "
"than usual."
msgstr ""
#: library/functools.rst:93
2019-09-04 09:35:23 +00:00
msgid ""
2020-12-18 06:09:57 +00:00
"Also, this decorator requires that the ``__dict__`` attribute on each "
"instance be a mutable mapping. This means it will not work with some types, "
"such as metaclasses (since the ``__dict__`` attributes on type instances are "
"read-only proxies for the class namespace), and those that specify "
"``__slots__`` without including ``__dict__`` as one of the defined slots (as "
"such classes don't provide a ``__dict__`` attribute at all)."
msgstr ""
#: library/functools.rst:100
2020-12-18 06:09:57 +00:00
msgid ""
"If a mutable mapping is not available or if space-efficient key sharing is "
"desired, an effect similar to :func:`cached_property` can be achieved by a "
"stacking :func:`property` on top of :func:`cache`::"
2019-09-04 09:35:23 +00:00
msgstr ""
#: library/functools.rst:118
2019-09-04 09:35:23 +00:00
msgid ""
2016-10-30 09:46:26 +00:00
"Transform an old-style comparison function to a :term:`key function`. Used "
"with tools that accept key functions (such as :func:`sorted`, :func:`min`, :"
"func:`max`, :func:`heapq.nlargest`, :func:`heapq.nsmallest`, :func:"
"`itertools.groupby`). This function is primarily used as a transition tool "
"for programs being converted from Python 2 which supported the use of "
"comparison functions."
msgstr ""
2017-09-23 17:20:26 +00:00
"Transforme une fonction de comparaison à l'ancienne en une :term:`fonction "
2018-04-16 21:54:32 +00:00
"clé`. 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 destinée au "
"portage de fonctions python 2 utilisant des fonctions de comparaison vers "
2017-09-24 12:04:38 +00:00
"Python 3."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:125
#, fuzzy
2016-10-30 09:46:26 +00:00
msgid ""
"A comparison function is any callable that accepts two arguments, compares "
2016-10-30 09:46:26 +00:00
"them, and returns a negative number for less-than, zero for equality, or a "
"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."
msgstr ""
2017-09-23 17:20:26 +00:00
"Une fonction de comparaison est un appelable qui prend deux arguments, les "
2017-09-24 12:04:38 +00:00
"compare, et renvoie un nombre négatif pour l'infériorité, zéro pour "
2017-09-23 17:20:26 +00:00
"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."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:134
2016-10-30 09:46:26 +00:00
msgid ""
"For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`."
msgstr ""
2017-09-23 17:20:26 +00:00
"Pour des exemples de tris et un bref tutoriel, consultez :ref:`sortinghowto`."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:142
2016-10-30 09:46:26 +00:00
msgid ""
"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 "
"bound function is periodically called with the same arguments."
msgstr ""
2018-09-28 09:36:32 +00:00
"Décorateur qui englobe une fonction avec un appelable mémoïsant qui "
2017-09-23 17:20:26 +00:00
"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."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:149
2023-04-14 11:20:40 +00:00
#, fuzzy
2016-10-30 09:46:26 +00:00
msgid ""
"Since a dictionary is used to cache results, the positional and keyword "
2023-04-14 11:20:40 +00:00
"arguments to the function must be :term:`hashable`."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-23 17:20:26 +00:00
"Comme un dictionnaire est utilisé pour mettre en cache les résultats, les "
"arguments positionnels et nommés de la fonction doivent être hachables."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:152
#, fuzzy
2016-10-30 09:46:26 +00:00
msgid ""
2018-09-15 20:37:31 +00:00
"Distinct argument patterns may be considered to be distinct calls with "
"separate cache entries. For example, ``f(a=1, b=2)`` and ``f(b=2, a=1)`` "
"differ in their keyword argument order and may have two separate cache "
"entries."
2018-09-15 20:37:31 +00:00
msgstr ""
"Des agencements différents des arguments peuvent être considérés comme des "
"appels différents avec chacun leur propre entrée dans le cache. Par exemple, "
2022-11-14 15:08:57 +00:00
"``f(a=1, b=2)`` et ``f(b=2, a=1)`` n'ont pas leurs arguments dans le même "
"ordre et peuvent donc avoir des entrées distinctes dans le cache."
2018-09-15 20:37:31 +00:00
#: library/functools.rst:157
2019-09-04 09:35:23 +00:00
msgid ""
"If *user_function* is specified, it must be a callable. This allows the "
"*lru_cache* decorator to be applied directly to a user function, leaving the "
"*maxsize* at its default value of 128::"
msgstr ""
"Si *user_function* est défini, ce doit être un appelable. Ceci permet à "
"*lru_cache* d'être appliqué directement sur une fonction de l'utilisateur, "
"sans préciser *maxsize* (qui est alors défini à sa valeur par défaut, 128) ::"
2019-09-04 09:35:23 +00:00
#: library/functools.rst:165
2018-09-15 20:37:31 +00:00
msgid ""
2016-10-30 09:46:26 +00:00
"If *maxsize* is set to ``None``, the LRU feature is disabled and the cache "
2020-05-24 14:31:50 +00:00
"can grow without bound."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-23 17:20:26 +00:00
"Si *maxsize* est à ``None``, la fonctionnalité LRU est désactivée et le "
"cache peut grossir sans limite."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:168
#, fuzzy
2016-10-30 09:46:26 +00:00
msgid ""
"If *typed* is set to true, function arguments of different types will be "
"cached separately. If *typed* is false, the implementation will usually "
"regard them as equivalent calls and only cache a single result. (Some types "
"such as *str* and *int* may be cached separately even when *typed* is false.)"
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-24 12:04:38 +00:00
"Si *typed* est vrai, les arguments 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."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:174
2020-07-20 08:56:42 +00:00
msgid ""
"Note, type specificity applies only to the function's immediate arguments "
"rather than their contents. The scalar arguments, ``Decimal(42)`` and "
"``Fraction(42)`` are be treated as distinct calls with distinct results. In "
"contrast, the tuple arguments ``('answer', Decimal(42))`` and ``('answer', "
"Fraction(42))`` are treated as equivalent."
msgstr ""
#: library/functools.rst:180
msgid ""
2020-07-20 08:56:42 +00:00
"The wrapped function is instrumented with a :func:`cache_parameters` "
"function that returns a new :class:`dict` showing the values for *maxsize* "
"and *typed*. This is for information purposes only. Mutating the values "
"has no effect."
msgstr ""
"La fonction encapsulée est initialisée par la fonction :func:"
"`cache_parameters` qui renvoie un :class:`dict` contenant les valeurs de "
"*maxsize* et de *typed*. Cela ne sert qu'au débogage, changer ces valeurs "
"n'a pas d'incidence."
2020-07-20 08:56:42 +00:00
#: library/functools.rst:185
#, fuzzy
2016-10-30 09:46:26 +00:00
msgid ""
"To help measure the effectiveness of the cache and tune the *maxsize* "
"parameter, the wrapped function is instrumented with a :func:`cache_info` "
"function that returns a :term:`named tuple` showing *hits*, *misses*, "
"*maxsize* and *currsize*."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-23 17:20:26 +00:00
"Pour aider à mesurer l'efficacité du cache et ajuster le paramètre "
2017-09-24 12:04:38 +00:00
"*maxsize*, la fonction englobée est surveillée avec une fonction :func:"
"`cache_info` qui renvoie un :term:`named tuple` affichant les *hits*, "
2018-09-28 12:32:48 +00:00
"*misses*, *maxsize* et *currsize*. Dans un environnement *multithread*, les "
2017-09-23 17:20:26 +00:00
"succès et échecs d'appel du cache sont approximatifs."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:190
2016-10-30 09:46:26 +00:00
msgid ""
"The decorator also provides a :func:`cache_clear` function for clearing or "
"invalidating the cache."
msgstr ""
2017-09-23 17:20:26 +00:00
"Le décorateur fournit également une fonction :func:`cache_clear` pour vider "
"ou invalider le cache."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:193
2016-10-30 09:46:26 +00:00
msgid ""
"The original underlying function is accessible through the :attr:"
"`__wrapped__` attribute. This is useful for introspection, for bypassing "
"the cache, or for rewrapping the function with a different cache."
msgstr ""
2017-09-23 17:20:26 +00:00
"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."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:197
2016-10-30 09:46:26 +00:00
msgid ""
"The cache keeps references to the arguments and return values until they age "
"out of the cache or until the cache is cleared."
msgstr ""
#: library/functools.rst:200
msgid ""
"If a method is cached, the ``self`` instance argument is included in the "
"cache. See :ref:`faq-cache-method-calls`"
msgstr ""
#: library/functools.rst:203
msgid ""
2016-10-30 09:46:26 +00:00
"An `LRU (least recently used) cache <https://en.wikipedia.org/wiki/"
2020-07-20 08:56:42 +00:00
"Cache_replacement_policies#Least_recently_used_(LRU)>`_ works best when the "
"most recent calls are the best predictors of upcoming calls (for example, "
"the most popular articles on a news server tend to change each day). The "
"cache's size limit assures that the cache does not grow without bound on "
"long-running processes such as web servers."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-23 17:20:26 +00:00
"Un `cache LRU (*least recently used*) <https://fr.wikipedia.org/wiki/"
2022-05-22 21:15:02 +00:00
"Algorithmes_de_remplacement_des_lignes_de_cache#LRU_.28Least_Recently_Used.29>`_ "
"fonctionne de manière optimale 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 à ne changer que d'un jour à l'autre). La "
"taille limite du cache permet de s'assurer que le cache ne grossisse pas "
"sans limite dans les processus à longue durée de vie comme les serveurs Web."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:210
2018-12-24 13:20:55 +00:00
msgid ""
"In general, the LRU cache should only be used when you want to reuse "
"previously computed values. Accordingly, it doesn't make sense to cache "
"functions with side-effects, functions that need to create distinct mutable "
"objects on each call, or impure functions such as time() or random()."
msgstr ""
"En général, le cache LRU ne doit être utilisé que quand vous voulez ré-"
"utiliser les valeurs déjà calculées. Ainsi, cela n'a pas de sens de mettre "
"un cache sur une fonction qui a des effets de bord, qui doit créer un objet "
"mutable distinct à chaque appel ou des fonctions *impures* telles que ``!"
"time()`` ou ``!random()``."
2018-12-24 13:20:55 +00:00
#: library/functools.rst:215
2016-10-30 09:46:26 +00:00
msgid "Example of an LRU cache for static web content::"
msgstr "Exemple d'un cache LRU pour du contenu web statique ::"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:234
2016-10-30 09:46:26 +00:00
msgid ""
"Example of efficiently computing `Fibonacci numbers <https://en.wikipedia."
"org/wiki/Fibonacci_number>`_ using a cache to implement a `dynamic "
"programming <https://en.wikipedia.org/wiki/Dynamic_programming>`_ technique::"
msgstr ""
2017-09-23 17:20:26 +00:00
"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>`_ ::"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:254
2016-10-30 09:46:26 +00:00
msgid "Added the *typed* option."
2017-09-23 17:20:26 +00:00
msgstr "L'option *typed* a été ajoutée."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:257
2019-09-04 09:35:23 +00:00
msgid "Added the *user_function* option."
msgstr "Ajout de l'option *user_function*."
2019-09-04 09:35:23 +00:00
#: library/functools.rst:260
2020-07-20 08:56:42 +00:00
msgid "Added the function :func:`cache_parameters`"
msgstr "Ajout de la fonction :func:`cache_parameters`"
2020-07-20 08:56:42 +00:00
#: library/functools.rst:265
2016-10-30 09:46:26 +00:00
msgid ""
"Given a class defining one or more rich comparison ordering methods, this "
"class decorator supplies the rest. This simplifies the effort involved in "
"specifying all of the possible rich comparison operations:"
msgstr ""
2017-09-23 17:20:26 +00:00
"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 :"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:269
2016-10-30 09:46:26 +00:00
msgid ""
"The class must define one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, "
"or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` "
"method."
msgstr ""
2017-09-23 17:20:26 +00:00
"La classe doit définir au moins une de ces méthodes :meth:`__lt__`, :meth:"
"`__le__`, :meth:`__gt__`, ou :meth:`__ge__`. De plus, la classe doit fournir "
2017-09-23 17:20:26 +00:00
"une méthode :meth:`__eq__`."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:293
2016-10-30 09:46:26 +00:00
msgid ""
"While this decorator makes it easy to create well behaved totally ordered "
"types, it *does* come at the cost of slower execution and more complex stack "
"traces for the derived comparison methods. If performance benchmarking "
"indicates this is a bottleneck for a given application, implementing all six "
"rich comparison methods instead is likely to provide an easy speed boost."
msgstr ""
2017-09-23 17:20:26 +00:00
"Même si ce décorateur permet de créer des types ordonnables facilement, cela "
2017-09-24 12:04:38 +00:00
"vient avec un *coût* d'exécution et des traces d'exécution complexes pour "
"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é."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:302
msgid ""
"This decorator makes no attempt to override methods that have been declared "
"in the class *or its superclasses*. Meaning that if a superclass defines a "
"comparison operator, *total_ordering* will not implement it again, even if "
"the original method is abstract."
msgstr ""
#: library/functools.rst:309
2016-10-30 09:46:26 +00:00
msgid ""
"Returning NotImplemented from the underlying comparison function for "
"unrecognised types is now supported."
msgstr ""
2017-09-23 17:20:26 +00:00
"Retourner NotImplemented dans les fonction de comparaison sous-jacentes pour "
"les types non reconnus est maintenant supporté."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:315
2016-10-30 09:46:26 +00:00
msgid ""
2018-11-29 15:13:39 +00:00
"Return a new :ref:`partial object<partial-objects>` which when called will "
"behave like *func* called with the positional arguments *args* and keyword "
"arguments *keywords*. If more arguments are supplied to the call, they are "
"appended to *args*. If additional keyword arguments are supplied, they "
"extend and override *keywords*. Roughly equivalent to::"
2016-10-30 09:46:26 +00:00
msgstr ""
"Retourne un nouvel :ref:`objet partiel <partial-objects>` qui, quand il est "
"appelé, fonctionne comme *func* appelée avec les arguments positionnels "
"*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*. À peu près équivalent à ::"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:331
2016-10-30 09:46:26 +00:00
msgid ""
2022-03-23 17:40:12 +00:00
"The :func:`partial` is used for partial function application which "
"\"freezes\" some portion of a function's arguments and/or keywords resulting "
"in a new object with a simplified signature. For example, :func:`partial` "
"can be used to create a callable that behaves like the :func:`int` function "
"where the *base* argument defaults to two:"
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-23 17:20:26 +00:00
":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 :"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:346
2016-10-30 09:46:26 +00:00
msgid ""
"Return a new :class:`partialmethod` descriptor which behaves like :class:"
"`partial` except that it is designed to be used as a method definition "
"rather than being directly callable."
msgstr ""
2017-09-23 17:20:26 +00:00
"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."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:350
2016-10-30 09:46:26 +00:00
msgid ""
"*func* must be a :term:`descriptor` or a callable (objects which are both, "
"like normal functions, are handled as descriptors)."
msgstr ""
2017-09-23 17:20:26 +00:00
"*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)."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:353
2016-10-30 09:46:26 +00:00
msgid ""
"When *func* is a descriptor (such as a normal Python function, :func:"
"`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another "
"instance of :class:`partialmethod`), calls to ``__get__`` are delegated to "
2018-11-29 15:13:39 +00:00
"the underlying descriptor, and an appropriate :ref:`partial object<partial-"
"objects>` returned as the result."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-23 17:20:26 +00:00
"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 :ref:`objet partiel <partial-objects>` "
"approprié est renvoyé comme résultat."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:359
2016-10-30 09:46:26 +00:00
msgid ""
"When *func* is a non-descriptor callable, an appropriate bound method is "
"created dynamically. This behaves like a normal Python function when used as "
"a method: the *self* argument will be inserted as the first positional "
"argument, even before the *args* and *keywords* supplied to the :class:"
"`partialmethod` constructor."
msgstr ""
2017-09-23 17:20:26 +00:00
"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`."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:390
2016-10-30 09:46:26 +00:00
msgid ""
2019-09-04 09:35:23 +00:00
"Apply *function* of two arguments cumulatively to the items of *iterable*, "
"from left to right, so as to reduce the iterable to a single value. For "
2016-10-30 09:46:26 +00:00
"example, ``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` calculates "
"``((((1+2)+3)+4)+5)``. The left argument, *x*, is the accumulated value and "
2019-09-04 09:35:23 +00:00
"the right argument, *y*, is the update value from the *iterable*. If the "
2016-10-30 09:46:26 +00:00
"optional *initializer* is present, it is placed before the items of the "
2019-09-04 09:35:23 +00:00
"iterable in the calculation, and serves as a default when the iterable is "
"empty. If *initializer* is not given and *iterable* contains only one item, "
2016-10-30 09:46:26 +00:00
"the first item is returned."
msgstr ""
2017-09-23 17:20:26 +00:00
"Applique *function* avec deux arguments cumulativement aux éléments de "
"*iterable*, 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)``. L'argument de gauche, *x*, est la valeur de cumul et "
"celui de droite, *y*, est la valeur mise à jour depuis *iterable*. Si "
2017-09-23 17:20:26 +00:00
"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 *iterable* "
"ne contient qu'un élément, le premier élément est renvoyé."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:399
2016-10-30 09:46:26 +00:00
msgid "Roughly equivalent to::"
msgstr "À peu près équivalent à ::"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:411
2019-09-04 09:35:23 +00:00
msgid ""
"See :func:`itertools.accumulate` for an iterator that yields all "
"intermediate values."
msgstr ""
"Voir :func:`itertools.accumulate` pour un itérateur qui génère toutes les "
"valeurs intermédiaires."
2019-09-04 09:35:23 +00:00
#: library/functools.rst:416
2016-10-30 09:46:26 +00:00
msgid ""
2017-12-01 06:48:13 +00:00
"Transform a function into a :term:`single-dispatch <single dispatch>` :term:"
2016-10-30 09:46:26 +00:00
"`generic function`."
msgstr ""
2017-09-23 17:20:26 +00:00
"Transforme une fonction en une :term:`fonction générique <generic "
"function>` :term:`single-dispatch <single dispatch>`."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:419
#, fuzzy
2016-10-30 09:46:26 +00:00
msgid ""
"To define a generic function, decorate it with the ``@singledispatch`` "
"decorator. When defining a function using ``@singledispatch``, note that the "
"dispatch happens on the type of the first argument::"
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-23 17:20:26 +00:00
"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 ::"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:430
#, fuzzy
2016-10-30 09:46:26 +00:00
msgid ""
"To add overloaded implementations to the function, use the :func:`register` "
"attribute of the generic function, which can be used as a decorator. For "
"functions annotated with types, the decorator will infer the type of the "
"first argument automatically::"
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-23 17:20:26 +00:00
"Pour ajouter des surcharges d'implémentation à la fonction, utiliser "
2018-07-12 17:40:29 +00:00
"l'attribut :func:`register` de la fonction générique. C'est un décorateur. "
"Pour les fonctions annotées avec des types, le décorateur infère le type du "
"premier argument automatiquement ::"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:448
2022-05-22 21:15:02 +00:00
msgid ":data:`types.UnionType` and :data:`typing.Union` can also be used::"
msgstr ""
#: library/functools.rst:465
2016-10-30 09:46:26 +00:00
msgid ""
2018-06-28 13:32:56 +00:00
"For code which doesn't use type annotations, the appropriate type argument "
"can be passed explicitly to the decorator itself::"
msgstr ""
2018-07-16 05:11:25 +00:00
"Pour le code qui nutilise pas les indications de type, le type souhaité "
"peut être passé explicitement en argument au décorateur ::"
2018-06-28 13:32:56 +00:00
#: library/functools.rst:476
#, fuzzy
2018-06-28 13:32:56 +00:00
msgid ""
"To enable registering :term:`lambdas<lambda>` and pre-existing functions, "
"the :func:`register` attribute can also be used in a functional form::"
2016-10-30 09:46:26 +00:00
msgstr ""
"Pour permettre l'enregistrement de *lambdas* et de fonctions pré-existantes, "
"l'attribut :func:`register` peut être utilisé sous forme fonctionnelle ::"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:484
#, fuzzy
2016-10-30 09:46:26 +00:00
msgid ""
"The :func:`register` attribute returns the undecorated function. This "
"enables decorator stacking, :mod:`pickling<pickle>`, and the creation of "
"unit tests for each variant independently::"
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-24 12:04:38 +00:00
"L'attribut :func:`register` renvoie la fonction non décorée ce qui permet "
2017-09-23 17:20:26 +00:00
"d'empiler les décorateurs, la sérialisation, et la création de tests "
"unitaires pour chaque variante indépendamment ::"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:498
2016-10-30 09:46:26 +00:00
msgid ""
"When called, the generic function dispatches on the type of the first "
"argument::"
msgstr ""
2017-09-23 17:20:26 +00:00
"Quand elle est appelée, la fonction générique distribue sur le type du "
"premier argument ::"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:518
#, fuzzy
2016-10-30 09:46:26 +00:00
msgid ""
"Where there is no registered implementation for a specific type, its method "
"resolution order is used to find a more generic implementation. The original "
"function decorated with ``@singledispatch`` is registered for the base :"
"class:`object` type, which means it is used if no better implementation is "
"found."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-23 17:20:26 +00:00
"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."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:524
2020-07-20 08:56:42 +00:00
msgid ""
"If an implementation is registered to an :term:`abstract base class`, "
"virtual subclasses of the base class will be dispatched to that "
"implementation::"
2020-07-20 08:56:42 +00:00
msgstr ""
#: library/functools.rst:539
#, fuzzy
2016-10-30 09:46:26 +00:00
msgid ""
"To check which implementation the generic function will choose for a given "
2016-10-30 09:46:26 +00:00
"type, use the ``dispatch()`` attribute::"
msgstr ""
2017-09-23 17:20:26 +00:00
"Pour vérifier quelle implémentation la fonction générique choisira pour un "
"type donné, utiliser l'attribut ``dispatch()`` ::"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:547
2016-10-30 09:46:26 +00:00
msgid ""
"To access all registered implementations, use the read-only ``registry`` "
"attribute::"
msgstr ""
2017-09-23 17:20:26 +00:00
"Pour accéder à toutes les implémentations enregistrées, utiliser l'attribut "
"en lecture seule ``registry`` ::"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:561
#, fuzzy
msgid "The :func:`register` attribute now supports using type annotations."
2018-06-28 13:32:56 +00:00
msgstr ""
2018-07-16 05:11:25 +00:00
"Lattribut :func:`register` gère lutilisation des indications de type."
2018-06-28 13:32:56 +00:00
#: library/functools.rst:564
2022-05-22 21:15:02 +00:00
#, fuzzy
msgid ""
"The :func:`register` attribute now supports :data:`types.UnionType` and :"
"data:`typing.Union` as type annotations."
msgstr ""
"Lattribut :func:`register` gère lutilisation des indications de type."
#: library/functools.rst:571
2019-09-04 09:35:23 +00:00
msgid ""
"Transform a method into a :term:`single-dispatch <single dispatch>` :term:"
"`generic function`."
msgstr ""
"Transforme une méthode en une :term:`fonction générique <generic function>` :"
"term:`single-dispatch <single dispatch>`."
2019-09-04 09:35:23 +00:00
#: library/functools.rst:574
#, fuzzy
2019-09-04 09:35:23 +00:00
msgid ""
"To define a generic method, decorate it with the ``@singledispatchmethod`` "
"decorator. When defining a function using ``@singledispatchmethod``, note "
"that the dispatch happens on the type of the first non-*self* or non-*cls* "
"argument::"
2019-09-04 09:35:23 +00:00
msgstr ""
"Pour définir une fonction générique, il faut la décorer avec le décorateur "
"``@singledispatchmethod``. Notez que la distribution est effectuée sur le "
"type du premier argument non *self* ni *cls*, donc la fonction doit être "
"conçue en conséquence ::"
2019-09-04 09:35:23 +00:00
#: library/functools.rst:592
2019-09-04 09:35:23 +00:00
msgid ""
"``@singledispatchmethod`` supports nesting with other decorators such as :"
"func:`@classmethod<classmethod>`. Note that to allow for ``dispatcher."
"register``, ``singledispatchmethod`` must be the *outer most* decorator. "
"Here is the ``Negator`` class with the ``neg`` methods bound to the class, "
"rather than an instance of the class::"
2019-09-04 09:35:23 +00:00
msgstr ""
#: library/functools.rst:614
2019-09-04 09:35:23 +00:00
msgid ""
"The same pattern can be used for other similar decorators: :func:"
"`@staticmethod<staticmethod>`, :func:`@abstractmethod<abc.abstractmethod>`, "
"and others."
2019-09-04 09:35:23 +00:00
msgstr ""
#: library/functools.rst:623
2016-10-30 09:46:26 +00:00
msgid ""
"Update a *wrapper* function to look like the *wrapped* function. The "
"optional arguments are tuples to specify which attributes of the original "
"function are assigned directly to the matching attributes on the wrapper "
"function and which attributes of the wrapper function are updated with the "
"corresponding attributes from the original function. The default values for "
"these arguments are the module level constants ``WRAPPER_ASSIGNMENTS`` "
"(which assigns to the wrapper function's ``__module__``, ``__name__``, "
"``__qualname__``, ``__annotations__`` and ``__doc__``, the documentation "
"string) and ``WRAPPER_UPDATES`` (which updates the wrapper function's "
"``__dict__``, i.e. the instance dictionary)."
msgstr ""
2017-09-23 17:20:26 +00:00
"Met à jour la fonction *wrapper* pour ressembler à la fonction *wrapped*. "
"Les arguments optionnels sont des *n*-uplets 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__``, "
2017-09-23 17:20:26 +00:00
"``__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)."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:633
2016-10-30 09:46:26 +00:00
msgid ""
"To allow access to the original function for introspection and other "
"purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), "
"this function automatically adds a ``__wrapped__`` attribute to the wrapper "
"that refers to the function being wrapped."
msgstr ""
2017-09-23 17:20:26 +00:00
"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."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:638
2016-10-30 09:46:26 +00:00
msgid ""
"The main intended use for this function is in :term:`decorator` functions "
"which wrap the decorated function and return the wrapper. If the wrapper "
"function is not updated, the metadata of the returned function will reflect "
"the wrapper definition rather than the original function definition, which "
"is typically less than helpful."
msgstr ""
2018-09-28 09:36:32 +00:00
"La principale utilisation de cette fonction est dans les :term:`décorateurs "
"<decorator>` qui renvoient une nouvelle fonction. Si la fonction crée n'est "
"pas mise à jour, ses métadonnées refléteront sa définition dans le "
2018-09-28 09:36:32 +00:00
"décorateur, au lieu de la définition originale, métadonnées souvent bien "
"moins utiles."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:644
2016-10-30 09:46:26 +00:00
msgid ""
":func:`update_wrapper` may be used with callables other than functions. Any "
"attributes named in *assigned* or *updated* that are missing from the object "
"being wrapped are ignored (i.e. this function will not attempt to set them "
"on the wrapper function). :exc:`AttributeError` is still raised if the "
"wrapper function itself is missing any attributes named in *updated*."
msgstr ""
2017-09-23 17:20:26 +00:00
":func:`update_wrapper` peut être utilisé avec des appelables autres que des "
"fonctions. Tout attribut défini dans *assigned* ou *updated* qui ne sont pas "
2017-09-23 17:20:26 +00:00
"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*."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:650
2016-10-30 09:46:26 +00:00
msgid "Automatic addition of the ``__wrapped__`` attribute."
2017-09-23 17:20:26 +00:00
msgstr "Ajout automatique de l'attribut ``__wrapped__``."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:653
2016-10-30 09:46:26 +00:00
msgid "Copying of the ``__annotations__`` attribute by default."
2017-09-23 17:20:26 +00:00
msgstr "Copie de l'attribut ``__annotations__`` par défaut."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:656
2016-10-30 09:46:26 +00:00
msgid "Missing attributes no longer trigger an :exc:`AttributeError`."
msgstr ""
2017-09-23 17:20:26 +00:00
"Les attributs manquants ne lèvent plus d'exception :exc:`AttributeError`."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:659
2016-10-30 09:46:26 +00:00
msgid ""
"The ``__wrapped__`` attribute now always refers to the wrapped function, "
"even if that function defined a ``__wrapped__`` attribute. (see :issue:"
"`17482`)"
msgstr ""
2017-09-23 17:20:26 +00:00
"L'attribut ``__wrapped__`` renvoie toujours la fonction englobée, même si "
"cette fonction définit un attribut ``__wrapped__``. (voir :issue:`17482`)"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:667
2016-10-30 09:46:26 +00:00
msgid ""
"This is a convenience function for invoking :func:`update_wrapper` as a "
"function decorator when defining a wrapper function. It is equivalent to "
"``partial(update_wrapper, wrapped=wrapped, assigned=assigned, "
"updated=updated)``. For example::"
msgstr ""
2017-09-23 17:20:26 +00:00
"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 ::"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:693
2016-10-30 09:46:26 +00:00
msgid ""
"Without the use of this decorator factory, the name of the example function "
"would have been ``'wrapper'``, and the docstring of the original :func:"
"`example` would have been lost."
msgstr ""
2017-09-23 17:20:26 +00:00
"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."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:701
2016-10-30 09:46:26 +00:00
msgid ":class:`partial` Objects"
2017-09-23 17:20:26 +00:00
msgstr "Objets :class:`partial`"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:703
2016-10-30 09:46:26 +00:00
msgid ""
":class:`partial` objects are callable objects created by :func:`partial`. "
"They have three read-only attributes:"
msgstr ""
2017-09-23 17:20:26 +00:00
"Les objets :class:`partial` sont des objets appelables créés par :func:"
"`partial`. Ils ont trois attributs en lecture seule :"
2016-10-30 09:46:26 +00:00
#: library/functools.rst:709
2016-10-30 09:46:26 +00:00
msgid ""
"A callable object or function. Calls to the :class:`partial` object will be "
"forwarded to :attr:`func` with new arguments and keywords."
msgstr ""
2017-09-23 17:20:26 +00:00
"Un objet ou une fonction appelable. Les appels à l'objet :class:`partial` "
"seront transmis à :attr:`func` avec les nouveaux arguments et mots-clés."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:715
2016-10-30 09:46:26 +00:00
msgid ""
"The leftmost positional arguments that will be prepended to the positional "
"arguments provided to a :class:`partial` object call."
msgstr ""
2017-09-23 17:20:26 +00:00
"Les arguments positionnels qui seront ajoutés avant les arguments fournis "
"lors de l'appel d'un objet :class:`partial`."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:721
2016-10-30 09:46:26 +00:00
msgid ""
"The keyword arguments that will be supplied when the :class:`partial` object "
"is called."
msgstr ""
2017-09-23 17:20:26 +00:00
"Les arguments nommés qui seront fournis quand l'objet :class:`partial` est "
"appelé."
2016-10-30 09:46:26 +00:00
#: library/functools.rst:724
2016-10-30 09:46:26 +00:00
msgid ""
":class:`partial` objects are like :class:`function` objects in that they are "
"callable, weak referencable, and can have attributes. There are some "
"important differences. For instance, the :attr:`~definition.__name__` and :"
"attr:`__doc__` attributes are not created automatically. Also, :class:"
"`partial` objects defined in classes behave like static methods and do not "
"transform into bound methods during instance attribute look-up."
msgstr ""
2017-09-23 17:20:26 +00:00
"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."