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-05-30 21:31:16 +00:00
|
|
|
|
"Project-Id-Version: Python 3.7\n"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
"Report-Msgid-Bugs-To: \n"
|
2017-04-02 20:14:06 +00:00
|
|
|
|
"POT-Creation-Date: 2017-04-02 22:11+0200\n"
|
2019-05-30 21:42:39 +00:00
|
|
|
|
"PO-Revision-Date: 2019-05-30 23:41+0200\n"
|
|
|
|
|
"Last-Translator: Julien Palard <julien@palard.fr>\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"
|
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:2
|
|
|
|
|
msgid ":mod:`numbers` --- Numeric abstract base classes"
|
2019-05-30 21:42:39 +00:00
|
|
|
|
msgstr ":mod:`numbers` — Classes de base abstraites numériques"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:7
|
|
|
|
|
msgid "**Source code:** :source:`Lib/numbers.py`"
|
2019-05-30 21:42:39 +00:00
|
|
|
|
msgstr "**Code source :** :source:`Lib/numbers.py`"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:11
|
|
|
|
|
msgid ""
|
|
|
|
|
"The :mod:`numbers` module (:pep:`3141`) defines a hierarchy of numeric :term:"
|
|
|
|
|
"`abstract base classes <abstract base class>` which progressively define "
|
|
|
|
|
"more operations. None of the types defined in this module can be "
|
|
|
|
|
"instantiated."
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"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é."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:18
|
|
|
|
|
msgid ""
|
|
|
|
|
"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)``."
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"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)``."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:23
|
|
|
|
|
msgid "The numeric tower"
|
2019-05-30 21:31:16 +00:00
|
|
|
|
msgstr "La tour numérique"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:27
|
|
|
|
|
msgid ""
|
|
|
|
|
"Subclasses of this type describe complex numbers and include the operations "
|
|
|
|
|
"that work on the built-in :class:`complex` type. These are: conversions to :"
|
|
|
|
|
"class:`complex` and :class:`bool`, :attr:`.real`, :attr:`.imag`, ``+``, ``-"
|
|
|
|
|
"``, ``*``, ``/``, :func:`abs`, :meth:`conjugate`, ``==``, and ``!=``. All "
|
|
|
|
|
"except ``-`` and ``!=`` are abstract."
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"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."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:35
|
|
|
|
|
msgid "Abstract. Retrieves the real component of this number."
|
2019-05-30 21:31:16 +00:00
|
|
|
|
msgstr "Abstrait. Récupère la partie réelle de ce nombre."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:39
|
|
|
|
|
msgid "Abstract. Retrieves the imaginary component of this number."
|
2019-05-30 21:42:39 +00:00
|
|
|
|
msgstr "Abstrait. Retrouve la partie imaginaire de ce nombre."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:43
|
|
|
|
|
msgid ""
|
|
|
|
|
"Abstract. Returns the complex conjugate. For example, ``(1+3j).conjugate() "
|
|
|
|
|
"== (1-3j)``."
|
|
|
|
|
msgstr ""
|
2019-05-30 21:42:39 +00:00
|
|
|
|
"Abstrait. Renvoie le complexe conjugué. Par exemple, ``(1+3j).conjugate() == "
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"(1-3j)``."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:48
|
|
|
|
|
msgid ""
|
|
|
|
|
"To :class:`Complex`, :class:`Real` adds the operations that work on real "
|
|
|
|
|
"numbers."
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
":class:`Real` ajoute les opérations qui fonctionnent sur les nombres réels "
|
|
|
|
|
"à :class:`Complex`."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:51
|
|
|
|
|
msgid ""
|
|
|
|
|
"In short, those are: a conversion to :class:`float`, :func:`math.trunc`, :"
|
|
|
|
|
"func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:`divmod`, ``//``, "
|
|
|
|
|
"``%``, ``<``, ``<=``, ``>``, and ``>=``."
|
|
|
|
|
msgstr ""
|
2019-05-30 21:42:39 +00:00
|
|
|
|
"En bref, celles-ci sont : une conversion vers :class:`float`, :func:`math."
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"trunc`, :func:`round`, :func:`math.floor`, :func:`math.ceil`, :func:"
|
2019-05-30 21:42:39 +00:00
|
|
|
|
"`divmod`, ``//``, ``%``, ``<``, ``<=``, ``>`` et ``>=``."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:55
|
|
|
|
|
msgid ""
|
|
|
|
|
"Real also provides defaults for :func:`complex`, :attr:`~Complex.real`, :"
|
|
|
|
|
"attr:`~Complex.imag`, and :meth:`~Complex.conjugate`."
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"*Real* fournit également des valeurs par défaut pour :func:`complex`, :attr:"
|
2019-05-30 21:42:39 +00:00
|
|
|
|
"`~Complex.real`, :attr:`~Complex.imag` et :meth:`~Complex.conjugate`."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:61
|
|
|
|
|
msgid ""
|
|
|
|
|
"Subtypes :class:`Real` and adds :attr:`~Rational.numerator` and :attr:"
|
|
|
|
|
"`~Rational.denominator` properties, which should be in lowest terms. With "
|
|
|
|
|
"these, it provides a default for :func:`float`."
|
|
|
|
|
msgstr ""
|
2019-05-30 21:42:39 +00:00
|
|
|
|
"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`."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:68 ../Doc/library/numbers.rst:72
|
|
|
|
|
msgid "Abstract."
|
2019-05-30 21:42:39 +00:00
|
|
|
|
msgstr "Abstrait."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:77
|
|
|
|
|
msgid ""
|
|
|
|
|
"Subtypes :class:`Rational` and adds a conversion to :class:`int`. Provides "
|
|
|
|
|
"defaults for :func:`float`, :attr:`~Rational.numerator`, and :attr:"
|
|
|
|
|
"`~Rational.denominator`. Adds abstract methods for ``**`` and bit-string "
|
|
|
|
|
"operations: ``<<``, ``>>``, ``&``, ``^``, ``|``, ``~``."
|
|
|
|
|
msgstr ""
|
2019-05-30 21:42:39 +00:00
|
|
|
|
"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: ``<<``, ``>>``, ``&``, ``^``, ``|``, "
|
|
|
|
|
"``~``."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:84
|
|
|
|
|
msgid "Notes for type implementors"
|
2019-05-30 21:31:16 +00:00
|
|
|
|
msgstr "Notes pour implémenter des types"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:86
|
|
|
|
|
msgid ""
|
|
|
|
|
"Implementors should be careful to make equal numbers equal and hash them to "
|
|
|
|
|
"the same values. This may be subtle if there are two different extensions of "
|
|
|
|
|
"the real numbers. For example, :class:`fractions.Fraction` implements :func:"
|
|
|
|
|
"`hash` as follows::"
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"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 ::"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:105
|
|
|
|
|
msgid "Adding More Numeric ABCs"
|
2019-05-30 21:31:16 +00:00
|
|
|
|
msgstr "Ajouter plus d'ABC numériques"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:107
|
|
|
|
|
msgid ""
|
|
|
|
|
"There are, of course, more possible ABCs for numbers, and this would be a "
|
|
|
|
|
"poor hierarchy if it precluded the possibility of adding those. You can add "
|
|
|
|
|
"``MyFoo`` between :class:`Complex` and :class:`Real` with::"
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"Il est bien entendu possible de créer davantage d’ABC 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 ::"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:119
|
|
|
|
|
msgid "Implementing the arithmetic operations"
|
2019-05-30 21:31:16 +00:00
|
|
|
|
msgstr "Implémentation des opérations arithmétiques"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:121
|
|
|
|
|
msgid ""
|
|
|
|
|
"We want to implement the arithmetic operations so that mixed-mode operations "
|
|
|
|
|
"either call an implementation whose author knew about the types of both "
|
|
|
|
|
"arguments, or convert both to the nearest built in type and do the operation "
|
|
|
|
|
"there. For subtypes of :class:`Integral`, this means that :meth:`__add__` "
|
|
|
|
|
"and :meth:`__radd__` should be defined as::"
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"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__` "
|
2019-05-30 21:42:39 +00:00
|
|
|
|
"devraient être définis comme suit ::"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:152
|
|
|
|
|
msgid ""
|
|
|
|
|
"There are 5 different cases for a mixed-type operation on subclasses of :"
|
|
|
|
|
"class:`Complex`. I'll refer to all of the above code that doesn't refer to "
|
|
|
|
|
"``MyIntegral`` and ``OtherTypeIKnowAbout`` as \"boilerplate\". ``a`` will be "
|
|
|
|
|
"an instance of ``A``, which is a subtype of :class:`Complex` (``a : A <: "
|
|
|
|
|
"Complex``), and ``b : B <: Complex``. I'll consider ``a + b``:"
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"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``:"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:159
|
|
|
|
|
msgid "If ``A`` defines an :meth:`__add__` which accepts ``b``, all is well."
|
2019-05-30 21:31:16 +00:00
|
|
|
|
msgstr "Si ``A`` définit une :meth:`__add__` qui accepte ``b``, tout va bien."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:161
|
|
|
|
|
msgid ""
|
|
|
|
|
"If ``A`` falls back to the boilerplate code, and it were to return a value "
|
|
|
|
|
"from :meth:`__add__`, we'd miss the possibility that ``B`` defines a more "
|
|
|
|
|
"intelligent :meth:`__radd__`, so the boilerplate should return :const:"
|
|
|
|
|
"`NotImplemented` from :meth:`__add__`. (Or ``A`` may not implement :meth:"
|
|
|
|
|
"`__add__` at all.)"
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"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.)"
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:167
|
|
|
|
|
msgid ""
|
|
|
|
|
"Then ``B``'s :meth:`__radd__` gets a chance. If it accepts ``a``, all is "
|
|
|
|
|
"well."
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"Alors :meth:`__radd__` de ``B`` a une chance. si elle accepte ``a``, tout va "
|
|
|
|
|
"bien."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:169
|
|
|
|
|
msgid ""
|
|
|
|
|
"If it falls back to the boilerplate, there are no more possible methods to "
|
|
|
|
|
"try, so this is where the default implementation should live."
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"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."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:172
|
|
|
|
|
msgid ""
|
|
|
|
|
"If ``B <: A``, Python tries ``B.__radd__`` before ``A.__add__``. This is ok, "
|
|
|
|
|
"because it was implemented with knowledge of ``A``, so it can handle those "
|
|
|
|
|
"instances before delegating to :class:`Complex`."
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"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`."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:177
|
|
|
|
|
msgid ""
|
|
|
|
|
"If ``A <: Complex`` and ``B <: Real`` without sharing any other knowledge, "
|
|
|
|
|
"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``."
|
|
|
|
|
msgstr ""
|
2019-05-30 21:42:39 +00:00
|
|
|
|
"Si ``A <: Complex`` et ``B <: Real`` sans autre information, alors "
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"l'opération commune appropriée est celle impliquant :class:`complex` et les "
|
|
|
|
|
"deux :meth:`__radd__` atterrissent à cet endroit, donc ``a+b == b+a``."
|
2016-10-30 09:46:26 +00:00
|
|
|
|
|
|
|
|
|
#: ../Doc/library/numbers.rst:182
|
|
|
|
|
msgid ""
|
|
|
|
|
"Because most of the operations on any given type will be very similar, it "
|
|
|
|
|
"can be useful to define a helper function which generates the forward and "
|
|
|
|
|
"reverse instances of any given operator. For example, :class:`fractions."
|
|
|
|
|
"Fraction` uses::"
|
|
|
|
|
msgstr ""
|
2019-05-30 21:31:16 +00:00
|
|
|
|
"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 ::"
|