# Copyright (C) 2001-2018, Python Software Foundation # For licence information, see README file. # msgid "" msgstr "" "Project-Id-Version: Python 3\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-27 10:27+0100\n" "PO-Revision-Date: 2019-02-21 17:18+0100\n" "Last-Translator: \n" "Language-Team: FRENCH \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Poedit 2.0.2\n" #: library/copy.rst:2 msgid ":mod:`copy` --- Shallow and deep copy operations" msgstr ":mod:`copy` — Opérations de copie superficielle et récursive" #: library/copy.rst:7 msgid "**Source code:** :source:`Lib/copy.py`" msgstr "**Code source :** :source:`Lib/copy.py`" #: library/copy.rst:11 msgid "" "Assignment statements in Python do not copy objects, they create bindings " "between a target and an object. For collections that are mutable or contain " "mutable items, a copy is sometimes needed so one can change one copy without " "changing the other. This module provides generic shallow and deep copy " "operations (explained below)." msgstr "" "Les instructions d'affectation en Python ne copient pas les objets, elles " "créent des liens entre la cible et l'objet. Concernant les collections qui " "sont muables ou contiennent des éléments muables, une copie est parfois " "nécessaire, pour pouvoir modifier une copie sans modifier l'autre. Ce module " "met à disposition des opérations de copie génériques superficielle et " "récursive (comme expliqué ci-dessous)." #: library/copy.rst:18 msgid "Interface summary:" msgstr "Résumé de l'interface :" #: library/copy.rst:22 msgid "Return a shallow copy of *x*." msgstr "Renvoie une copie superficielle de *x*." #: library/copy.rst:27 msgid "Return a deep copy of *x*." msgstr "Renvoie une copie récursive de *x*." #: library/copy.rst:32 msgid "Raised for module specific errors." msgstr "Levée pour les erreurs spécifiques au module." #: library/copy.rst:36 msgid "" "The difference between shallow and deep copying is only relevant for " "compound objects (objects that contain other objects, like lists or class " "instances):" msgstr "" "La différence entre copie superficielle et récursive n'est pertinente que " "pour les objets composés (objets contenant d'autres objets, comme des listes " "ou des instances de classe) :" #: library/copy.rst:39 msgid "" "A *shallow copy* constructs a new compound object and then (to the extent " "possible) inserts *references* into it to the objects found in the original." msgstr "" "Une *copie superficielle* construit un nouvel objet composé puis (dans la " "mesure du possible) insère dans l'objet composé des *références* aux objets " "trouvés dans l'original." #: library/copy.rst:42 msgid "" "A *deep copy* constructs a new compound object and then, recursively, " "inserts *copies* into it of the objects found in the original." msgstr "" "Une *copie récursive (ou profonde)* construit un nouvel objet composé puis, " "récursivement, insère dans l'objet composé des *copies* des objets trouvés " "dans l'objet original." #: library/copy.rst:45 msgid "" "Two problems often exist with deep copy operations that don't exist with " "shallow copy operations:" msgstr "" "On rencontre souvent deux problèmes avec les opérations de copie récursive " "qui n'existent pas avec les opérations de copie superficielle :" #: library/copy.rst:48 msgid "" "Recursive objects (compound objects that, directly or indirectly, contain a " "reference to themselves) may cause a recursive loop." msgstr "" "Les objets récursifs (objets composés qui, directement ou indirectement, " "contiennent une référence à eux-mêmes) peuvent causer une boucle récursive." #: library/copy.rst:51 msgid "" "Because deep copy copies everything it may copy too much, such as data which " "is intended to be shared between copies." msgstr "" "Comme une copie récursive copie tout, elle peut en copier trop, par exemple " "des données qui sont destinées à être partagées entre différentes copies." #: library/copy.rst:54 msgid "The :func:`deepcopy` function avoids these problems by:" msgstr "La fonction :func:`deepcopy` évite ces problèmes en :" #: library/copy.rst:56 msgid "" "keeping a ``memo`` dictionary of objects already copied during the current " "copying pass; and" msgstr "" "gardant en mémoire dans un dictionnaire ``memo`` les objets déjà copiés " "durant la phase de copie actuelle ; et" #: library/copy.rst:59 msgid "" "letting user-defined classes override the copying operation or the set of " "components copied." msgstr "" "laissant les classes créées par l'utilisateur écraser l'opération de copie " "ou l'ensemble de composants copiés." #: library/copy.rst:62 #, fuzzy msgid "" "This module does not copy types like module, method, stack trace, stack " "frame, file, socket, window, or any similar types. It does \"copy\" " "functions and classes (shallow and deeply), by returning the original object " "unchanged; this is compatible with the way these are treated by the :mod:" "`pickle` module." msgstr "" "Ce module ne copie pas les types tels que module, méthode, trace d'appels, " "cadre de pile, fichier, socket, fenêtre, tableau, ou tout autre type " "similaire. Il \"copie\" les fonctions et les classes (superficiellement et " "récursivement), en retournant l'objet original inchangé ; c'est compatible " "avec la manière dont ils sont traités par le module :mod:`pickle`." #: library/copy.rst:67 msgid "" "Shallow copies of dictionaries can be made using :meth:`dict.copy`, and of " "lists by assigning a slice of the entire list, for example, ``copied_list = " "original_list[:]``." msgstr "" "Les copies superficielles de dictionnaires peuvent être faites en utilisant :" "meth:`dict.copy`, et de listes en affectant un ``slice`` de la liste, par " "exemple, ``copied_list = original_list[:]``." #: library/copy.rst:73 msgid "" "Classes can use the same interfaces to control copying that they use to " "control pickling. See the description of module :mod:`pickle` for " "information on these methods. In fact, the :mod:`copy` module uses the " "registered pickle functions from the :mod:`copyreg` module." msgstr "" "Les classes peuvent utiliser les mêmes interfaces de contrôle que celles " "utilisées pour la sérialisation. Voir la description du module :mod:`pickle` " "pour plus d'informations sur ces méthodes. En effet, le module :mod:`copy` " "utilise les fonctions de sérialisation enregistrées à partir du module :mod:" "`copyreg`." #: library/copy.rst:82 #, fuzzy msgid "" "In order for a class to define its own copy implementation, it can define " "special methods :meth:`__copy__` and :meth:`__deepcopy__`. The former is " "called to implement the shallow copy operation; no additional arguments are " "passed. The latter is called to implement the deep copy operation; it is " "passed one argument, the ``memo`` dictionary. If the :meth:`__deepcopy__` " "implementation needs to make a deep copy of a component, it should call the :" "func:`deepcopy` function with the component as first argument and the memo " "dictionary as second argument. The memo dictionary should be treated as an " "opaque object." msgstr "" "Afin qu'une classe définisse sa propre implémentation de copie, elle peut " "définir les méthodes spéciales :meth:`__copy__` et :meth:`__deepcopy__`. La " "première est appelée pour implémenter l'opération de copie superficielle ; " "aucun argument supplémentaire n'est passé. La seconde est appelée pour " "implémenter l'opération de copie récursive ; elle reçoit un argument, le " "dictionnaire ``memo``. Si l'implémentation de :meth:`__deepcopy__` a besoin " "de faire une copie récursive d'un composant, elle doit appeler la fonction :" "func:`deepcopy` avec le composant comme premier argument et le dictionnaire " "*memo* comme second argument." #: library/copy.rst:95 msgid "Module :mod:`pickle`" msgstr "Module :mod:`pickle`" #: library/copy.rst:95 msgid "" "Discussion of the special methods used to support object state retrieval and " "restoration." msgstr "" "Discussion sur les méthodes spéciales utilisées pour gérer la récupération " "et la restauration de l'état d'un objet."