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

8269 lines
345 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"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-02-12 11:56+0100\n"
"PO-Revision-Date: 2023-04-04 21:42+0200\n"
2022-05-22 21:15:02 +00:00
"Last-Translator: Loc Cosnier <loc.cosnier@pm.me>\n"
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
2017-05-15 11:29:27 +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"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Poedit 3.2.1\n"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:8
2016-10-30 09:46:26 +00:00
msgid "Built-in Types"
msgstr "Types natifs"
#: library/stdtypes.rst:10
2016-10-30 09:46:26 +00:00
msgid ""
"The following sections describe the standard types that are built into the "
"interpreter."
msgstr ""
"Les sections suivantes décrivent les types standards intégrés à "
"l'interpréteur."
#: library/stdtypes.rst:15
2016-10-30 09:46:26 +00:00
msgid ""
"The principal built-in types are numerics, sequences, mappings, classes, "
"instances and exceptions."
msgstr ""
"Les principaux types natifs sont les numériques, les séquences, les "
"dictionnaires, les classes, les instances et les exceptions."
#: library/stdtypes.rst:18
2016-10-30 09:46:26 +00:00
msgid ""
"Some collection classes are mutable. The methods that add, subtract, or "
"rearrange their members in place, and don't return a specific item, never "
"return the collection instance itself but ``None``."
msgstr ""
"Certaines classes de collection sont muables. Les méthodes qui ajoutent, "
2016-10-30 09:46:26 +00:00
"retirent, ou réorganisent leurs éléments sur place, et qui ne renvoient pas "
"un élément spécifique, ne renvoient jamais l'instance de la collection elle-"
"même, mais ``None``."
#: library/stdtypes.rst:22
2016-10-30 09:46:26 +00:00
msgid ""
"Some operations are supported by several object types; in particular, "
2019-09-04 09:35:23 +00:00
"practically all objects can be compared for equality, tested for truth "
"value, and converted to a string (with the :func:`repr` function or the "
"slightly different :func:`str` function). The latter function is implicitly "
"used when an object is written by the :func:`print` function."
2016-10-30 09:46:26 +00:00
msgstr ""
2020-03-21 10:39:49 +00:00
"Certaines opérations sont prises en charge par plusieurs types d'objets ; en "
"particulier, pratiquement tous les objets peuvent être comparés en égalité, "
"testés en véridicité (valeur booléenne) et convertis en une chaîne de "
"caractères (avec la fonction :func:`repr` ou la fonction légèrement "
"différente :func:`str`). Cette dernière est implicitement utilisée quand un "
"objet est affiché par la fonction :func:`print`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:32
2016-10-30 09:46:26 +00:00
msgid "Truth Value Testing"
msgstr "Valeurs booléennes"
#: library/stdtypes.rst:41
2016-10-30 09:46:26 +00:00
msgid ""
"Any object can be tested for truth value, for use in an :keyword:`if` or :"
2017-08-01 11:29:09 +00:00
"keyword:`while` condition or as operand of the Boolean operations below."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-08-01 12:16:10 +00:00
"Tout objet peut être comparé à une valeur booléenne, typiquement dans une "
"condition :keyword:`if` ou :keyword:`while` ou comme opérande des opérations "
"booléennes ci-dessous."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:46
2017-08-01 11:29:09 +00:00
msgid ""
"By default, an object is considered true unless its class defines either a :"
"meth:`__bool__` method that returns ``False`` or a :meth:`__len__` method "
"that returns zero, when called with the object. [1]_ Here are most of the "
"built-in objects considered false:"
msgstr ""
2017-08-01 22:11:48 +00:00
"Par défaut, tout objet est considéré vrai à moins que sa classe définisse "
"soit une méthode :meth:`__bool__` renvoyant ``False`` soit une méthode :meth:"
"`__len__` renvoyant zéro lorsqu'elle est appelée avec l'objet [1]_. Voici la "
2020-03-21 10:39:49 +00:00
"majorité des objets natifs considérés comme étant faux :"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:55
2017-08-01 11:29:09 +00:00
msgid "constants defined to be false: ``None`` and ``False``."
msgstr "les constantes définies comme étant fausses : ``None`` et ``False`` ;"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:57
2016-10-30 09:46:26 +00:00
msgid ""
2017-08-01 11:29:09 +00:00
"zero of any numeric type: ``0``, ``0.0``, ``0j``, ``Decimal(0)``, "
"``Fraction(0, 1)``"
2017-08-01 12:16:10 +00:00
msgstr ""
2020-03-21 10:39:49 +00:00
"zéro de tout type numérique : ``0``, ``0.0``, ``0j``, ``Decimal(0)``, "
"``Fraction(0, 1)`` ;"
2016-10-30 09:46:26 +00:00
# fin d'énumération
#: library/stdtypes.rst:60
2016-10-30 09:46:26 +00:00
msgid ""
2017-08-01 11:29:09 +00:00
"empty sequences and collections: ``''``, ``()``, ``[]``, ``{}``, ``set()``, "
"``range(0)``"
2016-10-30 09:46:26 +00:00
msgstr ""
2020-03-21 10:39:49 +00:00
"les chaînes et collections vides : ``''``, ``()``, ``[]``, ``{}``, "
"``set()``, ``range(0)``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:69
2016-10-30 09:46:26 +00:00
msgid ""
"Operations and built-in functions that have a Boolean result always return "
"``0`` or ``False`` for false and ``1`` or ``True`` for true, unless "
"otherwise stated. (Important exception: the Boolean operations ``or`` and "
"``and`` always return one of their operands.)"
msgstr ""
"Les opérations et fonctions natives dont le résultat est booléen renvoient "
2016-10-30 09:46:26 +00:00
"toujours ``0`` ou ``False`` pour faux et ``1`` ou ``True`` pour vrai, sauf "
"indication contraire (exception importante : les opérations booléennes "
"``or`` et ``and`` renvoient toujours l'une de leurs opérandes)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:78
2018-12-24 13:20:55 +00:00
msgid "Boolean Operations --- :keyword:`!and`, :keyword:`!or`, :keyword:`!not`"
2016-10-30 09:46:26 +00:00
msgstr ""
"Opérations booléennes — :keyword:`!and`, :keyword:`!or`, :keyword:`!not`"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:82
2016-10-30 09:46:26 +00:00
msgid "These are the Boolean operations, ordered by ascending priority:"
2020-03-21 10:39:49 +00:00
msgstr "Ce sont les opérations booléennes, classées par priorité ascendante :"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:143 library/stdtypes.rst:364 library/stdtypes.rst:921
#: library/stdtypes.rst:1126
2016-10-30 09:46:26 +00:00
msgid "Operation"
msgstr "Opération"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:275 library/stdtypes.rst:414 library/stdtypes.rst:1126
2016-10-30 09:46:26 +00:00
msgid "Result"
msgstr "Résultat"
#: library/stdtypes.rst:275 library/stdtypes.rst:921 library/stdtypes.rst:2371
#: library/stdtypes.rst:3589
2016-10-30 09:46:26 +00:00
msgid "Notes"
msgstr "Notes"
#: library/stdtypes.rst:87
2016-10-30 09:46:26 +00:00
msgid "``x or y``"
msgstr "``x or y``"
#: library/stdtypes.rst:87
2016-10-30 09:46:26 +00:00
msgid "if *x* is false, then *y*, else *x*"
msgstr "si *x* est faux, alors *y*, sinon *x*"
#: library/stdtypes.rst:285 library/stdtypes.rst:926 library/stdtypes.rst:2377
#: library/stdtypes.rst:3595
2016-10-30 09:46:26 +00:00
msgid "\\(1)"
msgstr "\\(1)"
#: library/stdtypes.rst:90
2016-10-30 09:46:26 +00:00
msgid "``x and y``"
msgstr "``x and y``"
#: library/stdtypes.rst:90
2016-10-30 09:46:26 +00:00
msgid "if *x* is false, then *x*, else *y*"
msgstr "si *x* est faux, alors *x*, sinon *y*"
#: library/stdtypes.rst:288 library/stdtypes.rst:1165 library/stdtypes.rst:2383
#: library/stdtypes.rst:3601
2016-10-30 09:46:26 +00:00
msgid "\\(2)"
msgstr "\\(2)"
#: library/stdtypes.rst:93
2016-10-30 09:46:26 +00:00
msgid "``not x``"
msgstr "``not x``"
#: library/stdtypes.rst:93
2016-10-30 09:46:26 +00:00
msgid "if *x* is false, then ``True``, else ``False``"
msgstr "si *x* est faux, alors ``True``, sinon ``False``"
#: library/stdtypes.rst:935 library/stdtypes.rst:2385 library/stdtypes.rst:2389
#: library/stdtypes.rst:3603 library/stdtypes.rst:3607
#: library/stdtypes.rst:3609
2016-10-30 09:46:26 +00:00
msgid "\\(3)"
msgstr "\\(3)"
#: library/stdtypes.rst:319 library/stdtypes.rst:972 library/stdtypes.rst:2417
#: library/stdtypes.rst:3639
2016-10-30 09:46:26 +00:00
msgid "Notes:"
msgstr "Notes :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:105
2016-10-30 09:46:26 +00:00
msgid ""
"This is a short-circuit operator, so it only evaluates the second argument "
2017-04-02 20:14:06 +00:00
"if the first one is false."
2016-10-30 09:46:26 +00:00
msgstr ""
"C'est un opérateur court-circuit : il n'évalue le deuxième argument que si "
"le premier est faux."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:109
2016-10-30 09:46:26 +00:00
msgid ""
"This is a short-circuit operator, so it only evaluates the second argument "
2017-04-02 20:14:06 +00:00
"if the first one is true."
2016-10-30 09:46:26 +00:00
msgstr ""
"C'est un opérateur court-circuit, il n'évalue le deuxième argument que si le "
2017-05-15 11:29:27 +00:00
"premier est vrai."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:113
2016-10-30 09:46:26 +00:00
msgid ""
"``not`` has a lower priority than non-Boolean operators, so ``not a == b`` "
"is interpreted as ``not (a == b)``, and ``a == not b`` is a syntax error."
msgstr ""
"``not`` a une priorité inférieure à celle des opérateurs non-booléens, donc "
"``not a == b`` est interprété comme ``not (a == b)`` et ``a == not b`` est "
"une erreur de syntaxe."
#: library/stdtypes.rst:120
2016-10-30 09:46:26 +00:00
msgid "Comparisons"
msgstr "Comparaisons"
#: library/stdtypes.rst:134
2016-10-30 09:46:26 +00:00
msgid ""
"There are eight comparison operations in Python. They all have the same "
"priority (which is higher than that of the Boolean operations). Comparisons "
"can be chained arbitrarily; for example, ``x < y <= z`` is equivalent to ``x "
"< y and y <= z``, except that *y* is evaluated only once (but in both cases "
"*z* is not evaluated at all when ``x < y`` is found to be false)."
msgstr ""
"Il y a huit opérations de comparaison en Python. Elles ont toutes la même "
"priorité (qui est supérieure à celle des opérations booléennes). Les "
2020-03-21 10:39:49 +00:00
"comparaisons peuvent être enchaînées arbitrairement ; par exemple, ``x < y "
"<= z`` est équivalent à ``x < y and y <= z``, sauf que *y* n'est évalué "
"qu'une seule fois (mais dans les deux cas *z* n'est pas évalué du tout quand "
"``x < y`` est faux)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:140
2016-10-30 09:46:26 +00:00
msgid "This table summarizes the comparison operations:"
2020-03-21 10:39:49 +00:00
msgstr "Ce tableau résume les opérations de comparaison :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2348 library/stdtypes.rst:3566
#: library/stdtypes.rst:3589
2016-10-30 09:46:26 +00:00
msgid "Meaning"
msgstr "Signification"
#: library/stdtypes.rst:145
2016-10-30 09:46:26 +00:00
msgid "``<``"
msgstr "``<``"
#: library/stdtypes.rst:145
2016-10-30 09:46:26 +00:00
msgid "strictly less than"
msgstr "strictement inférieur"
#: library/stdtypes.rst:147
2016-10-30 09:46:26 +00:00
msgid "``<=``"
msgstr "``<=``"
#: library/stdtypes.rst:147
2016-10-30 09:46:26 +00:00
msgid "less than or equal"
msgstr "inférieur ou égal"
#: library/stdtypes.rst:149
2016-10-30 09:46:26 +00:00
msgid "``>``"
msgstr "``>``"
#: library/stdtypes.rst:149
2016-10-30 09:46:26 +00:00
msgid "strictly greater than"
msgstr "strictement supérieur"
#: library/stdtypes.rst:151
2016-10-30 09:46:26 +00:00
msgid "``>=``"
msgstr "``>=``"
#: library/stdtypes.rst:151
2016-10-30 09:46:26 +00:00
msgid "greater than or equal"
msgstr "supérieur ou égal"
#: library/stdtypes.rst:153
2016-10-30 09:46:26 +00:00
msgid "``==``"
msgstr "``==``"
#: library/stdtypes.rst:153
2016-10-30 09:46:26 +00:00
msgid "equal"
msgstr "égal"
#: library/stdtypes.rst:155
2016-10-30 09:46:26 +00:00
msgid "``!=``"
msgstr "``!=``"
#: library/stdtypes.rst:155
2016-10-30 09:46:26 +00:00
msgid "not equal"
msgstr "différent"
#: library/stdtypes.rst:157
2016-10-30 09:46:26 +00:00
msgid "``is``"
msgstr "``is``"
#: library/stdtypes.rst:157
2016-10-30 09:46:26 +00:00
msgid "object identity"
msgstr "identité d'objet"
#: library/stdtypes.rst:159
2016-10-30 09:46:26 +00:00
msgid "``is not``"
msgstr "``is not``"
#: library/stdtypes.rst:159
2016-10-30 09:46:26 +00:00
msgid "negated object identity"
msgstr "contraire de l'identité d'objet"
#: library/stdtypes.rst:166
2016-10-30 09:46:26 +00:00
msgid ""
"Objects of different types, except different numeric types, never compare "
2019-09-04 09:35:23 +00:00
"equal. The ``==`` operator is always defined but for some object types (for "
"example, class objects) is equivalent to :keyword:`is`. The ``<``, ``<=``, "
"``>`` and ``>=`` operators are only defined where they make sense; for "
"example, they raise a :exc:`TypeError` exception when one of the arguments "
"is a complex number."
msgstr ""
"Vous ne pouvez pas tester l'égalité d'objets de types différents, à "
"l'exception des types numériques entre eux. L'opérateur ``==`` est toujours "
"défini mais pour certains types d'objets (par exemple, les objets de type "
"classe), il est équivalent à :keyword:`is`. Les opérateurs ``<``, ``<=``, "
"``>`` et ``>=`` sont définis seulement quand ils ont un sens. Par exemple, "
"ils lèvent une exception :exc:`TypeError` lorsque l'un des arguments est un "
"nombre complexe."
2019-09-04 09:35:23 +00:00
#: library/stdtypes.rst:180
2016-10-30 09:46:26 +00:00
msgid ""
"Non-identical instances of a class normally compare as non-equal unless the "
2021-12-31 10:41:52 +00:00
"class defines the :meth:`~object.__eq__` method."
2016-10-30 09:46:26 +00:00
msgstr ""
"Des instances différentes d'une classe sont normalement considérées "
"différentes à moins que la classe ne définisse la méthode :meth:`~object."
"__eq__`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:183
2016-10-30 09:46:26 +00:00
msgid ""
"Instances of a class cannot be ordered with respect to other instances of "
"the same class, or other types of object, unless the class defines enough of "
2021-12-31 10:41:52 +00:00
"the methods :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object."
"__gt__`, and :meth:`~object.__ge__` (in general, :meth:`~object.__lt__` and :"
"meth:`~object.__eq__` are sufficient, if you want the conventional meanings "
"of the comparison operators)."
2016-10-30 09:46:26 +00:00
msgstr ""
"Les instances d'une classe ne peuvent pas être ordonnées par rapport à "
"d'autres instances de la même classe, ou d'autres types d'objets, à moins "
"que la classe ne définisse suffisamment de méthodes parmi :meth:`~object."
"__lt__`, :meth:`~object.__le__`, :meth:`~object.__gt__` et :meth:`~object."
"__ge__` (en général, :meth:`__lt__` et :meth:`__eq__` sont suffisantes, si "
"vous voulez les significations classiques des opérateurs de comparaison)."
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:190
2016-10-30 09:46:26 +00:00
msgid ""
"The behavior of the :keyword:`is` and :keyword:`is not` operators cannot be "
"customized; also they can be applied to any two objects and never raise an "
"exception."
msgstr ""
"Le comportement des opérateurs :keyword:`is` et :keyword:`is not` ne peut "
2017-09-22 08:30:36 +00:00
"pas être personnalisé ; aussi ils peuvent être appliqués à deux objets "
"quelconques et ne lèvent jamais d'exception."
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:198
2016-10-30 09:46:26 +00:00
msgid ""
"Two more operations with the same syntactic priority, :keyword:`in` and :"
2018-09-15 20:37:31 +00:00
"keyword:`not in`, are supported by types that are :term:`iterable` or "
"implement the :meth:`__contains__` method."
2016-10-30 09:46:26 +00:00
msgstr ""
"Deux autres opérations avec la même priorité syntaxique, :keyword:`in` et :"
2018-09-15 20:37:31 +00:00
"keyword:`not in`, sont pris en charge par les types :term:`itérables "
"<iterable>` ou qui implémentent la méthode :meth:`__contains__`."
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:205
2016-10-30 09:46:26 +00:00
msgid "Numeric Types --- :class:`int`, :class:`float`, :class:`complex`"
msgstr "Types numériques — :class:`int`, :class:`float`, :class:`complex`"
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:215
2016-10-30 09:46:26 +00:00
msgid ""
"There are three distinct numeric types: :dfn:`integers`, :dfn:`floating "
"point numbers`, and :dfn:`complex numbers`. In addition, Booleans are a "
"subtype of integers. Integers have unlimited precision. Floating point "
"numbers are usually implemented using :c:expr:`double` in C; information "
2016-10-30 09:46:26 +00:00
"about the precision and internal representation of floating point numbers "
"for the machine on which your program is running is available in :data:`sys."
"float_info`. Complex numbers have a real and imaginary part, which are each "
"a floating point number. To extract these parts from a complex number *z*, "
2019-09-04 09:35:23 +00:00
"use ``z.real`` and ``z.imag``. (The standard library includes the additional "
"numeric types :mod:`fractions.Fraction`, for rationals, and :mod:`decimal."
"Decimal`, for floating-point numbers with user-definable precision.)"
2016-10-30 09:46:26 +00:00
msgstr ""
"Il existe trois types numériques distincts : les entiers (:dfn:`integers`), "
"les nombres flottants (:dfn:`floating point numbers`) et les nombres "
"complexes (:dfn:`complex numbers`). En outre, les booléens sont un sous-type "
"des entiers. Les entiers ont une précision illimitée. Les nombres à virgule "
"flottante sont généralement implémentés en utilisant des :c:expr:`double` en "
"C ; des informations sur la précision et la représentation interne des "
"nombres à virgule flottante pour la machine sur laquelle le programme est en "
"cours d'exécution sont disponibles dans :data:`sys.float_info`. Les nombres "
"complexes ont une partie réelle et une partie imaginaire, qui sont chacune "
2017-09-22 08:30:36 +00:00
"des nombres à virgule flottante. Pour extraire ces parties d'un nombre "
"complexe *z*, utilisez ``z.real`` et ``z.imag``. (La bibliothèque standard "
2020-03-21 10:39:49 +00:00
"comprend les types numériques additionnels :mod:`fractions.Fraction` pour "
"les rationnels et :mod:`decimal.Decimal` pour les nombres à virgule "
"flottante avec une précision définissable par l'utilisateur.)"
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:237
2016-10-30 09:46:26 +00:00
msgid ""
"Numbers are created by numeric literals or as the result of built-in "
"functions and operators. Unadorned integer literals (including hex, octal "
"and binary numbers) yield integers. Numeric literals containing a decimal "
"point or an exponent sign yield floating point numbers. Appending ``'j'`` "
"or ``'J'`` to a numeric literal yields an imaginary number (a complex number "
"with a zero real part) which you can add to an integer or float to get a "
"complex number with real and imaginary parts."
msgstr ""
"Les nombres sont créés par des littéraux numériques ou sont le résultat de "
"fonctions natives ou d'opérateurs. Les entiers littéraux basiques (y compris "
"leur forme hexadécimale, octale et binaire) donnent des entiers. Les nombres "
"littéraux contenant un point décimal (NdT: notation anglo-saxonne de la "
"virgule) ou un exposant donnent des nombres à virgule flottante. Suffixer "
"``'j'`` ou ``'J'`` à un nombre littéral donne un nombre imaginaire (un "
"nombre complexe avec une partie réelle nulle) que vous pouvez ajouter à un "
"nombre (entier ou à virgule flottante) pour obtenir un nombre complexe avec "
"une partie réelle et une partie imaginaire."
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:262
2016-10-30 09:46:26 +00:00
msgid ""
"Python fully supports mixed arithmetic: when a binary arithmetic operator "
"has operands of different numeric types, the operand with the \"narrower\" "
"type is widened to that of the other, where integer is narrower than "
2020-05-24 14:31:50 +00:00
"floating point, which is narrower than complex. A comparison between numbers "
"of different types behaves as though the exact values of those numbers were "
"being compared. [2]_"
2016-10-30 09:46:26 +00:00
msgstr ""
"Python gère pleinement l'arithmétique de types numériques mixtes : lorsqu'un "
"opérateur arithmétique binaire possède des opérandes de types numériques "
"différents, l'opérande de type le plus « étroit » est élargi à celui de "
"l'autre. Dans ce système, l'entier est plus « étroit » que la virgule "
"flottante, qui est plus « étroite » que le complexe. Une comparaison entre "
"des nombres de types différents se comporte comme si les valeurs exactes de "
"ces nombres étaient comparées [2]_."
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:268
2020-05-24 14:31:50 +00:00
msgid ""
"The constructors :func:`int`, :func:`float`, and :func:`complex` can be used "
"to produce numbers of a specific type."
msgstr ""
"Les constructeurs :func:`int`, :func:`float`, et :func:`complex` peuvent "
"être utilisés pour produire des nombres d'un type numérique spécifique."
2020-05-24 14:31:50 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:271
2016-10-30 09:46:26 +00:00
msgid ""
2019-10-09 16:10:12 +00:00
"All numeric types (except complex) support the following operations (for "
"priorities of the operations, see :ref:`operator-summary`):"
2016-10-30 09:46:26 +00:00
msgstr ""
2020-03-21 10:39:49 +00:00
"Tous les types numériques (sauf complexe) gèrent les opérations suivantes "
"(pour les priorités des opérations, voir :ref:`operator-summary`) :"
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:275
2016-10-30 09:46:26 +00:00
msgid "Full documentation"
msgstr "Documentation complète"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:277
2016-10-30 09:46:26 +00:00
msgid "``x + y``"
msgstr "``x + y``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:277
2016-10-30 09:46:26 +00:00
msgid "sum of *x* and *y*"
msgstr "somme de *x* et *y*"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:279
2016-10-30 09:46:26 +00:00
msgid "``x - y``"
msgstr "``x - y``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:279
2016-10-30 09:46:26 +00:00
msgid "difference of *x* and *y*"
msgstr "différence de *x* et *y*"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:281
2016-10-30 09:46:26 +00:00
msgid "``x * y``"
msgstr "``x * y``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:281
2016-10-30 09:46:26 +00:00
msgid "product of *x* and *y*"
msgstr "produit de *x* et *y*"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:283
2016-10-30 09:46:26 +00:00
msgid "``x / y``"
msgstr "``x / y``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:283
2016-10-30 09:46:26 +00:00
msgid "quotient of *x* and *y*"
msgstr "quotient de *x* et *y*"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:285
2016-10-30 09:46:26 +00:00
msgid "``x // y``"
msgstr "``x // y``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:285
2016-10-30 09:46:26 +00:00
msgid "floored quotient of *x* and *y*"
msgstr "quotient entier de *x* et *y*"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:288
2016-10-30 09:46:26 +00:00
msgid "``x % y``"
msgstr "``x % y``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:288
2016-10-30 09:46:26 +00:00
msgid "remainder of ``x / y``"
msgstr "reste de ``x / y``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:290
2016-10-30 09:46:26 +00:00
msgid "``-x``"
msgstr "``-x``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:290
2016-10-30 09:46:26 +00:00
msgid "*x* negated"
msgstr "négatif de *x*"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:292
2016-10-30 09:46:26 +00:00
msgid "``+x``"
msgstr "``+x``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:292
2016-10-30 09:46:26 +00:00
msgid "*x* unchanged"
msgstr "*x* inchangé"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:294
2016-10-30 09:46:26 +00:00
msgid "``abs(x)``"
msgstr "``abs(x)``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:294
2016-10-30 09:46:26 +00:00
msgid "absolute value or magnitude of *x*"
msgstr "valeur absolue de *x*"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:294
2016-10-30 09:46:26 +00:00
msgid ":func:`abs`"
msgstr ":func:`abs`"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:297
2016-10-30 09:46:26 +00:00
msgid "``int(x)``"
msgstr "``int(x)``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:297
2016-10-30 09:46:26 +00:00
msgid "*x* converted to integer"
msgstr "*x* converti en nombre entier"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:297
2016-10-30 09:46:26 +00:00
msgid "\\(3)\\(6)"
msgstr "\\(3)\\(6)"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:297
2016-10-30 09:46:26 +00:00
msgid ":func:`int`"
msgstr ":func:`int`"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:299
2016-10-30 09:46:26 +00:00
msgid "``float(x)``"
msgstr "``float(x)``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:299
2016-10-30 09:46:26 +00:00
msgid "*x* converted to floating point"
msgstr "*x* converti en nombre à virgule flottante"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:299
2016-10-30 09:46:26 +00:00
msgid "\\(4)\\(6)"
msgstr "\\(4)\\(6)"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:299
2016-10-30 09:46:26 +00:00
msgid ":func:`float`"
msgstr ":func:`float`"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:301
2016-10-30 09:46:26 +00:00
msgid "``complex(re, im)``"
msgstr "``complex(re, im)``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:301
2016-10-30 09:46:26 +00:00
msgid ""
"a complex number with real part *re*, imaginary part *im*. *im* defaults to "
"zero."
msgstr ""
"un nombre complexe avec *re* pour partie réelle et *im* pour partie "
"imaginaire. *im* vaut zéro par défaut."
#: library/stdtypes.rst:1158 library/stdtypes.rst:3626
2016-10-30 09:46:26 +00:00
msgid "\\(6)"
msgstr "\\(6)"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:301
2016-10-30 09:46:26 +00:00
msgid ":func:`complex`"
msgstr ":func:`complex`"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:305
2016-10-30 09:46:26 +00:00
msgid "``c.conjugate()``"
msgstr "``c.conjugate()``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:305
2016-10-30 09:46:26 +00:00
msgid "conjugate of the complex number *c*"
msgstr "conjugué du nombre complexe *c*"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:308
2016-10-30 09:46:26 +00:00
msgid "``divmod(x, y)``"
msgstr "``divmod(x, y)``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:308
2016-10-30 09:46:26 +00:00
msgid "the pair ``(x // y, x % y)``"
msgstr "la paire ``(x // y, x % y)``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:308
2016-10-30 09:46:26 +00:00
msgid ":func:`divmod`"
msgstr ":func:`divmod`"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:310
2016-10-30 09:46:26 +00:00
msgid "``pow(x, y)``"
msgstr "``pow(x, y)``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:312
2016-10-30 09:46:26 +00:00
msgid "*x* to the power *y*"
msgstr "*x* à la puissance *y*"
#: library/stdtypes.rst:312 library/stdtypes.rst:1150 library/stdtypes.rst:2407
#: library/stdtypes.rst:3622 library/stdtypes.rst:3629
2016-10-30 09:46:26 +00:00
msgid "\\(5)"
msgstr "\\(5)"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:310
2016-10-30 09:46:26 +00:00
msgid ":func:`pow`"
msgstr ":func:`pow`"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:312
2016-10-30 09:46:26 +00:00
msgid "``x ** y``"
msgstr "``x ** y``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:322
2016-10-30 09:46:26 +00:00
msgid ""
"Also referred to as integer division. The resultant value is a whole "
"integer, though the result's type is not necessarily int. The result is "
"always rounded towards minus infinity: ``1//2`` is ``0``, ``(-1)//2`` is "
"``-1``, ``1//(-2)`` is ``-1``, and ``(-1)//(-2)`` is ``0``."
msgstr ""
"Également appelé division entière. La valeur résultante est un nombre "
"entier, bien que le type du résultat ne soit pas nécessairement *int*. Le "
"résultat est toujours arrondi vers moins l'infini : ``1//2`` vaut ``0``, "
2016-10-30 09:46:26 +00:00
"``(-1)//2`` vaut ``-1``, ``1//(-2)`` vaut ``-1``, et ``(-1)//(-2)`` vaut "
"``0``."
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:328
2016-10-30 09:46:26 +00:00
msgid ""
"Not for complex numbers. Instead convert to floats using :func:`abs` if "
"appropriate."
msgstr ""
"Pas pour les nombres complexes. Convertissez-les plutôt en nombres flottants "
"à l'aide de :func:`abs` si c'est approprié."
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:340
2016-10-30 09:46:26 +00:00
msgid ""
"Conversion from floating point to integer may round or truncate as in C; see "
"functions :func:`math.floor` and :func:`math.ceil` for well-defined "
"conversions."
msgstr ""
"La conversion de virgule flottante en entier peut arrondir ou tronquer comme "
2017-09-22 08:30:36 +00:00
"en C ; voir les fonctions :func:`math.floor` et :func:`math.ceil` pour des "
2016-10-30 09:46:26 +00:00
"conversions bien définies."
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:345
2016-10-30 09:46:26 +00:00
msgid ""
"float also accepts the strings \"nan\" and \"inf\" with an optional prefix "
"\"+\" or \"-\" for Not a Number (NaN) and positive or negative infinity."
msgstr ""
"*float* accepte aussi les chaînes *nan* et *inf* avec un préfixe optionnel ``"
"+`` ou ``-`` pour *Not a Number* (*NaN*) et les infinis positif ou négatif."
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:349
2016-10-30 09:46:26 +00:00
msgid ""
"Python defines ``pow(0, 0)`` and ``0 ** 0`` to be ``1``, as is common for "
"programming languages."
msgstr ""
"Python définit ``pow(0, 0)`` et ``0 ** 0`` valant ``1``, puisque c'est "
2016-10-30 09:46:26 +00:00
"courant pour les langages de programmation, et logique."
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:353
2016-10-30 09:46:26 +00:00
msgid ""
"The numeric literals accepted include the digits ``0`` to ``9`` or any "
"Unicode equivalent (code points with the ``Nd`` property)."
msgstr ""
"Les littéraux numériques acceptés comprennent les chiffres ``0`` à ``9`` ou "
"tout équivalent Unicode (caractères avec la propriété ``Nd``)."
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:356
2016-10-30 09:46:26 +00:00
msgid ""
2022-03-23 17:40:12 +00:00
"See https://www.unicode.org/Public/14.0.0/ucd/extracted/DerivedNumericType."
2018-06-28 13:32:56 +00:00
"txt for a complete list of code points with the ``Nd`` property."
2016-10-30 09:46:26 +00:00
msgstr ""
"Voir https://www.unicode.org/Public/14.0.0/ucd/extracted/DerivedNumericType."
2016-10-30 09:46:26 +00:00
"txt pour une liste complète des caractères avec la propriété ``Nd``."
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:360
2016-10-30 09:46:26 +00:00
msgid ""
"All :class:`numbers.Real` types (:class:`int` and :class:`float`) also "
"include the following operations:"
msgstr ""
"Tous types :class:`numbers.Real` (:class:`int` et :class:`float`) "
"comprennent également les opérations suivantes :"
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:366
2016-10-30 09:46:26 +00:00
msgid ":func:`math.trunc(\\ x) <math.trunc>`"
msgstr ":func:`math.trunc(\\ x) <math.trunc>`"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:366
2016-10-30 09:46:26 +00:00
msgid "*x* truncated to :class:`~numbers.Integral`"
msgstr "*x* tronqué à l':class:`~numbers.Integral`"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:369
2016-10-30 09:46:26 +00:00
msgid ":func:`round(x[, n]) <round>`"
msgstr ":func:`round(x[, n]) <round>`"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:369
2016-10-30 09:46:26 +00:00
msgid ""
"*x* rounded to *n* digits, rounding half to even. If *n* is omitted, it "
"defaults to 0."
msgstr ""
"*x* arrondi à *n* chiffres, arrondissant la moitié au pair. Si *n* est omis, "
"la valeur par défaut est 0."
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:373
2016-10-30 09:46:26 +00:00
msgid ":func:`math.floor(\\ x) <math.floor>`"
msgstr ":func:`math.floor(\\ x) <math.floor>`"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:373
2016-10-30 09:46:26 +00:00
msgid "the greatest :class:`~numbers.Integral` <= *x*"
msgstr "le plus grand :class:`~numbers.Integral` ≤ *x*"
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:376
2016-10-30 09:46:26 +00:00
msgid ":func:`math.ceil(x) <math.ceil>`"
msgstr ":func:`math.ceil(x) <math.ceil>`"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:376
2016-10-30 09:46:26 +00:00
msgid "the least :class:`~numbers.Integral` >= *x*"
msgstr "le plus petit :class:`~numbers.Integral` ≥ *x*"
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:380
2016-10-30 09:46:26 +00:00
msgid ""
"For additional numeric operations see the :mod:`math` and :mod:`cmath` "
"modules."
msgstr ""
"Pour d'autres opérations numériques voir les modules :mod:`math` et :mod:"
"`cmath`."
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:389
2016-10-30 09:46:26 +00:00
msgid "Bitwise Operations on Integer Types"
msgstr "Opérations sur les bits des nombres entiers"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:403
2016-10-30 09:46:26 +00:00
msgid ""
"Bitwise operations only make sense for integers. The result of bitwise "
"operations is calculated as though carried out in two's complement with an "
"infinite number of sign bits."
2016-10-30 09:46:26 +00:00
msgstr ""
2018-11-12 10:16:00 +00:00
"Les opérations bit à bit n'ont de sens que pour les entiers relatifs. Le "
2018-11-29 15:13:39 +00:00
"résultat d'une opération bit à bit est calculé comme si elle était effectuée "
"en complément à deux avec un nombre infini de bits de signe."
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:407
2016-10-30 09:46:26 +00:00
msgid ""
"The priorities of the binary bitwise operations are all lower than the "
"numeric operations and higher than the comparisons; the unary operation "
"``~`` has the same priority as the other unary numeric operations (``+`` and "
"``-``)."
msgstr ""
"Les priorités de toutes les opérations bit à bit à deux opérandes sont "
"inférieures à celles des opérations numériques et plus élevées que les "
"comparaisons ; l'opération unaire ``~`` a la même priorité que les autres "
"opérations numériques unaires (``+`` et ``-``)."
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:411
2016-10-30 09:46:26 +00:00
msgid "This table lists the bitwise operations sorted in ascending priority:"
msgstr ""
"Ce tableau répertorie les opérations binaires triées par priorité "
"ascendante :"
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:416
2016-10-30 09:46:26 +00:00
msgid "``x | y``"
msgstr "``x | y``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:416
2016-10-30 09:46:26 +00:00
msgid "bitwise :dfn:`or` of *x* and *y*"
msgstr ":dfn:`OU` bit à bit de *x* et *y*"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:419 library/stdtypes.rst:1171 library/stdtypes.rst:2397
#: library/stdtypes.rst:3615
2018-09-15 20:37:31 +00:00
msgid "\\(4)"
msgstr "\\(4)"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:419
2016-10-30 09:46:26 +00:00
msgid "``x ^ y``"
msgstr "``x ^ y``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:419
2016-10-30 09:46:26 +00:00
msgid "bitwise :dfn:`exclusive or` of *x* and *y*"
msgstr ":dfn:`OU exclusif` bit à bit de *x* et *y*"
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:422
2016-10-30 09:46:26 +00:00
msgid "``x & y``"
msgstr "``x & y``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:422
2016-10-30 09:46:26 +00:00
msgid "bitwise :dfn:`and` of *x* and *y*"
msgstr ":dfn:`ET` bit à bit de *x* et *y*"
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:425
2016-10-30 09:46:26 +00:00
msgid "``x << n``"
msgstr "``x << n``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:425
2016-10-30 09:46:26 +00:00
msgid "*x* shifted left by *n* bits"
msgstr "*x* décalé vers la gauche de *n* bits"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:425
2016-10-30 09:46:26 +00:00
msgid "(1)(2)"
msgstr "(1)(2)"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:427
2016-10-30 09:46:26 +00:00
msgid "``x >> n``"
msgstr "``x >> n``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:427
2016-10-30 09:46:26 +00:00
msgid "*x* shifted right by *n* bits"
msgstr "*x* décalé vers la droite de *n* bits"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:427
2016-10-30 09:46:26 +00:00
msgid "(1)(3)"
msgstr "(1)(3)"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:429
2016-10-30 09:46:26 +00:00
msgid "``~x``"
msgstr "``~x``"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:429
2016-10-30 09:46:26 +00:00
msgid "the bits of *x* inverted"
msgstr "les bits de *x*, inversés"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:435
2016-10-30 09:46:26 +00:00
msgid ""
"Negative shift counts are illegal and cause a :exc:`ValueError` to be raised."
msgstr ""
"Des valeurs de décalage négatives sont illégales et provoquent une "
"exception :exc:`ValueError`."
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:438
2016-10-30 09:46:26 +00:00
msgid ""
2020-06-05 07:32:47 +00:00
"A left shift by *n* bits is equivalent to multiplication by ``pow(2, n)``."
2016-10-30 09:46:26 +00:00
msgstr ""
"Un décalage à gauche de *n* bits est équivalent à la multiplication par "
"``pow(2, n)``."
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:441
2016-10-30 09:46:26 +00:00
msgid ""
2020-06-05 07:32:47 +00:00
"A right shift by *n* bits is equivalent to floor division by ``pow(2, n)``."
2016-10-30 09:46:26 +00:00
msgstr ""
"Un décalage à droite de *n* les bits est équivalent à la division par "
"``pow(2, n)``."
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:444
msgid ""
"Performing these calculations with at least one extra sign extension bit in "
"a finite two's complement representation (a working bit-width of ``1 + max(x."
2018-12-24 13:20:55 +00:00
"bit_length(), y.bit_length())`` or more) is sufficient to get the same "
"result as if there were an infinite number of sign bits."
msgstr ""
2018-11-29 15:13:39 +00:00
"Effectuer ces calculs avec au moins un bit d'extension de signe "
"supplémentaire dans une représentation finie du complément à deux éléments "
"(une largeur de bit fonctionnelle de ``1 + max(x.bit_length(), y."
"bit_length()`` ou plus) est suffisante pour obtenir le même résultat que "
"s'il y avait un nombre infini de bits de signe."
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:451
2016-10-30 09:46:26 +00:00
msgid "Additional Methods on Integer Types"
msgstr "Méthodes supplémentaires sur les entiers"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:453
2016-10-30 09:46:26 +00:00
msgid ""
"The int type implements the :class:`numbers.Integral` :term:`abstract base "
"class`. In addition, it provides a few more methods:"
msgstr ""
"Le type *int* implémente la :term:`classe mère abstraite <abstract base "
2016-10-30 09:46:26 +00:00
"class>` :class:`numbers.Integral`. Il fournit aussi quelques autres "
2017-09-22 08:30:36 +00:00
"méthodes :"
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:458
2016-10-30 09:46:26 +00:00
msgid ""
"Return the number of bits necessary to represent an integer in binary, "
"excluding the sign and leading zeros::"
msgstr ""
"Renvoie le nombre de bits nécessaires pour représenter un nombre entier en "
"binaire, à l'exclusion du signe et des zéros non significatifs ::"
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:467
2016-10-30 09:46:26 +00:00
msgid ""
"More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the unique "
"positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. "
"Equivalently, when ``abs(x)`` is small enough to have a correctly rounded "
"logarithm, then ``k = 1 + int(log(abs(x), 2))``. If ``x`` is zero, then ``x."
"bit_length()`` returns ``0``."
msgstr ""
"Plus précisément, si ``x`` est différent de zéro, ``x.bit_length()`` est le "
"nombre entier positif unique, ``k`` tel que ``2**(k-1) <= abs(x) < 2**k``. "
"Équivalemment, quand ``abs(x)`` est assez petit pour avoir un logarithme "
"correctement arrondi, ``k = 1 + int(log(abs(x), 2))``. Si ``x`` est nul, "
"alors ``x.bit_length()`` donne ``0``."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:496 library/stdtypes.rst:583
2016-10-30 09:46:26 +00:00
msgid "Equivalent to::"
msgstr "Équivalent à ::"
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:484
msgid ""
"Return the number of ones in the binary representation of the absolute value "
"of the integer. This is also known as the population count. Example::"
msgstr ""
"Renvoie le nombre de 1 dans la représentation binaire de la valeur absolue "
"de l'entier. On la connait également sous le nom de dénombrement de la "
"population. Par exemple ::"
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:505
2016-10-30 09:46:26 +00:00
msgid "Return an array of bytes representing an integer."
msgstr "Renvoie un tableau d'octets représentant un nombre entier."
2016-10-30 09:46:26 +00:00
2021-12-31 10:41:52 +00:00
#: library/stdtypes.rst:517
2016-10-30 09:46:26 +00:00
msgid ""
2022-03-23 17:40:12 +00:00
"The integer is represented using *length* bytes, and defaults to 1. An :exc:"
"`OverflowError` is raised if the integer is not representable with the given "
"number of bytes."
2016-10-30 09:46:26 +00:00
msgstr ""
"L'entier est représenté en utilisant *length* octets, dont la valeur par "
"défaut est 1. Une exception :exc:`OverflowError` est levée s'il n'est pas "
"possible de représenter l'entier avec le nombre donné d'octets."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:521
2016-10-30 09:46:26 +00:00
msgid ""
"The *byteorder* argument determines the byte order used to represent the "
2022-03-23 17:40:12 +00:00
"integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the "
"most significant byte is at the beginning of the byte array. If *byteorder* "
"is ``\"little\"``, the most significant byte is at the end of the byte array."
2016-10-30 09:46:26 +00:00
msgstr ""
"L'argument *byteorder* détermine l'ordre des octets utilisé pour représenter "
"le nombre entier, la valeur par défaut étant ``\"big\"``. Si *byteorder* est "
"``\"big\"``, l'octet le plus significatif est au début du tableau d'octets. "
"Si *byteorder* est ``\"little\"``, l'octet le plus significatif est à la fin "
"du tableau d'octets."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:527
2016-10-30 09:46:26 +00:00
msgid ""
"The *signed* argument determines whether two's complement is used to "
"represent the integer. If *signed* is ``False`` and a negative integer is "
"given, an :exc:`OverflowError` is raised. The default value for *signed* is "
"``False``."
msgstr ""
"L'argument *signed* détermine si le complément à deux est utilisé pour "
"représenter le nombre entier. Si *signed* est ``False`` et qu'un entier "
"négatif est donné, une exception :exc:`OverflowError` est levée. La valeur "
"par défaut pour *signed* est ``False``."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:532
msgid ""
"The default values can be used to conveniently turn an integer into a single "
"byte object. However, when using the default arguments, don't try to "
"convert a value greater than 255 or you'll get an :exc:`OverflowError`::"
msgstr ""
"Les valeurs par défaut peuvent être utilisées pour transformer facilement un "
"entier en un objet à un seul octet. Cependant, lorsque vous utilisez les "
"arguments par défaut, n'essayez pas de convertir une valeur supérieure à 255 "
"ou vous lèverez une :exc:`OverflowError` ::"
2022-03-23 17:40:12 +00:00
# suit un :
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:552
msgid "Added default argument values for ``length`` and ``byteorder``."
msgstr ""
"ajout de valeurs par défaut pour les arguments ``length`` et ``byteorder``."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:557
2016-10-30 09:46:26 +00:00
msgid "Return the integer represented by the given array of bytes."
msgstr "Renvoie le nombre entier représenté par le tableau d'octets fourni."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:570
2016-10-30 09:46:26 +00:00
msgid ""
"The argument *bytes* must either be a :term:`bytes-like object` or an "
"iterable producing bytes."
msgstr ""
"L'argument *bytes* doit être soit un :term:`objet octet-compatible <bytes-"
"like object>`, soit un itérable produisant des *bytes*."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:573
msgid ""
"The *byteorder* argument determines the byte order used to represent the "
"integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the "
"most significant byte is at the beginning of the byte array. If *byteorder* "
"is ``\"little\"``, the most significant byte is at the end of the byte "
"array. To request the native byte order of the host system, use :data:`sys."
"byteorder` as the byte order value."
msgstr ""
"L'argument *byteorder* détermine l'ordre des octets utilisé pour représenter "
"le nombre entier, la valeur par défaut étant ``\"big\"``. Si *byteorder* est "
"``\"big\"``, l'octet le plus significatif est au début du tableau d'octets. "
"Si *byteorder* est ``\"little\"``, l'octet le plus significatif est à la fin "
"du tableau d'octets. Pour demander l'ordre natif des octets du système hôte, "
"donnez :data:`sys.byteorder` comme *byteorder*."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:580
2016-10-30 09:46:26 +00:00
msgid ""
"The *signed* argument indicates whether two's complement is used to "
"represent the integer."
msgstr ""
"L'argument *signed* indique si le complément à deux est utilisé pour "
"représenter le nombre entier."
# suit un :
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:600
msgid "Added default argument value for ``byteorder``."
msgstr "ajout de la valeur par défaut pour l'argument ``byteorder``."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:605
2019-09-04 09:35:23 +00:00
msgid ""
"Return a pair of integers whose ratio is exactly equal to the original "
"integer and with a positive denominator. The integer ratio of integers "
"(whole numbers) is always the integer as the numerator and ``1`` as the "
"denominator."
msgstr ""
"Renvoie une paire de nombres entiers dont le rapport est exactement égal au "
"nombre d'origine et avec un dénominateur positif. L'\\ *integer_ratio* d'un "
"entier (tous les nombres entiers) est cet entier au numérateur et ``1`` "
"comme dénominateur."
2019-09-04 09:35:23 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:613
2016-10-30 09:46:26 +00:00
msgid "Additional Methods on Float"
msgstr "Méthodes supplémentaires sur les nombres à virgule flottante"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:615
2016-10-30 09:46:26 +00:00
msgid ""
"The float type implements the :class:`numbers.Real` :term:`abstract base "
"class`. float also has the following additional methods."
msgstr ""
"Le type *float* implémente la :term:`classe mère abstraite <abstract base "
2016-10-30 09:46:26 +00:00
"class>` :class:`numbers.Real` et a également les méthodes suivantes."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:620
2016-10-30 09:46:26 +00:00
msgid ""
"Return a pair of integers whose ratio is exactly equal to the original float "
"and with a positive denominator. Raises :exc:`OverflowError` on infinities "
"and a :exc:`ValueError` on NaNs."
msgstr ""
"Renvoie une paire de nombres entiers dont le rapport est exactement égal au "
"nombre d'origine et avec un dénominateur positif. Lève :exc:`OverflowError` "
"avec un infini et :exc:`ValueError` avec un NaN."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:627
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if the float instance is finite with integral value, and "
"``False`` otherwise::"
msgstr ""
"Renvoie ``True`` si l'instance de *float* est finie avec une valeur entière, "
"et ``False`` autrement ::"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:635
2016-10-30 09:46:26 +00:00
msgid ""
"Two methods support conversion to and from hexadecimal strings. Since "
"Python's floats are stored internally as binary numbers, converting a float "
"to or from a *decimal* string usually involves a small rounding error. In "
"contrast, hexadecimal strings allow exact representation and specification "
"of floating-point numbers. This can be useful when debugging, and in "
"numerical work."
msgstr ""
"Deux méthodes prennent en charge la conversion vers et à partir de chaînes "
"hexadécimales. Étant donné que les *float* de Python sont stockés en interne "
"sous forme de nombres binaires, la conversion d'un *float* depuis ou vers "
"une chaine décimale implique généralement une petite erreur d'arrondi. En "
"revanche, les chaînes hexadécimales permettent de représenter exactement les "
"nombres à virgule flottante. Cela peut être utile lors du débogage, et dans "
"un travail numérique."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:646
2016-10-30 09:46:26 +00:00
msgid ""
"Return a representation of a floating-point number as a hexadecimal string. "
"For finite floating-point numbers, this representation will always include a "
"leading ``0x`` and a trailing ``p`` and exponent."
msgstr ""
"Renvoie une représentation d'un nombre à virgule flottante sous forme de "
2016-10-30 09:46:26 +00:00
"chaîne hexadécimale. Pour les nombres à virgule flottante finis, cette "
"représentation comprendra toujours un préfixe ``0x``, un suffixe ``p``, et "
"un exposant."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:654
2016-10-30 09:46:26 +00:00
msgid ""
"Class method to return the float represented by a hexadecimal string *s*. "
"The string *s* may have leading and trailing whitespace."
msgstr ""
"Méthode de classe pour obtenir le *float* représenté par une chaîne de "
"caractères hexadécimale *s*. La chaîne *s* peut contenir des espaces avant "
"et après le nombre."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:659
2016-10-30 09:46:26 +00:00
msgid ""
"Note that :meth:`float.hex` is an instance method, while :meth:`float."
"fromhex` is a class method."
msgstr ""
"Notez que :meth:`float.hex` est une méthode d'instance, alors que :meth:"
"`float.fromhex` est une méthode de classe."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:662
2016-10-30 09:46:26 +00:00
msgid "A hexadecimal string takes the form::"
msgstr "Une chaîne hexadécimale prend la forme ::"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:666
2016-10-30 09:46:26 +00:00
msgid ""
"where the optional ``sign`` may by either ``+`` or ``-``, ``integer`` and "
"``fraction`` are strings of hexadecimal digits, and ``exponent`` is a "
"decimal integer with an optional leading sign. Case is not significant, and "
"there must be at least one hexadecimal digit in either the integer or the "
"fraction. This syntax is similar to the syntax specified in section 6.4.4.2 "
"of the C99 standard, and also to the syntax used in Java 1.5 onwards. In "
"particular, the output of :meth:`float.hex` is usable as a hexadecimal "
"floating-point literal in C or Java code, and hexadecimal strings produced "
"by C's ``%a`` format character or Java's ``Double.toHexString`` are accepted "
"by :meth:`float.fromhex`."
msgstr ""
"où ``sign`` peut être soit ``+`` soit ``-``, ``integer`` et ``fraction`` "
"sont des chaînes de chiffres hexadécimaux, et ``exponent`` est un entier "
2016-10-30 09:46:26 +00:00
"décimal facultativement signé. La casse n'est pas significative, et il doit "
"y avoir au moins un chiffre hexadécimal soit dans le nombre entier soit dans "
"la fraction. Cette syntaxe est similaire à la syntaxe spécifiée dans la "
"section 6.4.4.2 de la norme C99, et est aussi la syntaxe utilisée à partir "
"de Java 1.5. En particulier, la sortie de :meth:`float.hex` est utilisable "
"comme valeur hexadécimale à virgule flottante littérale en C ou Java, et des "
"chaînes hexadécimales produites en C via un format ``%a`` ou Java via "
"``Double.toHexString`` sont acceptées par :meth:`float.fromhex`."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:679
2016-10-30 09:46:26 +00:00
msgid ""
"Note that the exponent is written in decimal rather than hexadecimal, and "
"that it gives the power of 2 by which to multiply the coefficient. For "
"example, the hexadecimal string ``0x3.a7p10`` represents the floating-point "
"number ``(3 + 10./16 + 7./16**2) * 2.0**10``, or ``3740.0``::"
msgstr ""
"Notez que l'exposant est écrit en décimal plutôt qu'en hexadécimal, et qu'il "
"donne la puissance de 2 par lequel multiplier le coefficient. Par exemple, "
"la chaîne hexadécimale ``0x3.a7p10`` représente le nombre à virgule "
"flottante ``(3 + 10./16 + 7./16**2) *2.0**10``, ou ``3740.0`` ::"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:689
2016-10-30 09:46:26 +00:00
msgid ""
"Applying the reverse conversion to ``3740.0`` gives a different hexadecimal "
"string representing the same number::"
msgstr ""
"L'application de la conversion inverse à ``3740.0`` donne une chaîne "
"hexadécimale différente représentant le même nombre ::"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:699
2016-10-30 09:46:26 +00:00
msgid "Hashing of numeric types"
msgstr "Hachage des types numériques"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:701
2016-10-30 09:46:26 +00:00
msgid ""
"For numbers ``x`` and ``y``, possibly of different types, it's a requirement "
2021-12-31 10:41:52 +00:00
"that ``hash(x) == hash(y)`` whenever ``x == y`` (see the :meth:`~object."
"__hash__` method documentation for more details). For ease of "
"implementation and efficiency across a variety of numeric types (including :"
"class:`int`, :class:`float`, :class:`decimal.Decimal` and :class:`fractions."
"Fraction`) Python's hash for numeric types is based on a single mathematical "
"function that's defined for any rational number, and hence applies to all "
"instances of :class:`int` and :class:`fractions.Fraction`, and all finite "
"instances of :class:`float` and :class:`decimal.Decimal`. Essentially, this "
"function is given by reduction modulo ``P`` for a fixed prime ``P``. The "
"value of ``P`` is made available to Python as the :attr:`modulus` attribute "
"of :data:`sys.hash_info`."
2016-10-30 09:46:26 +00:00
msgstr ""
"Pour deux nombres égaux ``x`` et ``y`` (c.-à-d. ``x == y``), pouvant être de "
"différents types, il est requis que ``hash(x) == hash(y)`` (voir la "
"documentation de :meth:`~object.__hash__`). Pour faciliter la mise en œuvre "
"et l'efficacité à travers une variété de types numériques (y compris :class:"
2016-10-30 09:46:26 +00:00
"`int`, :class:`float`, :class:`decimal.Decimal` et :class:`fractions."
"Fraction`) le hachage en Python pour les types numérique est basé sur une "
"fonction mathématique unique qui est définie pour tout nombre rationnel, et "
"donc s'applique à toutes les instances de :class:`int` et :class:`fractions."
"Fraction`, et toutes les instances finies de :class:`float` et :class:"
"`decimal.Decimal`. Essentiellement, cette fonction est donnée par la "
"réduction modulo ``P`` pour un nombre ``P`` premier fixe. La valeur de ``P`` "
"est disponible comme attribut :attr:`modulus` de :data:`sys.hash_info`."
# suit un :
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:716
2016-10-30 09:46:26 +00:00
msgid ""
"Currently, the prime used is ``P = 2**31 - 1`` on machines with 32-bit C "
"longs and ``P = 2**61 - 1`` on machines with 64-bit C longs."
msgstr ""
"actuellement, le premier utilisé est ``P = 2 ** 31 - 1`` sur des machines "
2016-10-30 09:46:26 +00:00
"dont les *longs* en C sont de 32 bits ``P = 2 ** 61 - 1`` sur des machines "
"dont les *longs* en C font 64 bits."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:719
2016-10-30 09:46:26 +00:00
msgid "Here are the rules in detail:"
msgstr "Voici les règles en détail :"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:721
2016-10-30 09:46:26 +00:00
msgid ""
"If ``x = m / n`` is a nonnegative rational number and ``n`` is not divisible "
"by ``P``, define ``hash(x)`` as ``m * invmod(n, P) % P``, where ``invmod(n, "
"P)`` gives the inverse of ``n`` modulo ``P``."
msgstr ""
"Si ``x = m / n`` est un nombre rationnel non négatif et ``n`` n'est pas "
"divisible par ``P``, définir ``hash(x)`` comme ``m * invmod(n, P) % P``, où "
"``invmod(n, P)`` donne l'inverse de ``n`` modulo ``P``."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:725
2016-10-30 09:46:26 +00:00
msgid ""
"If ``x = m / n`` is a nonnegative rational number and ``n`` is divisible by "
"``P`` (but ``m`` is not) then ``n`` has no inverse modulo ``P`` and the rule "
"above doesn't apply; in this case define ``hash(x)`` to be the constant "
"value ``sys.hash_info.inf``."
msgstr ""
"Si ``x = m / n`` est un nombre rationnel non négatif et ``n`` est divisible "
"par ``P`` (mais ``m`` ne l'est pas), alors ``n`` n'a pas de modulo inverse "
2017-09-22 08:30:36 +00:00
"``P`` et la règle ci-dessus n'est pas applicable ; dans ce cas définir "
2016-10-30 09:46:26 +00:00
"``hash(x)`` comme étant la valeur de la constante ``sys.hash_info.inf``."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:730
2016-10-30 09:46:26 +00:00
msgid ""
"If ``x = m / n`` is a negative rational number define ``hash(x)`` as ``-"
"hash(-x)``. If the resulting hash is ``-1``, replace it with ``-2``."
msgstr ""
"Si ``x = m / n`` est un nombre rationnel négatif définir ``hash(x)`` comme "
"``-hash(-x)``. Si le résultat est ``-1``, le remplacer par ``-2``."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:734
2016-10-30 09:46:26 +00:00
msgid ""
"The particular values ``sys.hash_info.inf`` and ``-sys.hash_info.inf`` are "
"used as hash values for positive infinity or negative infinity "
"(respectively)."
2016-10-30 09:46:26 +00:00
msgstr ""
"Les valeurs particulières ``sys.hash_info.inf`` et ``-sys.hash_info.inf`` "
"sont utilisées comme valeurs de hachage pour l'infini positif et l'infini "
"négatif (respectivement)."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:738
2016-10-30 09:46:26 +00:00
msgid ""
"For a :class:`complex` number ``z``, the hash values of the real and "
"imaginary parts are combined by computing ``hash(z.real) + sys.hash_info."
"imag * hash(z.imag)``, reduced modulo ``2**sys.hash_info.width`` so that it "
"lies in ``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - "
"1))``. Again, if the result is ``-1``, it's replaced with ``-2``."
msgstr ""
"Pour un nombre :class:`complexe <complex>` ``z``, les valeurs de hachage des "
"parties réelles et imaginaires sont combinées en calculant ``hash(z.real) + "
"sys.hash_info.imag * hash(z.imag)``, réduit au modulo ``2**sys.hash_info."
"width`` de sorte qu'il se trouve dans ``range(-2**(sys.hash_info.width - 1), "
"2**(sys.hash_info.width - 1))``. Encore une fois, si le résultat est ``-1``, "
"il est remplacé par ``-2``."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:746
2016-10-30 09:46:26 +00:00
msgid ""
"To clarify the above rules, here's some example Python code, equivalent to "
"the built-in hash, for computing the hash of a rational number, :class:"
"`float`, or :class:`complex`::"
msgstr ""
"Afin de clarifier les règles ci-dessus, voici quelques exemples de code "
"Python, équivalent à la fonction de hachage native, pour calculer le hachage "
"d'un nombre rationnel, d'un :class:`float`, ou d'un :class:`complex` ::"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:801
2016-10-30 09:46:26 +00:00
msgid "Iterator Types"
msgstr "Les types itérateurs"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:809
2016-10-30 09:46:26 +00:00
msgid ""
"Python supports a concept of iteration over containers. This is implemented "
"using two distinct methods; these are used to allow user-defined classes to "
"support iteration. Sequences, described below in more detail, always "
"support the iteration methods."
msgstr ""
"Python gère un concept d'itération sur les conteneurs. Il l'implémente en "
"utilisant deux méthodes distinctes qui permettent aux classes définies par "
"l'utilisateur de devenir itérables. Les séquences, décrites plus bas en "
"détail, savent toujours gérer les méthodes d'itération."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:814
2016-10-30 09:46:26 +00:00
msgid ""
"One method needs to be defined for container objects to provide :term:"
"`iterable` support:"
2016-10-30 09:46:26 +00:00
msgstr ""
"Une méthode doit être définie afin que les objets conteneurs prennent en "
"charge :term:`litération <iterable>` :"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:821
2016-10-30 09:46:26 +00:00
msgid ""
"Return an :term:`iterator` object. The object is required to support the "
"iterator protocol described below. If a container supports different types "
"of iteration, additional methods can be provided to specifically request "
2016-10-30 09:46:26 +00:00
"iterators for those iteration types. (An example of an object supporting "
"multiple forms of iteration would be a tree structure which supports both "
"breadth-first and depth-first traversal.) This method corresponds to the :c:"
"member:`~PyTypeObject.tp_iter` slot of the type structure for Python objects "
"in the Python/C API."
msgstr ""
"Renvoie un objet :term:`itérateur <iterator>`. L'objet doit implémenter le "
"protocole d'itération décrit ci-dessous. Si un conteneur prend en charge "
"différents types d'itération, d'autres méthodes peuvent être fournies pour "
"obtenir spécifiquement les itérateurs pour ces types d'itération. (Exemple "
"d'un objet gérant plusieurs formes d'itération : une structure d'arbre "
2016-10-30 09:46:26 +00:00
"pouvant être parcourue en largeur ou en profondeur.) Cette méthode "
"correspond à l'attribut :c:member:`~PyTypeObject.tp_iter` de la structure du "
"type des objets Python dans l'API Python/C."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:830
2016-10-30 09:46:26 +00:00
msgid ""
"The iterator objects themselves are required to support the following two "
"methods, which together form the :dfn:`iterator protocol`:"
msgstr ""
"Les itérateurs eux-mêmes doivent implémenter les deux méthodes suivantes, "
"qui forment ensemble le :dfn:`protocole d'itération` :"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:836
2016-10-30 09:46:26 +00:00
msgid ""
"Return the :term:`iterator` object itself. This is required to allow both "
2016-10-30 09:46:26 +00:00
"containers and iterators to be used with the :keyword:`for` and :keyword:"
"`in` statements. This method corresponds to the :c:member:`~PyTypeObject."
2016-10-30 09:46:26 +00:00
"tp_iter` slot of the type structure for Python objects in the Python/C API."
msgstr ""
"Renvoie :term:`lobjet itérateur<iterator>` lui-même. C'est nécessaire pour "
"permettre à la fois à des conteneurs et des itérateurs d'être utilisés avec "
"les instructions :keyword:`for` et :keyword:`in`. Cette méthode correspond à "
"l'attribut :c:member:`~PyTypeObject.tp_iter` de la structure des types des "
"objets Python dans l'API Python/C."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:845
2016-10-30 09:46:26 +00:00
msgid ""
"Return the next item from the :term:`iterator`. If there are no further "
"items, raise the :exc:`StopIteration` exception. This method corresponds to "
"the :c:member:`~PyTypeObject.tp_iternext` slot of the type structure for "
"Python objects in the Python/C API."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie l'élément suivant de l:term:`itérateur<iterator>`. S'il n'y a pas "
"d'autres éléments, une exception :exc:`StopIteration` est levée. Cette "
"méthode correspond à l'attribut :c:member:`~PyTypeObject.tp_iternext` de la "
"structure du type des objets Python dans l'API Python/C."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:850
2016-10-30 09:46:26 +00:00
msgid ""
"Python defines several iterator objects to support iteration over general "
"and specific sequence types, dictionaries, and other more specialized "
"forms. The specific types are not important beyond their implementation of "
"the iterator protocol."
msgstr ""
"Python définit plusieurs objets itérateurs pour itérer sur les types "
"standards ou spécifiques de séquence, de dictionnaires et d'autres formes "
"plus spécialisées. Les types spécifiques ne sont pas importants au-delà de "
"leur implémentation du protocole d'itération."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:855
2016-10-30 09:46:26 +00:00
msgid ""
"Once an iterator's :meth:`~iterator.__next__` method raises :exc:"
"`StopIteration`, it must continue to do so on subsequent calls. "
"Implementations that do not obey this property are deemed broken."
msgstr ""
"Dès que la méthode :meth:`~iterator.__next__` lève une exception :exc:"
"`StopIteration`, elle doit continuer à le faire lors des appels ultérieurs. "
"Les implémentations qui ne respectent pas cette propriété sont considérées "
2016-10-30 09:46:26 +00:00
"cassées."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:863
2016-10-30 09:46:26 +00:00
msgid "Generator Types"
msgstr "Types générateurs"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:865
2016-10-30 09:46:26 +00:00
msgid ""
"Python's :term:`generator`\\s provide a convenient way to implement the "
"iterator protocol. If a container object's :meth:`__iter__` method is "
"implemented as a generator, it will automatically return an iterator object "
"(technically, a generator object) supplying the :meth:`__iter__` and :meth:"
"`~generator.__next__` methods. More information about generators can be "
"found in :ref:`the documentation for the yield expression <yieldexpr>`."
msgstr ""
"Les :term:`générateurs <generator>` offrent un moyen pratique d'implémenter "
"le protocole d'itération. Si la méthode :meth:`__iter__` d'un objet "
"conteneur est implémentée comme un générateur, elle renverra automatiquement "
"un objet *iterator* (techniquement, un objet générateur) fournissant les "
"méthodes :meth:`__iter__` et :meth:`~generator.__next__`. Plus "
"d'informations sur les générateurs peuvent être trouvées dans :ref:`la "
"documentation de l'expression yield <yieldexpr>`."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:877
2016-10-30 09:46:26 +00:00
msgid "Sequence Types --- :class:`list`, :class:`tuple`, :class:`range`"
msgstr "Types séquentiels — :class:`list`, :class:`tuple`, :class:`range`"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:879
2016-10-30 09:46:26 +00:00
msgid ""
"There are three basic sequence types: lists, tuples, and range objects. "
"Additional sequence types tailored for processing of :ref:`binary data "
"<binaryseq>` and :ref:`text strings <textseq>` are described in dedicated "
"sections."
msgstr ""
"Il existe trois types séquentiels élémentaires : les listes (objets *list*), "
"*n*-uplets (objets *tuple*) et les intervalles (objets *range*). D'autres "
"types séquentiels spécifiques au traitement de :ref:`données binaires "
"<binaryseq>` et :ref:`chaînes de caractères <textseq>` sont décrits dans des "
"sections dédiées."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:888
2016-10-30 09:46:26 +00:00
msgid "Common Sequence Operations"
msgstr "Opérations communes sur les séquences"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:892
2016-10-30 09:46:26 +00:00
msgid ""
"The operations in the following table are supported by most sequence types, "
"both mutable and immutable. The :class:`collections.abc.Sequence` ABC is "
"provided to make it easier to correctly implement these operations on custom "
"sequence types."
msgstr ""
"Les opérations dans le tableau ci-dessous sont prises en charge par la "
"plupart des types séquentiels, variables et immuables. La classe mère "
"abstraite :class:`collections.abc.Sequence` est fournie pour aider à "
"implémenter correctement ces opérations sur les types séquentiels "
"personnalisés."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:897
2016-10-30 09:46:26 +00:00
msgid ""
"This table lists the sequence operations sorted in ascending priority. In "
"the table, *s* and *t* are sequences of the same type, *n*, *i*, *j* and *k* "
"are integers and *x* is an arbitrary object that meets any type and value "
"restrictions imposed by *s*."
msgstr ""
"Ce tableau répertorie les opérations sur les séquences triées par priorité "
"ascendante. Dans le tableau, *s* et *t* sont des séquences du même type, "
2016-10-30 09:46:26 +00:00
"*n*, *i*, *j* et *k* sont des nombres entiers et *x* est un objet arbitraire "
"qui répond à toutes les restrictions de type et de valeur imposée par *s*."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:902
2016-10-30 09:46:26 +00:00
msgid ""
"The ``in`` and ``not in`` operations have the same priorities as the "
"comparison operations. The ``+`` (concatenation) and ``*`` (repetition) "
2017-05-27 17:46:38 +00:00
"operations have the same priority as the corresponding numeric operations. "
"[3]_"
2016-10-30 09:46:26 +00:00
msgstr ""
"Les opérations ``in`` et ``not in`` ont les mêmes priorités que les "
"opérations de comparaison. Les opérations ``+`` (concaténation) et ``*`` "
"(répétition) ont la même priorité que les opérations numériques "
"correspondantes [3]_."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:923
2016-10-30 09:46:26 +00:00
msgid "``x in s``"
msgstr "``x in s``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:923
2016-10-30 09:46:26 +00:00
msgid "``True`` if an item of *s* is equal to *x*, else ``False``"
msgstr "``True`` si un élément de *s* est égal à *x*, sinon ``False``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:926
2016-10-30 09:46:26 +00:00
msgid "``x not in s``"
msgstr "``x not in s``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:926
2016-10-30 09:46:26 +00:00
msgid "``False`` if an item of *s* is equal to *x*, else ``True``"
msgstr "``False`` si un élément de *s* est égal à *x*, sinon ``True``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:929
2016-10-30 09:46:26 +00:00
msgid "``s + t``"
msgstr "``s + t``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:929
2016-10-30 09:46:26 +00:00
msgid "the concatenation of *s* and *t*"
msgstr "la concaténation de *s* et *t*"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:929
2016-10-30 09:46:26 +00:00
msgid "(6)(7)"
msgstr "(6)(7)"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:932
2016-10-30 09:46:26 +00:00
msgid "``s * n`` or ``n * s``"
msgstr "``s * n`` ou ``n * s``"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:932
2016-10-30 09:46:26 +00:00
msgid "equivalent to adding *s* to itself *n* times"
msgstr "équivalent à ajouter *s* *n* fois à lui même"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:932
2016-10-30 09:46:26 +00:00
msgid "(2)(7)"
msgstr "(2)(7)"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:935
2016-10-30 09:46:26 +00:00
msgid "``s[i]``"
msgstr "``s[i]``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:935
2016-10-30 09:46:26 +00:00
msgid "*i*\\ th item of *s*, origin 0"
msgstr "*i*\\ :sup:`e` élément de *s* en commençant par 0"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:937
2016-10-30 09:46:26 +00:00
msgid "``s[i:j]``"
msgstr "``s[i:j]``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:937
2016-10-30 09:46:26 +00:00
msgid "slice of *s* from *i* to *j*"
msgstr "tranche (*slice*) de *s* de *i* à *j*"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:937
2016-10-30 09:46:26 +00:00
msgid "(3)(4)"
msgstr "(3)(4)"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:939
2016-10-30 09:46:26 +00:00
msgid "``s[i:j:k]``"
msgstr "``s[i:j:k]``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:939
2016-10-30 09:46:26 +00:00
msgid "slice of *s* from *i* to *j* with step *k*"
msgstr "tranche (*slice*) de *s* de *i* à *j* avec un pas de *k*"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:939
2016-10-30 09:46:26 +00:00
msgid "(3)(5)"
msgstr "(3)(5)"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:942
2016-10-30 09:46:26 +00:00
msgid "``len(s)``"
msgstr "``len(s)``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:942
2016-10-30 09:46:26 +00:00
msgid "length of *s*"
msgstr "longueur de *s*"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:944
2016-10-30 09:46:26 +00:00
msgid "``min(s)``"
msgstr "``min(s)``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:944
2016-10-30 09:46:26 +00:00
msgid "smallest item of *s*"
msgstr "plus petit élément de *s*"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:946
2016-10-30 09:46:26 +00:00
msgid "``max(s)``"
msgstr "``max(s)``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:946
2016-10-30 09:46:26 +00:00
msgid "largest item of *s*"
msgstr "plus grand élément de *s*"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:948
2016-10-30 09:46:26 +00:00
msgid "``s.index(x[, i[, j]])``"
msgstr "``s.index(x[, i[, j]])``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:948
2016-10-30 09:46:26 +00:00
msgid ""
"index of the first occurrence of *x* in *s* (at or after index *i* and "
"before index *j*)"
msgstr ""
"indice de la première occurrence de *x* dans *s* (à ou après l'indice *i* et "
"avant l'indice *j*)"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3597
2016-10-30 09:46:26 +00:00
msgid "\\(8)"
msgstr "\\(8)"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:952
2016-10-30 09:46:26 +00:00
msgid "``s.count(x)``"
msgstr "``s.count(x)``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:952
2016-10-30 09:46:26 +00:00
msgid "total number of occurrences of *x* in *s*"
msgstr "nombre total d'occurrences de *x* dans *s*"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:956
2016-10-30 09:46:26 +00:00
msgid ""
"Sequences of the same type also support comparisons. In particular, tuples "
"and lists are compared lexicographically by comparing corresponding "
"elements. This means that to compare equal, every element must compare equal "
"and the two sequences must be of the same type and have the same length. "
"(For full details see :ref:`comparisons` in the language reference.)"
msgstr ""
"Les séquences du même type gèrent également la comparaison. En particulier, "
"les *n*-uplets et les listes sont comparés lexicographiquement en comparant "
"les éléments correspondants. Cela signifie que, pour que deux séquences soit "
"égales, les éléments les constituant doivent être égaux deux à deux et les "
"deux séquences doivent être du même type et de la même longueur. (Pour plus "
"de détails voir :ref:`comparisons` dans la référence du langage.)"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:966
msgid ""
"Forward and reversed iterators over mutable sequences access values using an "
"index. That index will continue to march forward (or backward) even if the "
"underlying sequence is mutated. The iterator terminates only when an :exc:"
"`IndexError` or a :exc:`StopIteration` is encountered (or when the index "
"drops below zero)."
msgstr ""
"Les itérateurs avant et arrière sur des séquences modifiables accèdent aux "
"valeurs à l'aide d'un indice. Cet indice continue à avancer (ou à reculer) "
"même si la séquence sous-jacente est modifiée. L'itérateur ne se termine que "
"lorsqu'une :exc:`IndexError` ou une :exc:`StopIteration` est rencontrée (ou "
"lorsque l'indice tombe en dessous de zéro)."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:975
2016-10-30 09:46:26 +00:00
msgid ""
"While the ``in`` and ``not in`` operations are used only for simple "
"containment testing in the general case, some specialised sequences (such "
"as :class:`str`, :class:`bytes` and :class:`bytearray`) also use them for "
"subsequence testing::"
msgstr ""
"Bien que les opérations ``in`` et ``not in`` ne soient généralement "
"utilisées que pour les tests d'appartenance simple, certaines séquences "
"spécialisées (telles que :class:`str`, :class:`bytes` et :class:`bytearray`) "
"les utilisent aussi pour tester l'existence de sous-séquences ::"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:984
2016-10-30 09:46:26 +00:00
msgid ""
"Values of *n* less than ``0`` are treated as ``0`` (which yields an empty "
"sequence of the same type as *s*). Note that items in the sequence *s* are "
"not copied; they are referenced multiple times. This often haunts new "
"Python programmers; consider::"
msgstr ""
"Les valeurs de *n* plus petites que ``0`` sont traitées comme ``0`` (ce qui "
2016-10-30 09:46:26 +00:00
"donne une séquence vide du même type que *s*). Notez que les éléments de *s* "
2017-09-22 08:30:36 +00:00
"ne sont pas copiés ; ils sont référencés plusieurs fois. Cela hante souvent "
"de nouveaux développeurs Python, typiquement ::"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:996
2016-10-30 09:46:26 +00:00
msgid ""
"What has happened is that ``[[]]`` is a one-element list containing an empty "
"list, so all three elements of ``[[]] * 3`` are references to this single "
"empty list. Modifying any of the elements of ``lists`` modifies this single "
"list. You can create a list of different lists this way::"
msgstr ""
"Ce qui est arrivé est que ``[[]]`` est une liste à un élément contenant une "
"liste vide, de sorte que les trois éléments de ``[[]] * 3`` sont des "
"références à cette seule liste vide. Modifier l'un des éléments de ``lists`` "
"modifie cette liste unique. Vous pouvez créer une liste des différentes "
"listes de cette façon ::"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1008
2016-10-30 09:46:26 +00:00
msgid ""
"Further explanation is available in the FAQ entry :ref:`faq-multidimensional-"
"list`."
msgstr ""
"De plus amples explications sont disponibles dans la FAQ à la question :ref:"
"`faq-multidimensional-list`."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1012
2016-10-30 09:46:26 +00:00
msgid ""
2017-04-02 20:14:06 +00:00
"If *i* or *j* is negative, the index is relative to the end of sequence *s*: "
2016-10-30 09:46:26 +00:00
"``len(s) + i`` or ``len(s) + j`` is substituted. But note that ``-0`` is "
"still ``0``."
msgstr ""
2017-05-15 11:29:27 +00:00
"Si *i* ou *j* sont négatifs, l'indice est relatif à la fin de la séquence "
"*s* : ``len(s) + i`` ou ``len(s) + j`` est substitué. Mais notez que ``-0`` "
2017-05-15 11:29:27 +00:00
"est toujours ``0``."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1017
2016-10-30 09:46:26 +00:00
msgid ""
"The slice of *s* from *i* to *j* is defined as the sequence of items with "
"index *k* such that ``i <= k < j``. If *i* or *j* is greater than "
"``len(s)``, use ``len(s)``. If *i* is omitted or ``None``, use ``0``. If "
"*j* is omitted or ``None``, use ``len(s)``. If *i* is greater than or equal "
"to *j*, the slice is empty."
msgstr ""
"La tranche de *s* de *i* à *j* est définie comme la séquence d'éléments "
"d'indices *k* tels que ``i <= k < j``. Si *i* ou *j* est supérieur à "
2016-10-30 09:46:26 +00:00
"``len(s)``, ``len(s)`` est utilisé. Si *i* est omis ou ``None``, ``0`` est "
"utilisé. Si *j* est omis ou ``None``, ``len(s)`` est utilisé. Si *i* est "
"supérieur ou égal à *j*, la tranche est vide."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1024
2016-10-30 09:46:26 +00:00
msgid ""
"The slice of *s* from *i* to *j* with step *k* is defined as the sequence of "
"items with index ``x = i + n*k`` such that ``0 <= n < (j-i)/k``. In other "
"words, the indices are ``i``, ``i+k``, ``i+2*k``, ``i+3*k`` and so on, "
2017-04-02 20:14:06 +00:00
"stopping when *j* is reached (but never including *j*). When *k* is "
"positive, *i* and *j* are reduced to ``len(s)`` if they are greater. When "
"*k* is negative, *i* and *j* are reduced to ``len(s) - 1`` if they are "
"greater. If *i* or *j* are omitted or ``None``, they become \"end\" values "
"(which end depends on the sign of *k*). Note, *k* cannot be zero. If *k* is "
"``None``, it is treated like ``1``."
2016-10-30 09:46:26 +00:00
msgstr ""
"La tranche de *s* de *i* à *j* avec un pas de *k* est définie comme la "
"séquence d'éléments d'indices ``x = i + n*k`` tels que ``0 <= n < (j-i)/k``. "
2016-10-30 09:46:26 +00:00
"En d'autres termes, les indices sont ``i``, ``i+k``, ``i+2*k``, ``i+3*k`` et "
"ainsi de suite, en arrêtant lorsque *j* est atteint (mais jamais inclus). Si "
2017-05-15 11:29:27 +00:00
"*k* est positif, *i* et *j* sont réduits, s'ils sont plus grands, à "
"``len(s)``. Si *k* est négatif, *i* et *j* sont réduits à ``len(s) - 1`` "
"s'ils sont plus grands. Si *i* ou *j* sont omis ou sont ``None``, ils "
"deviennent des valeurs « limites » (la limite haute ou basse dépend du signe "
"de *k*). Notez que *k* ne peut pas valoir zéro. Si *k* est ``None``, il est "
"traité comme ``1``."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1035
2016-10-30 09:46:26 +00:00
msgid ""
"Concatenating immutable sequences always results in a new object. This "
"means that building up a sequence by repeated concatenation will have a "
"quadratic runtime cost in the total sequence length. To get a linear "
"runtime cost, you must switch to one of the alternatives below:"
msgstr ""
"Concaténer des séquences immuables donne toujours un nouvel objet. Cela "
"signifie que la construction d'une séquence par concaténations répétées aura "
"une durée d'exécution quadratique par rapport à la longueur de la séquence "
"totale. Pour obtenir un temps d'exécution linéaire, vous devez utiliser "
"l'une des alternatives suivantes :"
2016-10-30 09:46:26 +00:00
# énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1040
2016-10-30 09:46:26 +00:00
msgid ""
"if concatenating :class:`str` objects, you can build a list and use :meth:"
"`str.join` at the end or else write to an :class:`io.StringIO` instance and "
"retrieve its value when complete"
msgstr ""
"si vous concaténez des :class:`str`, vous pouvez construire une liste puis "
2016-10-30 09:46:26 +00:00
"utiliser :meth:`str.join` à la fin, ou bien écrire dans une instance de :"
"class:`io.StringIO` et récupérer sa valeur lorsque vous avez terminé ;"
2016-10-30 09:46:26 +00:00
# énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1044
2016-10-30 09:46:26 +00:00
msgid ""
"if concatenating :class:`bytes` objects, you can similarly use :meth:`bytes."
"join` or :class:`io.BytesIO`, or you can do in-place concatenation with a :"
"class:`bytearray` object. :class:`bytearray` objects are mutable and have "
"an efficient overallocation mechanism"
msgstr ""
"si vous concaténez des :class:`bytes`, vous pouvez aussi utiliser :meth:"
"`bytes.join` ou :class:`io.BytesIO`, ou vous pouvez faire les concaténations "
2016-10-30 09:46:26 +00:00
"sur place avec un objet :class:`bytearray`. Les objets :class:`bytearray` "
"sont muables et ont un mécanisme de sur-allocation efficace ;"
2016-10-30 09:46:26 +00:00
# énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1049
2016-10-30 09:46:26 +00:00
msgid "if concatenating :class:`tuple` objects, extend a :class:`list` instead"
msgstr ""
"si vous concaténez des :class:`n-uplets<tuple>`, utilisez plutôt *extend* "
"sur une :class:`list` ;"
2016-10-30 09:46:26 +00:00
# fin d'énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1051
2016-10-30 09:46:26 +00:00
msgid "for other types, investigate the relevant class documentation"
msgstr ""
"pour les autres types, cherchez dans la documentation de la classe concernée."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1055
2016-10-30 09:46:26 +00:00
msgid ""
"Some sequence types (such as :class:`range`) only support item sequences "
"that follow specific patterns, and hence don't support sequence "
"concatenation or repetition."
msgstr ""
"Certains types séquentiels (tels que :class:`range`) ne gèrent que des "
2016-10-30 09:46:26 +00:00
"séquences qui suivent des modèles spécifiques, et donc ne prennent pas en "
"charge la concaténation ou la répétition."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1060
2018-01-04 14:57:05 +00:00
msgid ""
"``index`` raises :exc:`ValueError` when *x* is not found in *s*. Not all "
"implementations support passing the additional arguments *i* and *j*. These "
"arguments allow efficient searching of subsections of the sequence. Passing "
"the extra arguments is roughly equivalent to using ``s[i:j].index(x)``, only "
"without copying any data and with the returned index being relative to the "
"start of the sequence rather than the start of the slice."
2016-10-30 09:46:26 +00:00
msgstr ""
"``index`` lève une exception :exc:`ValueError` quand *x* ne se trouve pas "
2018-05-08 15:15:16 +00:00
"dans *s*. Toutes les implémentations ne gèrent pas les deux paramètres "
"supplémentaires *i* et *j*. Ces deux arguments permettent de chercher "
"efficacement dans une sous-séquence de la séquence. Donner ces arguments est "
2018-05-11 17:37:20 +00:00
"plus ou moins équivalent à ``s[i:j].index(x)``, sans copier les données ; "
"l'indice renvoyé est relatif au début de la séquence et non au début de la "
"tranche."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1071
2016-10-30 09:46:26 +00:00
msgid "Immutable Sequence Types"
msgstr "Types de séquences immuables"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1078
2016-10-30 09:46:26 +00:00
msgid ""
"The only operation that immutable sequence types generally implement that is "
"not also implemented by mutable sequence types is support for the :func:"
"`hash` built-in."
msgstr ""
"La seule opération que les types de séquences immuables implémentent et qui "
"n'est pas implémentée par les types de séquences muables est la fonction "
"native :func:`hash`."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1082
2016-10-30 09:46:26 +00:00
msgid ""
"This support allows immutable sequences, such as :class:`tuple` instances, "
"to be used as :class:`dict` keys and stored in :class:`set` and :class:"
"`frozenset` instances."
msgstr ""
"Cette implémentation permet d'utiliser des séquences immuables, comme les "
"instances de :class:`n-uplets <tuple>`, en tant que clés de :class:`dict` et "
"stockées dans les instances de :class:`set` et :class:`frozenset`."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1086
2016-10-30 09:46:26 +00:00
msgid ""
"Attempting to hash an immutable sequence that contains unhashable values "
"will result in :exc:`TypeError`."
msgstr ""
"Essayer de hacher une séquence immuable qui contient des valeurs non "
"hachables lève une :exc:`TypeError`."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1093
2016-10-30 09:46:26 +00:00
msgid "Mutable Sequence Types"
msgstr "Types de séquences muables"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1100
2016-10-30 09:46:26 +00:00
msgid ""
"The operations in the following table are defined on mutable sequence types. "
"The :class:`collections.abc.MutableSequence` ABC is provided to make it "
"easier to correctly implement these operations on custom sequence types."
msgstr ""
"Les opérations dans le tableau ci-dessous sont définies sur les types de "
"séquences muables. La classe mère abstraite :class:`collections.abc."
2016-10-30 09:46:26 +00:00
"MutableSequence` est prévue pour faciliter l'implémentation correcte de ces "
"opérations sur les types de séquences personnalisées."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1104
2016-10-30 09:46:26 +00:00
msgid ""
"In the table *s* is an instance of a mutable sequence type, *t* is any "
"iterable object and *x* is an arbitrary object that meets any type and value "
"restrictions imposed by *s* (for example, :class:`bytearray` only accepts "
"integers that meet the value restriction ``0 <= x <= 255``)."
msgstr ""
"Dans le tableau ci-dessosus, *s* est une instance d'un type de séquence "
"muable, *t* est un objet itérable et *x* est un objet arbitraire qui répond "
"à toutes les restrictions de type et de valeur imposées par *s* (par "
"exemple, :class:`bytearray` accepte uniquement des nombres entiers qui "
"répondent à la restriction de la valeur ``0 <= x <= 255``)."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1128
2016-10-30 09:46:26 +00:00
msgid "``s[i] = x``"
msgstr "``s[i] = x``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1128
2016-10-30 09:46:26 +00:00
msgid "item *i* of *s* is replaced by *x*"
msgstr "l'élément *i* de *s* est remplacé par *x*"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1131
2016-10-30 09:46:26 +00:00
msgid "``s[i:j] = t``"
msgstr "``s[i:j] = t``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1131
2016-10-30 09:46:26 +00:00
msgid ""
"slice of *s* from *i* to *j* is replaced by the contents of the iterable *t*"
msgstr ""
"la tranche de *s* de *i* à *j* est remplacée par le contenu de l'itérable *t*"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1135
2016-10-30 09:46:26 +00:00
msgid "``del s[i:j]``"
msgstr "``del s[i:j]``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1135
2016-10-30 09:46:26 +00:00
msgid "same as ``s[i:j] = []``"
msgstr "identique à ``s[i:j] = []``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1137
2016-10-30 09:46:26 +00:00
msgid "``s[i:j:k] = t``"
msgstr "``s[i:j:k] = t``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1137
2016-10-30 09:46:26 +00:00
msgid "the elements of ``s[i:j:k]`` are replaced by those of *t*"
msgstr "les éléments de ``s[i:j:k]`` sont remplacés par ceux de *t*"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1140
2016-10-30 09:46:26 +00:00
msgid "``del s[i:j:k]``"
msgstr "``del s[i:j:k]``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1140
2016-10-30 09:46:26 +00:00
msgid "removes the elements of ``s[i:j:k]`` from the list"
msgstr "supprime les éléments de ``s[i:j:k]`` de la liste"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1143
2016-10-30 09:46:26 +00:00
msgid "``s.append(x)``"
msgstr "``s.append(x)``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1143
2016-10-30 09:46:26 +00:00
msgid ""
"appends *x* to the end of the sequence (same as ``s[len(s):len(s)] = [x]``)"
msgstr ""
"ajoute *x* à la fin de la séquence (identique à ``s[len(s):len(s)] = [x]``)"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1147
2016-10-30 09:46:26 +00:00
msgid "``s.clear()``"
msgstr "``s.clear()``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1147
2018-09-15 20:37:31 +00:00
msgid "removes all items from *s* (same as ``del s[:]``)"
msgstr "supprime tous les éléments de *s* (identique à ``del s[:]``)"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1150
2016-10-30 09:46:26 +00:00
msgid "``s.copy()``"
msgstr "``s.copy()``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1150
2018-09-15 20:37:31 +00:00
msgid "creates a shallow copy of *s* (same as ``s[:]``)"
msgstr "crée une copie superficielle de *s* (identique à ``s[:]``)"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1153
2016-10-30 09:46:26 +00:00
msgid "``s.extend(t)`` or ``s += t``"
msgstr "``s.extend(t)`` ou ``s += t``"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1153
2016-10-30 09:46:26 +00:00
msgid ""
"extends *s* with the contents of *t* (for the most part the same as "
"``s[len(s):len(s)] = t``)"
msgstr "étend *s* avec le contenu de *t* (proche de ``s[len(s):len(s)] = t``)"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1158
2016-10-30 09:46:26 +00:00
msgid "``s *= n``"
msgstr "``s *= n``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1158
2016-10-30 09:46:26 +00:00
msgid "updates *s* with its contents repeated *n* times"
msgstr "met à jour *s* avec son contenu répété *n* fois"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1161
2016-10-30 09:46:26 +00:00
msgid "``s.insert(i, x)``"
msgstr "``s.insert(i, x)``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1161
2016-10-30 09:46:26 +00:00
msgid ""
"inserts *x* into *s* at the index given by *i* (same as ``s[i:i] = [x]``)"
msgstr ""
"insère *x* dans *s* à l'indice donné par *i* (identique à ``s[i:i] = [x]``)"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1165
msgid "``s.pop()`` or ``s.pop(i)``"
msgstr "``s.pop()`` ou ``s.pop(i)``"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1165
2016-10-30 09:46:26 +00:00
msgid "retrieves the item at *i* and also removes it from *s*"
msgstr "récupère l'élément à la position *i* et le supprime de *s*"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1168
2016-10-30 09:46:26 +00:00
msgid "``s.remove(x)``"
msgstr "``s.remove(x)``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1168
2018-06-28 13:32:56 +00:00
msgid "remove the first item from *s* where ``s[i]`` is equal to *x*"
msgstr "supprime le premier élément de *s* pour lequel ``s[i]`` est égal à *x*"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1171
2016-10-30 09:46:26 +00:00
msgid "``s.reverse()``"
msgstr "``s.reverse()``"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1171
2016-10-30 09:46:26 +00:00
msgid "reverses the items of *s* in place"
msgstr "inverse sur place les éléments de *s*"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1179
2016-10-30 09:46:26 +00:00
msgid "*t* must have the same length as the slice it is replacing."
msgstr "*t* doit avoir la même longueur que la tranche qu'il remplace."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1182
2016-10-30 09:46:26 +00:00
msgid ""
"The optional argument *i* defaults to ``-1``, so that by default the last "
"item is removed and returned."
msgstr ""
"L'argument optionnel *i* vaut ``-1`` par défaut, afin que, par défaut, le "
"dernier élément soit retiré et renvoyé."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1186
2019-09-04 09:35:23 +00:00
msgid ":meth:`remove` raises :exc:`ValueError` when *x* is not found in *s*."
2016-10-30 09:46:26 +00:00
msgstr ""
":meth:`remove` lève une exception :exc:`ValueError` si *x* ne se trouve pas "
"dans *s*."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1189
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`reverse` method modifies the sequence in place for economy of "
"space when reversing a large sequence. To remind users that it operates by "
"side effect, it does not return the reversed sequence."
msgstr ""
"La méthode :meth:`reverse` modifie la séquence sur place pour économiser de "
2016-10-30 09:46:26 +00:00
"l'espace lors du traitement de grandes séquences. Pour rappeler aux "
"utilisateurs qu'elle a un effet de bord, elle ne renvoie pas la séquence "
"inversée."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1194
2016-10-30 09:46:26 +00:00
msgid ""
":meth:`clear` and :meth:`!copy` are included for consistency with the "
"interfaces of mutable containers that don't support slicing operations (such "
2019-09-04 09:35:23 +00:00
"as :class:`dict` and :class:`set`). :meth:`!copy` is not part of the :class:"
"`collections.abc.MutableSequence` ABC, but most concrete mutable sequence "
"classes provide it."
2016-10-30 09:46:26 +00:00
msgstr ""
":meth:`clear` et :meth:`!copy` sont incluses pour la compatibilité avec les "
"interfaces des conteneurs muables qui ne gèrent pas les opérations de "
"découpage (comme :class:`dict` et :class:`set`). :meth:`!copy` ne fait pas "
"partie des classes mères abstraites (*ABC*) de :class:`collections.abc."
"MutableSequence`, mais la plupart des classes implémentées gérant des "
"séquences la proposent."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1200
2016-10-30 09:46:26 +00:00
msgid ":meth:`clear` and :meth:`!copy` methods."
msgstr "méthodes :meth:`clear` et :meth:`!copy`."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1204
2016-10-30 09:46:26 +00:00
msgid ""
"The value *n* is an integer, or an object implementing :meth:`~object."
"__index__`. Zero and negative values of *n* clear the sequence. Items in "
"the sequence are not copied; they are referenced multiple times, as "
"explained for ``s * n`` under :ref:`typesseq-common`."
msgstr ""
"La valeur *n* est un entier, ou un objet implémentant :meth:`~object."
"__index__`. Zéro et les valeurs négatives de *n* permettent d'effacer la "
2017-09-22 08:30:36 +00:00
"séquence. Les éléments dans la séquence ne sont pas copiés ; ils sont "
2016-10-30 09:46:26 +00:00
"référencés plusieurs fois, comme expliqué pour ``s * n`` dans :ref:`typesseq-"
"common`."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1213
2016-10-30 09:46:26 +00:00
msgid "Lists"
msgstr "Listes"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1217
2016-10-30 09:46:26 +00:00
msgid ""
"Lists are mutable sequences, typically used to store collections of "
"homogeneous items (where the precise degree of similarity will vary by "
"application)."
msgstr ""
"Les listes sont des séquences muables, généralement utilisées pour stocker "
"des collections d'éléments homogènes (le degré de similitude varie selon "
"l'usage)."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1223
2016-10-30 09:46:26 +00:00
msgid "Lists may be constructed in several ways:"
msgstr "Les listes peuvent être construites de différentes manières :"
2016-10-30 09:46:26 +00:00
# énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1225
2016-10-30 09:46:26 +00:00
msgid "Using a pair of square brackets to denote the empty list: ``[]``"
msgstr ""
"en utilisant une paire de crochets pour indiquer une liste vide : ``[]`` ;"
2016-10-30 09:46:26 +00:00
# énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1226
2016-10-30 09:46:26 +00:00
msgid ""
"Using square brackets, separating items with commas: ``[a]``, ``[a, b, c]``"
msgstr ""
"au moyen de crochets, en séparant les éléments par des virgules : ``[a]``, "
"``[a, b, c]`` ;"
2016-10-30 09:46:26 +00:00
# énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1227
2016-10-30 09:46:26 +00:00
msgid "Using a list comprehension: ``[x for x in iterable]``"
msgstr "en utilisant une liste en compréhension : ``[x for x in iterable]`` ;"
2016-10-30 09:46:26 +00:00
# fin d'énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1228
2016-10-30 09:46:26 +00:00
msgid "Using the type constructor: ``list()`` or ``list(iterable)``"
msgstr ""
"en utilisant le constructeur du type : ``list()`` ou ``list(iterable)``."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1230
2016-10-30 09:46:26 +00:00
msgid ""
"The constructor builds a list whose items are the same and in the same order "
"as *iterable*'s items. *iterable* may be either a sequence, a container "
"that supports iteration, or an iterator object. If *iterable* is already a "
"list, a copy is made and returned, similar to ``iterable[:]``. For example, "
"``list('abc')`` returns ``['a', 'b', 'c']`` and ``list( (1, 2, 3) )`` "
"returns ``[1, 2, 3]``. If no argument is given, the constructor creates a "
"new empty list, ``[]``."
msgstr ""
"Le constructeur crée une liste dont les éléments sont les mêmes et dans le "
"même ordre que les éléments d'*iterable*. *iterable* peut être une séquence, "
"un conteneur qui prend en charge l'itération, ou un itérateur. Si *iterable* "
"est déjà une liste, une copie est faite et renvoyée, comme avec "
"``iterable[:]``. Par exemple, ``list('abc')`` renvoie ``['a', 'b', 'c']`` et "
"``list( (1, 2, 3) )`` renvoie ``[1, 2, 3]``. Si aucun argument est donné, le "
"constructeur crée une nouvelle liste vide, ``[]``."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1239
2016-10-30 09:46:26 +00:00
msgid ""
"Many other operations also produce lists, including the :func:`sorted` built-"
"in."
msgstr ""
"De nombreuses autres opérations produisent des listes, comme la fonction "
2016-10-30 09:46:26 +00:00
"native :func:`sorted`."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1242
2016-10-30 09:46:26 +00:00
msgid ""
"Lists implement all of the :ref:`common <typesseq-common>` and :ref:`mutable "
"<typesseq-mutable>` sequence operations. Lists also provide the following "
"additional method:"
msgstr ""
"Les listes gèrent toutes les opérations des séquences :ref:`communes "
"<typesseq-common>` et :ref:`muables <typesseq-mutable>`. Les listes "
2017-09-22 08:30:36 +00:00
"fournissent également la méthode supplémentaire suivante :"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1248
2016-10-30 09:46:26 +00:00
msgid ""
"This method sorts the list in place, using only ``<`` comparisons between "
"items. Exceptions are not suppressed - if any comparison operations fail, "
"the entire sort operation will fail (and the list will likely be left in a "
"partially modified state)."
msgstr ""
"Cette méthode trie la liste sur place, en utilisant uniquement des "
"comparaisons ``<`` entre les éléments. Les exceptions ne sont pas "
"supprimées : si n'importe quelle opération de comparaison échoue, le tri "
"échoue (et la liste sera probablement laissée dans un état partiellement "
"modifié)."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1253
2016-10-30 09:46:26 +00:00
msgid ""
":meth:`sort` accepts two arguments that can only be passed by keyword (:ref:"
"`keyword-only arguments <keyword-only_parameter>`):"
msgstr ""
":meth:`sort` accepte deux arguments qui ne peuvent être fournis que nommés "
"(voir :ref:`arguments nommés <keyword-only_parameter>`) :"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1256
2016-10-30 09:46:26 +00:00
msgid ""
"*key* specifies a function of one argument that is used to extract a "
"comparison key from each list element (for example, ``key=str.lower``). The "
"key corresponding to each item in the list is calculated once and then used "
"for the entire sorting process. The default value of ``None`` means that "
"list items are sorted directly without calculating a separate key value."
msgstr ""
"*key* spécifie une fonction d'un argument utilisée pour extraire une clé de "
"comparaison de chaque élément de la liste (par exemple, ``key=str.lower``). "
"La clé correspondant à chaque élément de la liste n'est calculée qu'une "
"seule fois, puis utilisée durant tout le processus. La valeur par défaut, "
"``None``, signifie que les éléments sont triés directement sans calculer de "
 valeur clé » séparée."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1263
2016-10-30 09:46:26 +00:00
msgid ""
"The :func:`functools.cmp_to_key` utility is available to convert a 2.x style "
"*cmp* function to a *key* function."
msgstr ""
"La fonction utilitaire :func:`functools.cmp_to_key` est disponible pour "
"convertir une fonction *cmp* du style 2.x à une fonction *key*."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1266
2016-10-30 09:46:26 +00:00
msgid ""
"*reverse* is a boolean value. If set to ``True``, then the list elements "
"are sorted as if each comparison were reversed."
msgstr ""
"*reverse*, une valeur booléenne. Si elle est ``True``, la liste d'éléments "
"est triée comme si toutes les comparaisons étaient inversées."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1269
2016-10-30 09:46:26 +00:00
msgid ""
"This method modifies the sequence in place for economy of space when sorting "
"a large sequence. To remind users that it operates by side effect, it does "
"not return the sorted sequence (use :func:`sorted` to explicitly request a "
"new sorted list instance)."
msgstr ""
"Cette méthode modifie la séquence sur place pour économiser de l'espace lors "
"du tri de grandes séquences. Pour rappeler aux utilisateurs cet effet de "
"bord, elle ne renvoie pas la séquence triée (utilisez :func:`sorted` pour "
"demander explicitement une nouvelle instance de liste triée)."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1274
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`sort` method is guaranteed to be stable. A sort is stable if it "
"guarantees not to change the relative order of elements that compare equal "
"--- this is helpful for sorting in multiple passes (for example, sort by "
"department, then by salary grade)."
msgstr ""
"La méthode :meth:`sort` est garantie stable. Un tri est stable s'il garantit "
"de ne pas changer l'ordre relatif des éléments égaux — cela est utile pour "
"trier en plusieurs passes (par exemple, trier par service, puis par niveau "
"de salaire)."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1279
2019-09-04 09:35:23 +00:00
msgid ""
"For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`."
msgstr ""
2019-09-16 10:08:42 +00:00
"Pour des exemples de tris et un bref tutoriel, consultez :ref:`sortinghowto`."
2019-09-04 09:35:23 +00:00
# suit un :
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1283
2016-10-30 09:46:26 +00:00
msgid ""
"While a list is being sorted, the effect of attempting to mutate, or even "
"inspect, the list is undefined. The C implementation of Python makes the "
"list appear empty for the duration, and raises :exc:`ValueError` if it can "
"detect that the list has been mutated during a sort."
msgstr ""
"l'effet de tenter de modifier, ou même inspecter la liste pendant qu'on la "
"trie est indéfini. L'implémentation C de Python fait apparaître la liste "
"comme vide pour la durée du traitement, et lève :exc:`ValueError` si elle "
"détecte que la liste a été modifiée au cours du tri."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1292
2016-10-30 09:46:26 +00:00
msgid "Tuples"
msgstr "*N*-uplets"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1296
2016-10-30 09:46:26 +00:00
msgid ""
"Tuples are immutable sequences, typically used to store collections of "
"heterogeneous data (such as the 2-tuples produced by the :func:`enumerate` "
"built-in). Tuples are also used for cases where an immutable sequence of "
"homogeneous data is needed (such as allowing storage in a :class:`set` or :"
"class:`dict` instance)."
msgstr ""
"Les *n*-uplets (*tuples* en anglais) sont des séquences immuables, "
2017-09-22 14:07:50 +00:00
"généralement utilisées pour stocker des collections de données hétérogènes "
"(telles que les paires produites par la fonction native :func:`enumerate`). "
"Les *n*-uplets sont également utilisés dans des cas où une séquence homogène "
"et immuable de données est nécessaire (pour, par exemple, les stocker dans "
"un :class:`ensemble <set>` ou un :class:`dictionnaire <dict>`)."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1304
2016-10-30 09:46:26 +00:00
msgid "Tuples may be constructed in a number of ways:"
msgstr "Les *n*-uplets peuvent être construits de différentes façons :"
2016-10-30 09:46:26 +00:00
# énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1306
2016-10-30 09:46:26 +00:00
msgid "Using a pair of parentheses to denote the empty tuple: ``()``"
msgstr ""
"en utilisant une paire de parenthèses pour désigner le *n*-uplet vide : "
"``()`` ;"
2016-10-30 09:46:26 +00:00
# énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1307
2016-10-30 09:46:26 +00:00
msgid "Using a trailing comma for a singleton tuple: ``a,`` or ``(a,)``"
msgstr ""
"en utilisant une virgule, pour créer un *n*-uplet d'un élément : ``a,`` ou "
"``(a,)`` ;"
2016-10-30 09:46:26 +00:00
# énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1308
2016-10-30 09:46:26 +00:00
msgid "Separating items with commas: ``a, b, c`` or ``(a, b, c)``"
msgstr ""
"en séparant les éléments avec des virgules : ``a, b, c`` ou ``(a, b, c)`` ;"
2016-10-30 09:46:26 +00:00
# fin d'énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1309
2016-10-30 09:46:26 +00:00
msgid "Using the :func:`tuple` built-in: ``tuple()`` or ``tuple(iterable)``"
msgstr ""
"en utilisant la fonction native :func:`tuple` : ``tuple()`` ou "
"``tuple(iterable)``."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1311
2016-10-30 09:46:26 +00:00
msgid ""
"The constructor builds a tuple whose items are the same and in the same "
"order as *iterable*'s items. *iterable* may be either a sequence, a "
"container that supports iteration, or an iterator object. If *iterable* is "
"already a tuple, it is returned unchanged. For example, ``tuple('abc')`` "
"returns ``('a', 'b', 'c')`` and ``tuple( [1, 2, 3] )`` returns ``(1, 2, "
"3)``. If no argument is given, the constructor creates a new empty tuple, "
"``()``."
msgstr ""
"Le constructeur construit un *n*-uplet dont les éléments sont les mêmes et "
"dans le même ordre que les éléments de *iterable*. *iterable* peut être une "
"séquence, un conteneur qui prend en charge l'itération ou un itérateur. Si "
"*iterable* est déjà un *n*-uplet, il est renvoyé inchangé. Par exemple, "
"``tuple('abc')`` renvoie ``('a', 'b', 'c')`` et ``tuple( [1, 2, 3] )`` "
"renvoie ``(1, 2, 3)``. Si aucun argument n'est donné, le constructeur crée "
"un nouveau *n*-uplet vide, ``()``."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1319
2016-10-30 09:46:26 +00:00
msgid ""
"Note that it is actually the comma which makes a tuple, not the parentheses. "
"The parentheses are optional, except in the empty tuple case, or when they "
"are needed to avoid syntactic ambiguity. For example, ``f(a, b, c)`` is a "
"function call with three arguments, while ``f((a, b, c))`` is a function "
"call with a 3-tuple as the sole argument."
msgstr ""
"Notez que c'est en fait la virgule qui fait un *n*-uplet et non les "
"parenthèses. Les parenthèses sont facultatives, sauf dans le cas du *n*-"
"uplet vide, ou lorsqu'elles sont nécessaires pour éviter l'ambiguïté "
"syntaxique. Par exemple, ``f(a, b, c)`` est un appel de fonction avec trois "
"arguments, alors que ``f((a, b, c))`` est un appel de fonction avec un "
"triplet comme unique argument."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1325
2016-10-30 09:46:26 +00:00
msgid ""
"Tuples implement all of the :ref:`common <typesseq-common>` sequence "
"operations."
msgstr ""
"Les *n*-uplets implémentent toutes les opérations :ref:`communes <typesseq-"
2016-10-30 09:46:26 +00:00
"common>` des séquences."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1328
2016-10-30 09:46:26 +00:00
msgid ""
"For heterogeneous collections of data where access by name is clearer than "
"access by index, :func:`collections.namedtuple` may be a more appropriate "
"choice than a simple tuple object."
msgstr ""
"Pour les collections hétérogènes de données où l'accès par nom est plus "
"clair que l'accès par indice, :func:`collections.namedtuple` peut être un "
"choix plus approprié qu'un simple *n*-uplet."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1336
2016-10-30 09:46:26 +00:00
msgid "Ranges"
msgstr "*Ranges*"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1340
2016-10-30 09:46:26 +00:00
msgid ""
"The :class:`range` type represents an immutable sequence of numbers and is "
"commonly used for looping a specific number of times in :keyword:`for` loops."
msgstr ""
"Le type :class:`range` représente une séquence immuable de nombres et est "
"couramment utilisé pour itérer un certain nombre de fois dans les boucles :"
"keyword:`for`."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1347
2016-10-30 09:46:26 +00:00
msgid ""
"The arguments to the range constructor must be integers (either built-in :"
2021-12-31 10:41:52 +00:00
"class:`int` or any object that implements the :meth:`~object.__index__` "
"special method). If the *step* argument is omitted, it defaults to ``1``. "
"If the *start* argument is omitted, it defaults to ``0``. If *step* is "
"zero, :exc:`ValueError` is raised."
2016-10-30 09:46:26 +00:00
msgstr ""
"Les arguments du constructeur de *range* doivent être des entiers (des :"
"class:`int` ou tout autre objet qui implémente la méthode spéciale :meth:"
"`~object.__index__`). La valeur par défaut de l'argument *step* est ``1``. "
"La valeur par défaut de l'argument *start* est ``0``. Si *step* est égal à "
2016-10-30 09:46:26 +00:00
"zéro, une exception :exc:`ValueError` est levée."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1353
2016-10-30 09:46:26 +00:00
msgid ""
"For a positive *step*, the contents of a range ``r`` are determined by the "
"formula ``r[i] = start + step*i`` where ``i >= 0`` and ``r[i] < stop``."
msgstr ""
"Pour un *step* positif, le contenu d'un *range* ``r`` est déterminé par la "
"formule ``r[i] = start + step*i`` où ``i >= 0`` et ``r[i] < stop``."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1357
2016-10-30 09:46:26 +00:00
msgid ""
"For a negative *step*, the contents of the range are still determined by the "
"formula ``r[i] = start + step*i``, but the constraints are ``i >= 0`` and "
"``r[i] > stop``."
msgstr ""
"Pour un *step* négatif, le contenu du *range* est toujours déterminé par la "
"formule ``r[i] = start + step*i``, mais les contraintes sont ``i >= 0`` et "
"``r[i] > stop``."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1361
2016-10-30 09:46:26 +00:00
msgid ""
"A range object will be empty if ``r[0]`` does not meet the value constraint. "
"Ranges do support negative indices, but these are interpreted as indexing "
"from the end of the sequence determined by the positive indices."
msgstr ""
"Un objet *range* sera vide si ``r[0]`` ne répond pas à la contrainte de "
"valeur. Les *range* prennent en charge les indices négatifs, mais ceux-ci "
"sont interprétées comme un indice à partir de la fin de la séquence "
"déterminée par les indices positifs."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1366
2016-10-30 09:46:26 +00:00
msgid ""
"Ranges containing absolute values larger than :data:`sys.maxsize` are "
"permitted but some features (such as :func:`len`) may raise :exc:"
"`OverflowError`."
msgstr ""
"Les *range* contenant des valeurs absolues plus grandes que :data:`sys."
"maxsize` sont permises, mais certaines fonctionnalités (comme :func:`len`) "
"peuvent lever :exc:`OverflowError`."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1370
2016-10-30 09:46:26 +00:00
msgid "Range examples::"
msgstr "Exemples avec *range* ::"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1387
2016-10-30 09:46:26 +00:00
msgid ""
"Ranges implement all of the :ref:`common <typesseq-common>` sequence "
"operations except concatenation and repetition (due to the fact that range "
"objects can only represent sequences that follow a strict pattern and "
"repetition and concatenation will usually violate that pattern)."
msgstr ""
"*range* implémente toutes les opérations :ref:`communes <typesseq-common>` "
"des séquences sauf la concaténation et la répétition (en raison du fait que "
"les *range* ne peuvent représenter que des séquences qui respectent un motif "
"strict et que la répétition et la concaténation les feraient dévier de ce "
"motif)."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1394
2016-10-30 09:46:26 +00:00
msgid ""
"The value of the *start* parameter (or ``0`` if the parameter was not "
"supplied)"
msgstr ""
"Valeur du paramètre *start* (ou ``0`` si le paramètre n'a pas été fourni)"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1399
2016-10-30 09:46:26 +00:00
msgid "The value of the *stop* parameter"
msgstr "Valeur du paramètre *stop*"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1403
2016-10-30 09:46:26 +00:00
msgid ""
"The value of the *step* parameter (or ``1`` if the parameter was not "
"supplied)"
msgstr ""
"Valeur du paramètre *step* (ou ``1`` si le paramètre n'a pas été fourni)"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1406
2016-10-30 09:46:26 +00:00
msgid ""
"The advantage of the :class:`range` type over a regular :class:`list` or :"
"class:`tuple` is that a :class:`range` object will always take the same "
"(small) amount of memory, no matter the size of the range it represents (as "
"it only stores the ``start``, ``stop`` and ``step`` values, calculating "
"individual items and subranges as needed)."
msgstr ""
"L'avantage du type :class:`range` sur une :class:`liste <list>` classique ou "
"un :class:`n-uplet <tuple>` est qu'un objet :class:`range` occupe toujours "
"la même (petite) quantité de mémoire, peu importe la taille de l'intervalle "
"qu'il représente (car il ne stocke que les valeurs ``start``, ``stop``, "
"``step``, le calcul des éléments individuels et les sous-intervalles au "
"besoin)."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1412
2016-10-30 09:46:26 +00:00
msgid ""
"Range objects implement the :class:`collections.abc.Sequence` ABC, and "
"provide features such as containment tests, element index lookup, slicing "
"and support for negative indices (see :ref:`typesseq`):"
msgstr ""
"Les *range* implémentent la classe mère abstraite :class:`collections.abc."
2017-09-22 08:30:36 +00:00
"Sequence` et offrent des fonctionnalités telles que les tests d'appartenance "
"(avec *in*), de recherche par indice, les tranches et ils gèrent les indices "
"négatifs (voir :ref:`typesseq`) :"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1432
2016-10-30 09:46:26 +00:00
msgid ""
"Testing range objects for equality with ``==`` and ``!=`` compares them as "
"sequences. That is, two range objects are considered equal if they "
"represent the same sequence of values. (Note that two range objects that "
"compare equal might have different :attr:`~range.start`, :attr:`~range.stop` "
"and :attr:`~range.step` attributes, for example ``range(0) == range(2, 1, "
"3)`` or ``range(0, 3, 2) == range(0, 4, 2)``.)"
msgstr ""
"Comparer des *range* avec ``==`` et ``!=`` les compare comme des séquences. "
"C'est-à-dire que deux objets *range* sont considérés comme égaux s'ils "
"représentent la même séquence de valeurs. (Notez que deux objets *range* "
"dits égaux pourraient avoir leurs attributs :attr:`~range.start`, :attr:"
"`~range.stop` et :attr:`~range.step` différents, par exemple ``range(0) == "
"range(2, 1, 3)`` ou ``range(0, 3, 2) == range(0, 4, 2)``.)"
2016-10-30 09:46:26 +00:00
# suit un :
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1439
2016-10-30 09:46:26 +00:00
msgid ""
"Implement the Sequence ABC. Support slicing and negative indices. Test :"
"class:`int` objects for membership in constant time instead of iterating "
"through all items."
msgstr ""
"implémente la classe mère abstraite *Sequence*. prend en charge les tranches "
"(*slicing*) et les indices négatifs. Teste l'appartenance d'un :class:`int` "
"en temps constant au lieu d'itérer sur tous les éléments."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1445
2016-10-30 09:46:26 +00:00
msgid ""
"Define '==' and '!=' to compare range objects based on the sequence of "
"values they define (instead of comparing based on object identity)."
msgstr ""
"``==`` et ``!=`` comparent des *range* en fonction de la séquence de valeurs "
2016-10-30 09:46:26 +00:00
"qu'ils définissent (au lieu d'une comparaison fondée sur l'identité de "
"l'objet)."
# suit un :
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1450
2016-10-30 09:46:26 +00:00
msgid ""
"The :attr:`~range.start`, :attr:`~range.stop` and :attr:`~range.step` "
"attributes."
msgstr ""
"les attributs :attr:`~range.start`, :attr:`~range.stop` et :attr:`~range."
2016-10-30 09:46:26 +00:00
"step`."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1456
2016-10-30 09:46:26 +00:00
msgid ""
"The `linspace recipe <https://code.activestate.com/recipes/579000/>`_ shows "
"how to implement a lazy version of range suitable for floating point "
2016-10-30 09:46:26 +00:00
"applications."
msgstr ""
"La `recette linspace <https://code.activestate.com/recipes/579000/>`_ montre "
2017-05-15 11:29:27 +00:00
"comment implémenter une version paresseuse de *range* adaptée aux nombres à "
"virgule flottante."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1468
2016-10-30 09:46:26 +00:00
msgid "Text Sequence Type --- :class:`str`"
msgstr "Type Séquence de Texte — :class:`str`"
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1470
2016-10-30 09:46:26 +00:00
msgid ""
"Textual data in Python is handled with :class:`str` objects, or :dfn:"
"`strings`. Strings are immutable :ref:`sequences <typesseq>` of Unicode code "
"points. String literals are written in a variety of ways:"
msgstr ""
"Les données textuelles en Python sont manipulées avec des objets :class:"
"`str` ou :dfn:`strings`. Les chaînes sont des :ref:`séquences <typesseq>` "
2017-09-22 08:30:36 +00:00
"immuables de points de code Unicode. Les chaînes littérales peuvent être "
"écrites de différentes manières :"
2016-10-30 09:46:26 +00:00
# énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1475
2016-10-30 09:46:26 +00:00
msgid "Single quotes: ``'allows embedded \"double\" quotes'``"
msgstr ""
"entre guillemets simples : ``'cela autorise les \"guillemets anglais\"'`` ;"
2016-10-30 09:46:26 +00:00
# énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1476
2021-12-31 10:41:52 +00:00
msgid "Double quotes: ``\"allows embedded 'single' quotes\"``"
msgstr ""
"entre guillemets (anglais) : ``\"cela autorise les guillemets 'simples'\"`` ;"
2016-10-30 09:46:26 +00:00
# fin d'énumération
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1477
2016-10-30 09:46:26 +00:00
msgid ""
"Triple quoted: ``'''Three single quotes'''``, ``\"\"\"Three double quotes"
"\"\"\"``"
2016-10-30 09:46:26 +00:00
msgstr ""
"entre guillemets triples : ``'''Trois guillemets simples'''``, ``\"\"\"Trois "
"guillemets anglais\"\"\"``."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1479
2016-10-30 09:46:26 +00:00
msgid ""
"Triple quoted strings may span multiple lines - all associated whitespace "
"will be included in the string literal."
msgstr ""
"Les chaînes entre guillemets triples peuvent couvrir plusieurs lignes, tous "
"les espaces associées sont alors incluses dans la chaîne littérale."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1482
2016-10-30 09:46:26 +00:00
msgid ""
"String literals that are part of a single expression and have only "
"whitespace between them will be implicitly converted to a single string "
"literal. That is, ``(\"spam \" \"eggs\") == \"spam eggs\"``."
msgstr ""
"Les chaînes littérales qui font partie d'une seule expression et ont "
"seulement des espaces entre elles sont implicitement converties en une seule "
"chaîne littérale. Autrement dit, ``(\"spam \" \"eggs\") == \"spam eggs\"``."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1486
2016-10-30 09:46:26 +00:00
msgid ""
"See :ref:`strings` for more about the various forms of string literal, "
"including supported escape sequences, and the ``r`` (\"raw\") prefix that "
"disables most escape sequence processing."
msgstr ""
"Voir :ref:`strings` pour plus d'informations sur les différentes formes de "
"chaînes littérales, y compris les séquences d'échappement prises en charge, "
"et le préfixe ``r`` (*raw* pour brut) qui désactive la plupart des "
"traitements de séquence d'échappement."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1490
2016-10-30 09:46:26 +00:00
msgid ""
"Strings may also be created from other objects using the :class:`str` "
"constructor."
msgstr ""
"Les chaînes peuvent également être créées à partir d'autres objets à l'aide "
2016-10-30 09:46:26 +00:00
"du constructeur :class:`str`."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1493
2016-10-30 09:46:26 +00:00
msgid ""
"Since there is no separate \"character\" type, indexing a string produces "
"strings of length 1. That is, for a non-empty string *s*, ``s[0] == s[0:1]``."
msgstr ""
"Comme il n'y a pas de type « caractère » propre, un indice d'une chaîne "
"produit une chaîne de longueur 1. Autrement dit, pour une chaîne non vide "
2016-10-30 09:46:26 +00:00
"*s*, ``s[0] == s[0:1]``."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1499
2016-10-30 09:46:26 +00:00
msgid ""
"There is also no mutable string type, but :meth:`str.join` or :class:`io."
"StringIO` can be used to efficiently construct strings from multiple "
"fragments."
msgstr ""
"Il n'y a aucun type de chaîne muable, mais :meth:`str.join` ou :class:`io."
2016-10-30 09:46:26 +00:00
"StringIO` peuvent être utilisées pour construire efficacement des chaînes à "
"partir de plusieurs fragments."
# suit un :
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1503
2016-10-30 09:46:26 +00:00
msgid ""
"For backwards compatibility with the Python 2 series, the ``u`` prefix is "
"once again permitted on string literals. It has no effect on the meaning of "
"string literals and cannot be combined with the ``r`` prefix."
msgstr ""
"pour une compatibilité ascendante avec la série Python 2, le préfixe ``u`` "
"est à nouveau autorisé sur les chaînes littérales. Il n'a aucun effet sur le "
"sens des chaînes littérales et ne peut pas être combiné avec le préfixe "
"``r``."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1515
2016-10-30 09:46:26 +00:00
msgid ""
"Return a :ref:`string <textseq>` version of *object*. If *object* is not "
"provided, returns the empty string. Otherwise, the behavior of ``str()`` "
"depends on whether *encoding* or *errors* is given, as follows."
msgstr ""
"Renvoie une représentation en :ref:`chaîne de caractères <textseq>` de "
"*object*. Si *object* n'est pas fourni, renvoie une chaîne vide. Sinon, le "
"comportement de ``str()`` dépend des valeurs données pour *encoding* et "
"*errors*, comme indiqué ci-dessous."
2016-10-30 09:46:26 +00:00
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:1519
2016-10-30 09:46:26 +00:00
msgid ""
"If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:"
2022-05-22 21:15:02 +00:00
"`type(object).__str__(object) <object.__str__>`, which is the \"informal\" "
"or nicely printable string representation of *object*. For string objects, "
"this is the string itself. If *object* does not have a :meth:`~object."
"__str__` method, then :func:`str` falls back to returning :meth:"
"`repr(object) <repr>`."
2016-10-30 09:46:26 +00:00
msgstr ""
"Si ni *encoding* ni *errors* ne sont donnés, ``str(object)`` renvoie :meth:"
"`type(object).__str__(object) <object.__str__>`, qui est la représentation "
"en chaîne de caractères « informelle » ou joliment affichable de *object*. "
"Pour les chaînes, c'est la chaîne elle-même. Si *object* n'a pas de méthode :"
"meth:`~object.__str__`, :func:`str` utilise :meth:`repr(object) <repr>`."
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1531
2016-10-30 09:46:26 +00:00
msgid ""
"If at least one of *encoding* or *errors* is given, *object* should be a :"
"term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In "
"this case, if *object* is a :class:`bytes` (or :class:`bytearray`) object, "
"then ``str(bytes, encoding, errors)`` is equivalent to :meth:`bytes."
"decode(encoding, errors) <bytes.decode>`. Otherwise, the bytes object "
"underlying the buffer object is obtained before calling :meth:`bytes."
"decode`. See :ref:`binaryseq` and :ref:`bufferobjects` for information on "
"buffer objects."
msgstr ""
"Si au moins un des deux arguments *encoding* ou *errors* est donné, *object* "
"doit être un :term:`objet octet-compatible <bytes-like object>` (par "
"exemple, :class:`bytes` ou :class:`bytearray`). Dans ce cas, si *object* est "
"un objet :class:`bytes` (ou :class:`bytearray`), alors ``str(bytes, "
"encoding, errors)`` est équivalent à :meth:`bytes.decode(encoding, errors) "
"<bytes.decode>`. Sinon, l'objet *bytes* sous-jacent au tampon est obtenu "
"avant d'appeler :meth:`bytes.decode`. Voir :ref:`binaryseq` et :ref:"
"`bufferobjects` pour plus d'informations sur les tampons."
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1540
2016-10-30 09:46:26 +00:00
msgid ""
"Passing a :class:`bytes` object to :func:`str` without the *encoding* or "
"*errors* arguments falls under the first case of returning the informal "
"string representation (see also the :option:`-b` command-line option to "
"Python). For example::"
msgstr ""
"Donner un objet :class:`bytes` à :func:`str` sans argument *encoding* ni "
"argument *errors* relève du premier cas, où la représentation informelle de "
"la chaîne est renvoyée (voir aussi l'option :option:`-b` de Python). Par "
"exemple ::"
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1548
2016-10-30 09:46:26 +00:00
msgid ""
"For more information on the ``str`` class and its methods, see :ref:"
"`textseq` and the :ref:`string-methods` section below. To output formatted "
"strings, see the :ref:`f-strings` and :ref:`formatstrings` sections. In "
"addition, see the :ref:`stringservices` section."
msgstr ""
2017-05-15 11:29:27 +00:00
"Pour plus d'informations sur la classe ``str`` et ses méthodes, voir les "
"sections :ref:`textseq` et :ref:`string-methods`. Pour formater des chaînes "
2017-05-15 11:29:27 +00:00
"de caractères, voir les sections :ref:`f-strings` et :ref:`formatstrings`. "
2017-09-22 08:30:36 +00:00
"La section :ref:`stringservices` contient aussi des informations."
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1560
2016-10-30 09:46:26 +00:00
msgid "String Methods"
msgstr "Méthodes de chaînes de caractères"
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1565
2016-10-30 09:46:26 +00:00
msgid ""
"Strings implement all of the :ref:`common <typesseq-common>` sequence "
"operations, along with the additional methods described below."
msgstr ""
"Les chaînes implémentent toutes les opérations :ref:`communes des séquences "
"<typesseq-common>`, ainsi que les autres méthodes décrites ci-dessous."
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1568
2016-10-30 09:46:26 +00:00
msgid ""
"Strings also support two styles of string formatting, one providing a large "
"degree of flexibility and customization (see :meth:`str.format`, :ref:"
"`formatstrings` and :ref:`string-formatting`) and the other based on C "
"``printf`` style formatting that handles a narrower range of types and is "
"slightly harder to use correctly, but is often faster for the cases it can "
"handle (:ref:`old-string-formatting`)."
msgstr ""
"Les chaînes gèrent aussi deux styles de mise en forme, l'un fournissant une "
"grande flexibilité et de personnalisation (voir :meth:`str.format`, :ref:"
"`formatstrings` et :ref:`string-formatting`) et l'autre basée sur le style "
"de formatage de ``printf`` du C qui gère une gamme plus étroite de types et "
"est légèrement plus difficile à utiliser correctement, mais qui est souvent "
"plus rapide pour les cas pris en charge (:ref:`old-string-formatting`)."
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1575
2016-10-30 09:46:26 +00:00
msgid ""
"The :ref:`textservices` section of the standard library covers a number of "
"other modules that provide various text related utilities (including regular "
"expression support in the :mod:`re` module)."
msgstr ""
"La section :ref:`textservices` de la bibliothèque standard couvre un certain "
"nombre d'autres modules qui fournissent différents services relatifs au "
"texte (y compris les expressions rationnelles dans le module :mod:`re`)."
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1581
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the string with its first character capitalized and the "
"rest lowercased."
msgstr ""
"Renvoie une copie de la chaîne avec son premier caractère en majuscule et le "
"reste en minuscule."
# suit un :
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1584
2019-09-04 09:35:23 +00:00
msgid ""
"The first character is now put into titlecase rather than uppercase. This "
"means that characters like digraphs will only have their first letter "
"capitalized, instead of the full character."
msgstr ""
"le premier caractère est maintenant mis en *titlecase* plutôt qu'en "
"majuscule. Cela veut dire que les caractères comme les digrammes auront "
"seulement leur première lettre en majuscule, au lieu du caractère en entier."
2019-09-04 09:35:23 +00:00
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1591
2016-10-30 09:46:26 +00:00
msgid ""
"Return a casefolded copy of the string. Casefolded strings may be used for "
"caseless matching."
msgstr ""
"Renvoie une copie *casefolded* de la chaîne. Les chaînes *casefolded* "
"peuvent être utilisées dans des comparaisons insensibles à la casse."
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1594
2016-10-30 09:46:26 +00:00
msgid ""
"Casefolding is similar to lowercasing but more aggressive because it is "
"intended to remove all case distinctions in a string. For example, the "
"German lowercase letter ``'ß'`` is equivalent to ``\"ss\"``. Since it is "
"already lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:"
"`casefold` converts it to ``\"ss\"``."
msgstr ""
"Le *casefolding* est une technique agressive de mise en minuscule, car il "
"vise à éliminer toutes les distinctions de casse dans une chaîne. Par "
"exemple, la lettre minuscule ``'ß'`` de l'allemand équivaut à ``\"ss\"``. "
"Comme il est déjà minuscule, :meth:`lower` ne fait rien à ``'ß'`` ; :meth:"
2016-10-30 09:46:26 +00:00
"`casefold` le convertit en ``\"ss\"``."
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1600
2016-10-30 09:46:26 +00:00
msgid ""
"The casefolding algorithm is described in section 3.13 of the Unicode "
"Standard."
msgstr ""
"L'algorithme de *casefolding* est décrit dans la section 3.13 de la norme "
"Unicode."
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1608
2016-10-30 09:46:26 +00:00
msgid ""
"Return centered in a string of length *width*. Padding is done using the "
"specified *fillchar* (default is an ASCII space). The original string is "
"returned if *width* is less than or equal to ``len(s)``."
msgstr ""
"Renvoie la chaîne au centre d'une chaîne de longueur *width*. Le remplissage "
"est fait en utilisant l'argument *fillchar* (qui par défaut est une espace "
"ASCII). La chaîne d'origine est renvoyée si *width* est inférieure ou égale "
"à ``len(s)``."
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:1616
2016-10-30 09:46:26 +00:00
msgid ""
"Return the number of non-overlapping occurrences of substring *sub* in the "
"range [*start*, *end*]. Optional arguments *start* and *end* are "
"interpreted as in slice notation."
msgstr ""
"Renvoie le nombre d'occurrences de *sub* ne se chevauchant pas dans "
"l'intervalle [*start*, *end*]. Les arguments facultatifs *start* et *end* "
"sont interprétés comme dans la notation des tranches (*slices* en anglais)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1620
msgid ""
"If *sub* is empty, returns the number of empty strings between characters "
"which is the length of the string plus one."
msgstr ""
"Si *sub* est vide, renvoie le nombre de chaînes vides entre les caractères "
"de début et de fin, ce qui correspond à la longueur de la chaîne plus un."
#: library/stdtypes.rst:1626
msgid "Return the string encoded to :class:`bytes`."
msgstr "Renvoie la chaine encodée dans une instance de :class:`bytes`."
#: library/stdtypes.rst:2763
msgid ""
"*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for "
"possible values."
msgstr ""
"*encoding* vaut par défaut ``utf-8`` ; pour une liste des encodages "
"possibles, voir la section :ref:`standard-encodings`."
#: library/stdtypes.rst:1631
2016-10-30 09:46:26 +00:00
msgid ""
"*errors* controls how encoding errors are handled. If ``'strict'`` (the "
"default), a :exc:`UnicodeError` exception is raised. Other possible values "
"are ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``, "
"``'backslashreplace'`` and any other name registered via :func:`codecs."
"register_error`. See :ref:`error-handlers` for details."
2016-10-30 09:46:26 +00:00
msgstr ""
"*errors* détermine la manière dont les erreurs sont traitées. La valeur par "
"défaut est ``'strict'``, ce qui signifie que les erreurs d'encodage lèvent "
"une :exc:`UnicodeError`. Les autres valeurs possibles sont ``'ignore'``, "
2016-10-30 09:46:26 +00:00
"``'replace'``, ``'xmlcharrefreplace'``, ``'backslashreplace'`` et tout autre "
"nom enregistré *via* :func:`codecs.register_error`. Voir la section :ref:"
"`error-handlers` pour plus de détails."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1638
2020-07-20 08:56:42 +00:00
msgid ""
"For performance reasons, the value of *errors* is not checked for validity "
"unless an encoding error actually occurs, :ref:`devmode` is enabled or a :"
"ref:`debug build <debug-build>` is used."
2020-07-20 08:56:42 +00:00
msgstr ""
"Pour des raisons de performances, la valeur de *errors* n'est pas vérifiée à "
"moins qu'une erreur d'encodage ne se produise réellement, que le :ref:`mode "
"développeur <devmode>` ne soit activé ou que Python ait été compilé en :ref:"
"`mode débogage <debug-build>`."
2020-07-20 08:56:42 +00:00
# suit un :
#: library/stdtypes.rst:2782
msgid "Added support for keyword arguments."
msgstr "gère les arguments nommés."
2016-10-30 09:46:26 +00:00
# suit un :
#: library/stdtypes.rst:2785
msgid ""
"The value of the *errors* argument is now checked in :ref:`devmode` and in :"
"ref:`debug mode <debug-build>`."
2020-07-20 08:56:42 +00:00
msgstr ""
"les valeurs de *errors* sont maintenant vérifiées en :ref:`mode de "
"développement <devmode>` et en :ref:`mode de débogage <debug-build>`."
2020-07-20 08:56:42 +00:00
#: library/stdtypes.rst:1653
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if the string ends with the specified *suffix*, otherwise "
"return ``False``. *suffix* can also be a tuple of suffixes to look for. "
"With optional *start*, test beginning at that position. With optional "
"*end*, stop comparing at that position."
msgstr ""
"Renvoie ``True`` si la chaîne se termine par *suffix*, sinon ``False``. "
"*suffix* peut aussi être un *n*-uplet de suffixes à rechercher. Si "
"l'argument optionnel *start* est donné, le test se fait à partir de cette "
"position. Si l'argument optionnel *end* est fourni, la comparaison s'arrête "
"à cette position."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1661
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the string where all tab characters are replaced by one or "
"more spaces, depending on the current column and the given tab size. Tab "
"positions occur every *tabsize* characters (default is 8, giving tab "
"positions at columns 0, 8, 16 and so on). To expand the string, the current "
"column is set to zero and the string is examined character by character. If "
"the character is a tab (``\\t``), one or more space characters are inserted "
"in the result until the current column is equal to the next tab position. "
"(The tab character itself is not copied.) If the character is a newline (``"
"\\n``) or return (``\\r``), it is copied and the current column is reset to "
"zero. Any other character is copied unchanged and the current column is "
2016-10-30 09:46:26 +00:00
"incremented by one regardless of how the character is represented when "
"printed."
msgstr ""
"Renvoie une copie de la chaîne où toutes les tabulations sont remplacées par "
"une ou plusieurs espaces, en fonction de la colonne courante et de la taille "
2016-10-30 09:46:26 +00:00
"de tabulation donnée. Les positions des tabulations se trouvent tous les "
"*tabsize* caractères (8 par défaut, ce qui donne les positions de "
"tabulations aux colonnes 0, 8, 16 et ainsi de suite). Pour travailler sur la "
"chaîne, la colonne en cours est mise à zéro et la chaîne est examinée "
"caractère par caractère. Si le caractère est une tabulation (``\\t``), un ou "
"plusieurs caractères d'espacement sont insérés dans le résultat jusqu'à ce "
"que la colonne courante soit égale à la position de tabulation suivante (le "
"caractère tabulation lui-même n'est pas copié). Si le caractère est un saut "
2016-10-30 09:46:26 +00:00
"de ligne (``\\n``) ou un retour chariot (``\\r``), il est copié et la "
"colonne en cours est remise à zéro. Tout autre caractère est copié inchangé "
"et la colonne en cours est incrémentée de un indépendamment de la façon dont "
"le caractère est représenté lors de l'affichage."
#: library/stdtypes.rst:1682
2016-10-30 09:46:26 +00:00
msgid ""
"Return the lowest index in the string where substring *sub* is found within "
"the slice ``s[start:end]``. Optional arguments *start* and *end* are "
"interpreted as in slice notation. Return ``-1`` if *sub* is not found."
msgstr ""
"Renvoie l'indice de la première position dans la chaîne où *sub* est trouvé "
"dans le découpage ``s[start:end]``. Les arguments facultatifs *start* et "
"*end* sont interprétés comme dans la notation des découpages (*slice* en "
"anglais). Renvoie ``-1`` si *sub* n'est pas trouvé."
2016-10-30 09:46:26 +00:00
# suit un :
#: library/stdtypes.rst:1688
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`~str.find` method should be used only if you need to know the "
"position of *sub*. To check if *sub* is a substring or not, use the :"
"keyword:`in` operator::"
msgstr ""
"la méthode :meth:`~str.find` ne doit être utilisée que si vous avez besoin "
2016-10-30 09:46:26 +00:00
"de connaître la position de *sub*. Pour vérifier si *sub* est une sous "
"chaine ou non, utilisez l'opérateur :keyword:`in` ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1698
2016-10-30 09:46:26 +00:00
msgid ""
"Perform a string formatting operation. The string on which this method is "
"called can contain literal text or replacement fields delimited by braces "
"``{}``. Each replacement field contains either the numeric index of a "
"positional argument, or the name of a keyword argument. Returns a copy of "
"the string where each replacement field is replaced with the string value of "
"the corresponding argument."
msgstr ""
"Formate une chaîne. La chaîne sur laquelle cette méthode est appelée peut "
2016-10-30 09:46:26 +00:00
"contenir du texte littéral ou des emplacements de remplacement délimités par "
"des accolades ``{}``. Chaque champ de remplacement contient soit l'indice "
"numérique d'un argument positionnel, soit le nom d'un argument nommé. "
"Renvoie une copie de la chaîne où chaque champ de remplacement est remplacé "
"par la valeur de chaîne de l'argument correspondant."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1708
2016-10-30 09:46:26 +00:00
msgid ""
"See :ref:`formatstrings` for a description of the various formatting options "
"that can be specified in format strings."
msgstr ""
"Voir :ref:`formatstrings` pour une description des options de formatage qui "
"peuvent être spécifiées dans les chaînes de format."
# suit un :
#: library/stdtypes.rst:1712
2018-02-08 09:02:29 +00:00
msgid ""
2018-09-15 20:37:31 +00:00
"When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :"
"class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'."
"format(1234)``), the function temporarily sets the ``LC_CTYPE`` locale to "
"the ``LC_NUMERIC`` locale to decode ``decimal_point`` and ``thousands_sep`` "
"fields of :c:func:`localeconv` if they are non-ASCII or longer than 1 byte, "
"and the ``LC_NUMERIC`` locale is different than the ``LC_CTYPE`` locale. "
"This temporary change affects other threads."
2018-02-08 09:02:29 +00:00
msgstr ""
"lors du formatage avec le format ``n`` (comme ``'{:n}'.format(1234)``) d'un "
2018-09-15 20:37:31 +00:00
"nombre (:class:`int`, :class:`float`, :class:`complex`, :class:`decimal."
"Decimal` et classes dérivées), la fonction met temporairement la variable "
2018-09-15 20:37:31 +00:00
"``LC_CTYPE`` à la valeur de ``LC_NUMERIC`` pour décoder correctement les "
"attributs ``decimal_point`` et ``thousands_sep`` de :c:func:`localeconv`, "
"s'ils ne sont pas en ASCII ou font plus d'un octet et que ``LC_NUMERIC`` est "
"différent de ``LC_CTYPE``. Ce changement temporaire affecte les autres fils "
"d'exécution."
2018-02-08 09:02:29 +00:00
# suit un :
#: library/stdtypes.rst:1721
2018-02-08 09:02:29 +00:00
msgid ""
"When formatting a number with the ``n`` type, the function sets temporarily "
"the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale in some cases."
msgstr ""
"lors du formatage d'un nombre avec le format ``n``, la fonction change "
2018-06-10 15:15:10 +00:00
"temporairement ``LC_CTYPE`` par la valeur de ``LC_NUMERIC`` dans certains "
"cas."
2018-02-08 09:02:29 +00:00
#: library/stdtypes.rst:1729
2016-10-30 09:46:26 +00:00
msgid ""
"Similar to ``str.format(**mapping)``, except that ``mapping`` is used "
"directly and not copied to a :class:`dict`. This is useful if for example "
"``mapping`` is a dict subclass:"
msgstr ""
"Semblable à ``str.format(**mapping)``, sauf que ``mapping`` est utilisé "
"directement et non copié dans un :class:`dict`. C'est utile si, par exemple, "
"``mapping`` est une sous-classe de ``dict`` :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1745
2016-10-30 09:46:26 +00:00
msgid ""
"Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is "
"not found."
msgstr ""
"Comme :meth:`~str.find`, mais lève une :exc:`ValueError` lorsque la chaîne "
"est introuvable."
#: library/stdtypes.rst:1751
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if all characters in the string are alphanumeric and there "
"is at least one character, ``False`` otherwise. A character ``c`` is "
"alphanumeric if one of the following returns ``True``: ``c.isalpha()``, ``c."
"isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie ``True`` si tous les caractères de la chaîne sont alphanumériques et "
2016-10-30 09:46:26 +00:00
"qu'il y a au moins un caractère, sinon ``False``. Un caractère ``c`` est "
"alphanumérique si l'un des tests suivants renvoie ``True`` : ``c."
"isalpha()``, ``c.isdecimal()``, ``c.isdigit()`` ou ``c.isnumeric()``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1759
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if all characters in the string are alphabetic and there is "
"at least one character, ``False`` otherwise. Alphabetic characters are "
"those characters defined in the Unicode character database as \"Letter\", i."
"e., those with general category property being one of \"Lm\", \"Lt\", \"Lu"
"\", \"Ll\", or \"Lo\". Note that this is different from the \"Alphabetic\" "
"property defined in the Unicode Standard."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie ``True`` si tous les caractères de la chaîne sont alphabétiques et "
2016-10-30 09:46:26 +00:00
"qu'elle contient au moins un caractère, sinon ``False``. Les caractères "
"alphabétiques sont les caractères définis dans la base de données de "
"caractères Unicode comme *Letter*, à savoir, ceux qui ont \"Lm\", \"Lt\", "
"\"Lu\", \"Ll\" ou \"Lo\" comme catégorie générale. Notez que c'est différent "
"de la propriété *Alphabetic* définie dans la norme Unicode."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1768
2018-06-28 13:32:56 +00:00
msgid ""
"Return ``True`` if the string is empty or all characters in the string are "
"ASCII, ``False`` otherwise. ASCII characters have code points in the range U"
"+0000-U+007F."
2018-06-28 13:32:56 +00:00
msgstr ""
"Renvoie ``True`` si la chaîne est vide ou ne contient que des caractères "
"ASCII, ``False`` sinon. Les caractères ASCII ont un code dans l'intervalle ``"
"\"U+0000\"``\\ \\ ``\"U+007F\"``."
2018-06-28 13:32:56 +00:00
#: library/stdtypes.rst:1777
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if all characters in the string are decimal characters and "
"there is at least one character, ``False`` otherwise. Decimal characters are "
"those that can be used to form numbers in base 10, e.g. U+0660, ARABIC-INDIC "
"DIGIT ZERO. Formally a decimal character is a character in the Unicode "
"General Category \"Nd\"."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie ``True`` si tous les caractères de la chaîne sont des caractères "
"décimaux et qu'elle contient au moins un caractère, sinon ``False``. Les "
2017-05-15 11:29:27 +00:00
"caractères décimaux sont ceux pouvant être utilisés pour former des nombres "
"en base 10, tels que U+0660, ARABIC-INDIC DIGIT ZERO. Formellement, un "
"caractère décimal est un caractère dans la catégorie Unicode générale \"Nd\"."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1787
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if all characters in the string are digits and there is at "
"least one character, ``False`` otherwise. Digits include decimal characters "
"and digits that need special handling, such as the compatibility superscript "
2017-04-02 20:14:06 +00:00
"digits. This covers digits which cannot be used to form numbers in base 10, "
"like the Kharosthi numbers. Formally, a digit is a character that has the "
"property value Numeric_Type=Digit or Numeric_Type=Decimal."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie ``True`` si tous les caractères de la chaîne sont des chiffres et "
"qu'elle contient au moins un caractère, ``False`` sinon. Les chiffres "
"incluent des caractères décimaux et des chiffres qui nécessitent une "
"manipulation particulière, tels que les *compatibility superscript digits*. "
"Ça couvre les chiffres qui ne peuvent pas être utilisés pour construire des "
"nombres en base 10, tels que les nombres de Kharosthi. Formellement, un "
"chiffre est un caractère dont la valeur de la propriété *Numeric_Type* est "
"*Digit* ou *Decimal*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1797
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if the string is a valid identifier according to the "
"language definition, section :ref:`identifiers`."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie ``True`` si la chaîne est un identifiant valide selon la définition "
"du langage, section :ref:`identifiers`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1800
2016-10-30 09:46:26 +00:00
msgid ""
2019-09-04 09:35:23 +00:00
"Call :func:`keyword.iskeyword` to test whether string ``s`` is a reserved "
"identifier, such as :keyword:`def` and :keyword:`class`."
2016-10-30 09:46:26 +00:00
msgstr ""
"Utilisez :func:`keyword.iskeyword` pour savoir si la chaîne ``s`` est un "
"identifiant réservé, tels que :keyword:`def` et :keyword:`class`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1803
2019-09-04 09:35:23 +00:00
msgid "Example: ::"
msgstr "Par exemple ::"
2019-09-04 09:35:23 +00:00
#: library/stdtypes.rst:1816
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if all cased characters [4]_ in the string are lowercase and "
"there is at least one cased character, ``False`` otherwise."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie ``True`` si tous les caractères capitalisables [4]_ de la chaîne "
"sont en minuscules et qu'elle contient au moins un caractère capitalisable. "
"Renvoie ``False`` dans le cas contraire."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1822
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if all characters in the string are numeric characters, and "
"there is at least one character, ``False`` otherwise. Numeric characters "
"include digit characters, and all characters that have the Unicode numeric "
"value property, e.g. U+2155, VULGAR FRACTION ONE FIFTH. Formally, numeric "
2016-10-30 09:46:26 +00:00
"characters are those with the property value Numeric_Type=Digit, "
"Numeric_Type=Decimal or Numeric_Type=Numeric."
msgstr ""
"Renvoie ``True`` si tous les caractères de la chaîne sont des caractères "
"numériques et qu'elle contient au moins un caractère, sinon ``False``. Les "
"caractères numériques comprennent les chiffres et tous les caractères qui "
2016-10-30 09:46:26 +00:00
"ont la propriété Unicode *numeric value*, par exemple U+2155, *VULGAR "
"FRACTION OF FIFTH*. Formellement, les caractères numériques sont ceux avec "
"les propriétés *Numeric_Type=Digit*, *Numeric_Type=Decimal* ou "
2016-10-30 09:46:26 +00:00
"*Numeric_Type=Numeric*."
#: library/stdtypes.rst:1832
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if all characters in the string are printable or the string "
"is empty, ``False`` otherwise. Nonprintable characters are those characters "
2016-10-30 09:46:26 +00:00
"defined in the Unicode character database as \"Other\" or \"Separator\", "
"excepting the ASCII space (0x20) which is considered printable. (Note that "
"printable characters in this context are those which should not be escaped "
"when :func:`repr` is invoked on a string. It has no bearing on the handling "
"of strings written to :data:`sys.stdout` or :data:`sys.stderr`.)"
msgstr ""
"Renvoie ``True`` si tous les caractères de la chaîne sont affichables ou si "
"elle est vide, sinon ``False``. Les caractères non affichables sont les "
"caractères définis dans la base de données de caractères Unicode comme "
"« *Other* » ou « *Separator* », à l'exception de l'espace ASCII (``0x20``) "
"qui est considérée comme affichable. (Notez que les caractères imprimables "
"dans ce contexte sont ceux qui ne doivent pas être échappés quand :func:"
"`repr` est invoquée sur une chaîne. Ça n'a aucune incidence sur le "
"traitement des chaînes écrites sur :data:`sys.stdout` ou :data:`sys.stderr`.)"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1843
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if there are only whitespace characters in the string and "
"there is at least one character, ``False`` otherwise."
2019-09-04 09:35:23 +00:00
msgstr ""
"Renvoie ``True`` s'il n'y a que des caractères d'espacement dans la chaîne "
"et qu'elle comporte au moins un caractère. Renvoie ``False`` dans le cas "
"contraire."
2019-09-04 09:35:23 +00:00
#: library/stdtypes.rst:1846
2019-09-04 09:35:23 +00:00
msgid ""
"A character is *whitespace* if in the Unicode character database (see :mod:"
"`unicodedata`), either its general category is ``Zs`` (\"Separator, space"
"\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``."
2016-10-30 09:46:26 +00:00
msgstr ""
"Un caractère est considéré comme un caractère d'espacement (*whitespace* en "
"anglais) si, dans la base de données caractères Unicode (voir :mod:"
"`unicodedata`), sa catégorie générale est ``Zs`` (« séparateur, espace »), "
"ou sa classe bidirectionnelle est une de ``WS``, ``B``, ou ``S``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1854
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if the string is a titlecased string and there is at least "
"one character, for example uppercase characters may only follow uncased "
"characters and lowercase characters only cased ones. Return ``False`` "
"otherwise."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie ``True`` si la chaîne est une chaîne *titlecased* et qu'elle "
"contient au moins un caractère, par exemple les caractères majuscules ne "
"peuvent suivre les caractères non capitalisables et les caractères "
"minuscules ne peuvent suivre que des caractères capitalisables. Renvoie "
"``False`` dans le cas contraire."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1861
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if all cased characters [4]_ in the string are uppercase and "
"there is at least one cased character, ``False`` otherwise."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie ``True`` si tous les caractères différentiables sur la casse [4]_ de "
"la chaîne sont en majuscules et s'il y a au moins un caractère "
"différentiable sur la casse, sinon ``False``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1879
2016-10-30 09:46:26 +00:00
msgid ""
2017-08-01 11:29:09 +00:00
"Return a string which is the concatenation of the strings in *iterable*. A :"
"exc:`TypeError` will be raised if there are any non-string values in "
"*iterable*, including :class:`bytes` objects. The separator between "
"elements is the string providing this method."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie une chaîne qui est la concaténation des chaînes contenues dans "
"*iterable*. Une :exc:`TypeError` est levée si une valeur d'*iterable* n'est "
"pas une chaîne, y compris pour les objets :class:`bytes`. Le séparateur "
2017-08-01 12:16:10 +00:00
"entre les éléments est la chaîne fournissant cette méthode."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1887
2016-10-30 09:46:26 +00:00
msgid ""
"Return the string left justified in a string of length *width*. Padding is "
"done using the specified *fillchar* (default is an ASCII space). The "
"original string is returned if *width* is less than or equal to ``len(s)``."
msgstr ""
"Renvoie la chaîne justifiée à gauche dans une chaîne de longueur *width*. Le "
"bourrage est fait en utilisant *fillchar* (qui par défaut est une espace "
"ASCII). La chaîne d'origine est renvoyée si *width* est inférieure ou égale "
"à ``len(s)``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1894
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the string with all the cased characters [4]_ converted to "
"lowercase."
msgstr ""
"Renvoie une copie de la chaîne avec tous les caractères différentiables sur "
"la casse [4]_ convertis en minuscules."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1897
2016-10-30 09:46:26 +00:00
msgid ""
"The lowercasing algorithm used is described in section 3.13 of the Unicode "
"Standard."
msgstr ""
"L'algorithme de mise en minuscules utilisé est décrit dans la section 3.13 "
"de la norme Unicode."
#: library/stdtypes.rst:1903
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the string with leading characters removed. The *chars* "
"argument is a string specifying the set of characters to be removed. If "
"omitted or ``None``, the *chars* argument defaults to removing whitespace. "
"The *chars* argument is not a prefix; rather, all combinations of its values "
"are stripped::"
msgstr ""
"Renvoie une copie de la chaîne avec des caractères supprimés au début. "
"L'argument *chars* est une chaîne spécifiant le jeu de caractères à "
"supprimer. En cas d'omission ou ``None``, la valeur par défaut de *chars* "
"permet de supprimer des caractères d'espacement. L'argument *chars* n'est "
"pas un préfixe, toutes les combinaisons de ses valeurs sont supprimées ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1913
2020-07-20 08:56:42 +00:00
msgid ""
"See :meth:`str.removeprefix` for a method that will remove a single prefix "
"string rather than all of a set of characters. For example::"
msgstr ""
"Voir :meth:`str.removeprefix` pour une méthode qui supprime une seule chaîne "
"de préfixe plutôt que la totalité d'un ensemble de caractères. Par exemple ::"
2020-07-20 08:56:42 +00:00
#: library/stdtypes.rst:1924
2016-10-30 09:46:26 +00:00
msgid ""
"This static method returns a translation table usable for :meth:`str."
"translate`."
msgstr ""
"Cette méthode statique renvoie une table de traduction utilisable pour :meth:"
"`str.translate`."
#: library/stdtypes.rst:1926
2016-10-30 09:46:26 +00:00
msgid ""
"If there is only one argument, it must be a dictionary mapping Unicode "
"ordinals (integers) or characters (strings of length 1) to Unicode ordinals, "
"strings (of arbitrary lengths) or ``None``. Character keys will then be "
"converted to ordinals."
msgstr ""
2017-05-15 11:29:27 +00:00
"Si un seul argument est fourni, ce soit être un dictionnaire faisant "
"correspondre des points de code Unicode (nombres entiers) ou des caractères "
2018-03-20 23:16:43 +00:00
"(chaînes de longueur 1) à des points de code Unicode."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1931
2016-10-30 09:46:26 +00:00
msgid ""
"If there are two arguments, they must be strings of equal length, and in the "
"resulting dictionary, each character in x will be mapped to the character at "
"the same position in y. If there is a third argument, it must be a string, "
"whose characters will be mapped to ``None`` in the result."
msgstr ""
2017-05-15 11:29:27 +00:00
"Si deux arguments sont fournis, ce doit être deux chaînes de caractères de "
"même longueur. Le dictionnaire renvoyé fera correspondre pour chaque "
"caractère de x un caractère de y pris à la même place. Si un troisième "
"argument est fourni, ce doit être une chaîne dont chaque caractère "
"correspondra à ``None`` dans le résultat."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1939
2016-10-30 09:46:26 +00:00
msgid ""
"Split the string at the first occurrence of *sep*, and return a 3-tuple "
"containing the part before the separator, the separator itself, and the part "
"after the separator. If the separator is not found, return a 3-tuple "
"containing the string itself, followed by two empty strings."
msgstr ""
"Divise la chaîne à la première occurrence de *sep*, et renvoie un triplet "
"contenant la partie avant le séparateur, le séparateur lui-même, et la "
"partie après le séparateur. Si le séparateur n'est pas trouvé, le triplet "
"contient la chaîne elle-même, suivie de deux chaînes vides."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1947
2020-10-02 08:55:01 +00:00
msgid ""
"If the string starts with the *prefix* string, return "
"``string[len(prefix):]``. Otherwise, return a copy of the original string::"
msgstr ""
"Si la chaîne de caractères commence par la chaîne *prefix*, renvoie "
"``string[len(prefix):]``. Sinon, renvoie une copie de la chaîne originale ::"
#: library/stdtypes.rst:1961
2020-10-02 08:55:01 +00:00
msgid ""
"If the string ends with the *suffix* string and that *suffix* is not empty, "
"return ``string[:-len(suffix)]``. Otherwise, return a copy of the original "
"string::"
msgstr ""
"Si la chaîne de caractères se termine par la chaîne *suffix* et que *suffix* "
"n'est pas vide, renvoie ``string[:-len(suffix)]``. Sinon, renvoie une copie "
"de la chaîne originale ::"
2020-10-02 08:55:01 +00:00
#: library/stdtypes.rst:1975
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the string with all occurrences of substring *old* replaced "
"by *new*. If the optional argument *count* is given, only the first *count* "
"occurrences are replaced."
msgstr ""
"Renvoie une copie de la chaîne dont toutes les occurrences de la sous-"
"chaîne *old* sont remplacées par *new*. Si l'argument optionnel *count* est "
2016-10-30 09:46:26 +00:00
"donné, seules les *count* premières occurrences sont remplacées."
#: library/stdtypes.rst:1982
2016-10-30 09:46:26 +00:00
msgid ""
"Return the highest index in the string where substring *sub* is found, such "
"that *sub* is contained within ``s[start:end]``. Optional arguments *start* "
"and *end* are interpreted as in slice notation. Return ``-1`` on failure."
msgstr ""
"Renvoie l'indice le plus élevé dans la chaîne où la sous-chaîne *sub* se "
2016-10-30 09:46:26 +00:00
"trouve, de telle sorte que *sub* soit contenue dans ``s[start:end]``. Les "
"arguments facultatifs *start* et *end* sont interprétés comme dans la "
"notation des découpages. Renvoie ``-1`` en cas d'échec."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:1989
2016-10-30 09:46:26 +00:00
msgid ""
"Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is "
"not found."
msgstr ""
"Comme :meth:`rfind` mais lève une exception :exc:`ValueError` lorsque la "
"sous-chaîne *sub* est introuvable."
#: library/stdtypes.rst:1995
2016-10-30 09:46:26 +00:00
msgid ""
"Return the string right justified in a string of length *width*. Padding is "
"done using the specified *fillchar* (default is an ASCII space). The "
"original string is returned if *width* is less than or equal to ``len(s)``."
msgstr ""
"Renvoie la chaîne justifiée à droite dans une chaîne de longueur *width*. Le "
"bourrage est fait en utilisant le caractère spécifié par *fillchar* (par "
"défaut une espace ASCII). La chaîne d'origine est renvoyée si *width* est "
2016-10-30 09:46:26 +00:00
"inférieure ou égale à ``len(s)``."
#: library/stdtypes.rst:2002
2016-10-30 09:46:26 +00:00
msgid ""
"Split the string at the last occurrence of *sep*, and return a 3-tuple "
"containing the part before the separator, the separator itself, and the part "
"after the separator. If the separator is not found, return a 3-tuple "
"containing two empty strings, followed by the string itself."
msgstr ""
"Divise la chaîne à la dernière occurrence de *sep*, et renvoie un triplet "
"contenant la partie avant le séparateur, le séparateur lui-même, et la "
"partie après le séparateur. Si le séparateur n'est pas trouvé, le triplet "
"contient deux chaînes vides, puis la chaîne elle-même."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2010
2016-10-30 09:46:26 +00:00
msgid ""
"Return a list of the words in the string, using *sep* as the delimiter "
"string. If *maxsplit* is given, at most *maxsplit* splits are done, the "
"*rightmost* ones. If *sep* is not specified or ``None``, any whitespace "
"string is a separator. Except for splitting from the right, :meth:`rsplit` "
"behaves like :meth:`split` which is described in detail below."
msgstr ""
"Renvoie une liste des mots de la chaîne, en utilisant *sep* comme "
"séparateur. Si *maxsplit* est donné, c'est le nombre maximum de divisions "
"qui pourront être faites, celles « les plus à droite ». Si *sep* est pas "
"spécifié ou est ``None``, tout caractère d'espacement est un séparateur. En "
"dehors du fait qu'il découpe par la droite, :meth:`rsplit` se comporte "
"comme :meth:`split` qui est décrit en détail ci-dessous."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2019
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the string with trailing characters removed. The *chars* "
"argument is a string specifying the set of characters to be removed. If "
"omitted or ``None``, the *chars* argument defaults to removing whitespace. "
"The *chars* argument is not a suffix; rather, all combinations of its values "
"are stripped::"
msgstr ""
"Renvoie une copie de la chaîne avec des caractères finaux supprimés. "
"L'argument *chars* est une chaîne spécifiant le jeu de caractères à "
"supprimer. En cas d'omission ou ``None``, les caractères d'espacement sont "
"supprimés. L'argument *chars* n'est pas un suffixe : toutes les combinaisons "
"de ses valeurs sont retirées ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2029
2020-07-20 08:56:42 +00:00
msgid ""
"See :meth:`str.removesuffix` for a method that will remove a single suffix "
"string rather than all of a set of characters. For example::"
msgstr ""
"Voir :meth:`str.removesuffix` pour une méthode qui supprime une seule chaîne "
"de suffixe plutôt que la totalité d'un ensemble de caractères. Par exemple ::"
2020-07-20 08:56:42 +00:00
#: library/stdtypes.rst:2039
2016-10-30 09:46:26 +00:00
msgid ""
"Return a list of the words in the string, using *sep* as the delimiter "
"string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, "
"the list will have at most ``maxsplit+1`` elements). If *maxsplit* is not "
"specified or ``-1``, then there is no limit on the number of splits (all "
"possible splits are made)."
msgstr ""
"Renvoie une liste des mots de la chaîne, en utilisant *sep* comme séparateur "
"de mots. Si *maxsplit* est donné, c'est le nombre maximum de divisions qui "
"pourront être effectuées (donnant ainsi une liste de longueur ``maxsplit"
"+1``). Si *maxsplit* n'est pas fourni, ou vaut ``-1``, le nombre de découpes "
"n'est pas limité (toutes les découpes possibles sont faites)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2045
2016-10-30 09:46:26 +00:00
msgid ""
"If *sep* is given, consecutive delimiters are not grouped together and are "
"deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns "
"``['1', '', '2']``). The *sep* argument may consist of multiple characters "
"(for example, ``'1<>2<>3'.split('<>')`` returns ``['1', '2', '3']``). "
"Splitting an empty string with a specified separator returns ``['']``."
msgstr ""
"Si *sep* est donné, les délimiteurs consécutifs ne sont pas regroupés et "
"ainsi délimitent des chaînes vides (par exemple, ``'1,,2'.split(',')`` "
"renvoie ``['1', '', '2']``). L'argument *sep* peut contenir plusieurs "
"caractères (par exemple, ``'1<>2<>3'.split('<>')`` renvoie ``['1', '2', "
"'3']``). Découper une chaîne vide en spécifiant *sep* renvoie ``['']``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2067 library/stdtypes.rst:2187
#: library/stdtypes.rst:3101 library/stdtypes.rst:3208
#: library/stdtypes.rst:3249 library/stdtypes.rst:3291
#: library/stdtypes.rst:3323 library/stdtypes.rst:3373
#: library/stdtypes.rst:3442 library/stdtypes.rst:3466
2016-10-30 09:46:26 +00:00
msgid "For example::"
msgstr "Par exemple ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2060
2016-10-30 09:46:26 +00:00
msgid ""
"If *sep* is not specified or is ``None``, a different splitting algorithm is "
"applied: runs of consecutive whitespace are regarded as a single separator, "
"and the result will contain no empty strings at the start or end if the "
"string has leading or trailing whitespace. Consequently, splitting an empty "
"string or a string consisting of just whitespace with a ``None`` separator "
"returns ``[]``."
msgstr ""
"Si *sep* n'est pas spécifié ou est ``None``, un autre algorithme de "
"découpage est appliqué : les caractères d'espacement consécutifs sont "
"considérés comme un seul séparateur, et le résultat ne contient pas les "
"chaînes vides de début ou de la fin si la chaîne est préfixée ou suffixé de "
"caractères d'espacement. Par conséquent, diviser une chaîne vide ou une "
"chaîne composée d'espaces avec un séparateur ``None`` renvoie ``[]``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2082
2016-10-30 09:46:26 +00:00
msgid ""
"Return a list of the lines in the string, breaking at line boundaries. Line "
"breaks are not included in the resulting list unless *keepends* is given and "
"true."
msgstr ""
"Renvoie les lignes de la chaîne sous forme de liste, la découpe se faisant "
"au niveau des limites des lignes. Les sauts de ligne ne sont pas inclus dans "
"la liste des résultats, sauf si *keepends* est donné et est vrai."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2086
2016-10-30 09:46:26 +00:00
msgid ""
"This method splits on the following line boundaries. In particular, the "
"boundaries are a superset of :term:`universal newlines`."
msgstr ""
"Cette méthode découpe sur les limites de ligne suivantes. Ces limites sont "
"un sur-ensemble de :term:`universal newlines`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2090
2016-10-30 09:46:26 +00:00
msgid "Representation"
msgstr "Représentation"
#: library/stdtypes.rst:2090
2016-10-30 09:46:26 +00:00
msgid "Description"
msgstr "Description"
#: library/stdtypes.rst:2092
2016-10-30 09:46:26 +00:00
msgid "``\\n``"
msgstr "``\\n``"
#: library/stdtypes.rst:2092
2016-10-30 09:46:26 +00:00
msgid "Line Feed"
msgstr "Saut de ligne"
#: library/stdtypes.rst:2094
2016-10-30 09:46:26 +00:00
msgid "``\\r``"
msgstr "``\\r``"
#: library/stdtypes.rst:2094
2016-10-30 09:46:26 +00:00
msgid "Carriage Return"
msgstr "Retour chariot"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2096
2016-10-30 09:46:26 +00:00
msgid "``\\r\\n``"
msgstr "``\\r\\n``"
#: library/stdtypes.rst:2096
2016-10-30 09:46:26 +00:00
msgid "Carriage Return + Line Feed"
msgstr "Retour chariot + saut de ligne"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2098
2016-10-30 09:46:26 +00:00
msgid "``\\v`` or ``\\x0b``"
msgstr "``\\v`` or ``\\x0b``"
#: library/stdtypes.rst:2098
2016-10-30 09:46:26 +00:00
msgid "Line Tabulation"
msgstr "Tabulation verticale"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2100
2016-10-30 09:46:26 +00:00
msgid "``\\f`` or ``\\x0c``"
msgstr "``\\f`` or ``\\x0c``"
#: library/stdtypes.rst:2100
2016-10-30 09:46:26 +00:00
msgid "Form Feed"
msgstr "Saut de page"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2102
2016-10-30 09:46:26 +00:00
msgid "``\\x1c``"
msgstr "``\\x1c``"
#: library/stdtypes.rst:2102
2016-10-30 09:46:26 +00:00
msgid "File Separator"
msgstr "Séparateur de fichiers"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2104
2016-10-30 09:46:26 +00:00
msgid "``\\x1d``"
msgstr "``\\x1d``"
#: library/stdtypes.rst:2104
2016-10-30 09:46:26 +00:00
msgid "Group Separator"
msgstr "Séparateur de groupes"
#: library/stdtypes.rst:2106
2016-10-30 09:46:26 +00:00
msgid "``\\x1e``"
msgstr "``\\x1e``"
#: library/stdtypes.rst:2106
2016-10-30 09:46:26 +00:00
msgid "Record Separator"
msgstr "Séparateur d'enregistrements"
#: library/stdtypes.rst:2108
2016-10-30 09:46:26 +00:00
msgid "``\\x85``"
msgstr "``\\x85``"
#: library/stdtypes.rst:2108
2016-10-30 09:46:26 +00:00
msgid "Next Line (C1 Control Code)"
msgstr "Ligne suivante (code de contrôle *C1*)"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2110
2016-10-30 09:46:26 +00:00
msgid "``\\u2028``"
msgstr "``\\u2028``"
#: library/stdtypes.rst:2110
2016-10-30 09:46:26 +00:00
msgid "Line Separator"
msgstr "Séparateur de ligne"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2112
2016-10-30 09:46:26 +00:00
msgid "``\\u2029``"
msgstr "``\\u2029``"
#: library/stdtypes.rst:2112
2016-10-30 09:46:26 +00:00
msgid "Paragraph Separator"
msgstr "Séparateur de paragraphe"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2117
2016-10-30 09:46:26 +00:00
msgid "``\\v`` and ``\\f`` added to list of line boundaries."
msgstr "``\\v`` et ``\\f`` ajoutés à la liste des limites de lignes."
#: library/stdtypes.rst:2126
2016-10-30 09:46:26 +00:00
msgid ""
"Unlike :meth:`~str.split` when a delimiter string *sep* is given, this "
"method returns an empty list for the empty string, and a terminal line break "
"does not result in an extra line::"
msgstr ""
"Contrairement à :meth:`~str.split` lorsque *sep* est fourni, cette méthode "
"renvoie une liste vide pour la chaîne vide, et un saut de ligne à la fin ne "
"se traduit pas par une ligne supplémentaire ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2135
2016-10-30 09:46:26 +00:00
msgid "For comparison, ``split('\\n')`` gives::"
msgstr "À titre de comparaison, ``split('\\n')`` donne ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2145
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if string starts with the *prefix*, otherwise return "
"``False``. *prefix* can also be a tuple of prefixes to look for. With "
"optional *start*, test string beginning at that position. With optional "
"*end*, stop comparing string at that position."
msgstr ""
"Renvoie ``True`` si la chaîne commence par *prefix*, sinon ``False``. "
"*prefix* peut aussi être un *n*-uplet de préfixes à rechercher. Lorsque "
"*start* est donné, la comparaison commence à cette position et, lorsque "
"*end* est donné, la comparaison s'arrête à celle-ci."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2153
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the string with the leading and trailing characters "
"removed. The *chars* argument is a string specifying the set of characters "
"to be removed. If omitted or ``None``, the *chars* argument defaults to "
"removing whitespace. The *chars* argument is not a prefix or suffix; rather, "
"all combinations of its values are stripped::"
msgstr ""
"Renvoie une copie de la chaîne dont des caractères initiaux et finaux sont "
2016-10-30 09:46:26 +00:00
"supprimés. L'argument *chars* est une chaîne spécifiant le jeu de caractères "
"à supprimer. En cas d'omission ou ``None``, les caractères d'espacement sont "
"supprimés. L'argument *chars* est pas un préfixe ni un suffixe, toutes les "
"combinaisons de ses valeurs sont supprimées ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2164
2016-10-30 09:46:26 +00:00
msgid ""
"The outermost leading and trailing *chars* argument values are stripped from "
"the string. Characters are removed from the leading end until reaching a "
"string character that is not contained in the set of characters in *chars*. "
"A similar action takes place on the trailing end. For example::"
msgstr ""
"Les caractères de *char* sont retirés du début et de la fin de la chaîne. "
"Les caractères sont retirés de la gauche jusqu'à atteindre un caractère ne "
"figurant pas dans le jeu de caractères dans *chars*. La même opération a "
"lieu par la droite. Par exemple ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2177
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the string with uppercase characters converted to lowercase "
"and vice versa. Note that it is not necessarily true that ``s.swapcase()."
"swapcase() == s``."
msgstr ""
"Renvoie une copie de la chaîne dont les caractères majuscules sont convertis "
"en minuscules et vice versa. Notez qu'il est pas nécessairement vrai que ``s."
"swapcase().swapcase() == s``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2184
2016-10-30 09:46:26 +00:00
msgid ""
"Return a titlecased version of the string where words start with an "
"uppercase character and the remaining characters are lowercase."
msgstr ""
"Renvoie une version de la chaîne où les mots commencent par une capitale et "
"les caractères restants sont en minuscules."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3410
2016-10-30 09:46:26 +00:00
msgid ""
"The algorithm uses a simple language-independent definition of a word as "
"groups of consecutive letters. The definition works in many contexts but it "
"means that apostrophes in contractions and possessives form word boundaries, "
"which may not be the desired result::"
msgstr ""
"Pour l'algorithme, la notion de mot est définie simplement et indépendamment "
"de la langue comme un groupe de lettres consécutives. La définition "
"fonctionne dans de nombreux contextes, mais cela signifie que les "
"apostrophes (typiquement de la forme possessive en Anglais) forment les "
"limites de mot, ce qui n'est pas toujours le résultat souhaité ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2200
2016-10-30 09:46:26 +00:00
msgid ""
2022-05-22 21:15:02 +00:00
"The :func:`string.capwords` function does not have this problem, as it "
"splits words on spaces only."
msgstr ""
"La fonction :func:`string.capwords` n'a pas ce problème, car elle sépare les "
"mots uniquement sur les espaces."
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:2203
2022-05-22 21:15:02 +00:00
msgid ""
"Alternatively, a workaround for apostrophes can be constructed using regular "
"expressions::"
2016-10-30 09:46:26 +00:00
msgstr ""
"Sinon, une solution pour contourner le problème des apostrophes est "
"d'utiliser des expressions rationnelles ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2218
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the string in which each character has been mapped through "
"the given translation table. The table must be an object that implements "
"indexing via :meth:`__getitem__`, typically a :term:`mapping` or :term:"
"`sequence`. When indexed by a Unicode ordinal (an integer), the table "
"object can do any of the following: return a Unicode ordinal or a string, to "
"map the character to one or more other characters; return ``None``, to "
"delete the character from the return string; or raise a :exc:`LookupError` "
"exception, to map the character to itself."
msgstr ""
"Renvoie une copie de la chaîne dans laquelle chaque caractère a été changé "
"selon la table de traduction donnée. La table doit être un objet qui "
"implémente l'indexation via :meth:`__getitem__`, typiquement un :term:"
"`tableau de correspondances <mapping>` ou une :term:`séquence <sequence>`. "
"Pour un ordinal Unicode (un entier), la table peut donner un ordinal Unicode "
"ou une chaîne pour faire correspondre un ou plusieurs caractères au "
"caractère donné, ``None`` pour supprimer le caractère de la chaîne renvoyée "
"ou lever une exception :exc:`LookupError` pour ne pas changer le caractère."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2227
2016-10-30 09:46:26 +00:00
msgid ""
"You can use :meth:`str.maketrans` to create a translation map from character-"
"to-character mappings in different formats."
msgstr ""
"Vous pouvez utiliser :meth:`str.maketrans` pour créer une table de "
"correspondances de caractères dans différents formats."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2230
2016-10-30 09:46:26 +00:00
msgid ""
"See also the :mod:`codecs` module for a more flexible approach to custom "
"character mappings."
msgstr ""
"Voir aussi le module :mod:`codecs` pour une approche plus souple de "
"changements de caractères par correspondance."
#: library/stdtypes.rst:2236
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the string with all the cased characters [4]_ converted to "
2018-06-28 13:32:56 +00:00
"uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` "
2016-10-30 09:46:26 +00:00
"contains uncased characters or if the Unicode category of the resulting "
"character(s) is not \"Lu\" (Letter, uppercase), but e.g. \"Lt\" (Letter, "
"titlecase)."
msgstr ""
"Renvoie une copie de la chaîne où tous les caractères capitalisables [4]_ "
"ont été convertis en capitales. Notez que ``s.upper().isupper()`` peut être "
2018-07-05 09:39:28 +00:00
"``False`` si ``s`` contient des caractères non capitalisables ou si la "
"catégorie Unicode d'un caractère du résultat n'est pas \"Lu\" (*Letter*, "
"*uppercase*), mais par exemple \"Lt\" (*Letter*, *titlecase*)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2242
2016-10-30 09:46:26 +00:00
msgid ""
"The uppercasing algorithm used is described in section 3.13 of the Unicode "
"Standard."
msgstr ""
"L'algorithme de capitalisation utilisé est décrit dans la section 3.13 de la "
"norme Unicode."
#: library/stdtypes.rst:2248
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the string left filled with ASCII ``'0'`` digits to make a "
"string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled "
"by inserting the padding *after* the sign character rather than before. The "
"original string is returned if *width* is less than or equal to ``len(s)``."
msgstr ""
"Renvoie une copie de la chaîne remplie par la gauche du chiffre (le "
"caractère ASCII) ``'0'`` pour faire une chaîne de longueur *width*. Un "
"préfixe (``'+'`` / ``'-'``) est permis par l'insertion du caractère de "
"bourrage *après* le caractère désigné plutôt qu'avant. La chaîne d'origine "
"est renvoyée si *width* est inférieure ou égale à ``len(s)``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2266
2016-10-30 09:46:26 +00:00
msgid "``printf``-style String Formatting"
2018-06-17 20:28:31 +00:00
msgstr "Formatage de chaines à la ``printf``"
2016-10-30 09:46:26 +00:00
# suit un :
#: library/stdtypes.rst:2279
2016-10-30 09:46:26 +00:00
msgid ""
"The formatting operations described here exhibit a variety of quirks that "
"lead to a number of common errors (such as failing to display tuples and "
"dictionaries correctly). Using the newer :ref:`formatted string literals <f-"
2018-06-28 13:32:56 +00:00
"strings>`, the :meth:`str.format` interface, or :ref:`template strings "
"<template-strings>` may help avoid these errors. Each of these alternatives "
"provides their own trade-offs and benefits of simplicity, flexibility, and/"
"or extensibility."
2016-10-30 09:46:26 +00:00
msgstr ""
"ces opérations de mise en forme contiennent des bizarreries menant à de "
"nombreuses erreurs classiques (telles que ne pas réussir à afficher des *n*-"
"uplets ou des dictionnaires correctement). Utiliser les :ref:`formatted "
2018-07-05 09:39:28 +00:00
"string literals <f-strings>`, la méthode :meth:`str.format` ou les :ref:"
2018-07-27 07:25:53 +00:00
"`template strings <template-strings>` aide à éviter ces erreurs. Chacune de "
"ces alternatives apporte son lot d'avantages et inconvénients en matière de "
"simplicité, de flexibilité et/ou de généralisation possible."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2287
2016-10-30 09:46:26 +00:00
msgid ""
"String objects have one unique built-in operation: the ``%`` operator "
"(modulo). This is also known as the string *formatting* or *interpolation* "
"operator. Given ``format % values`` (where *format* is a string), ``%`` "
"conversion specifications in *format* are replaced with zero or more "
"elements of *values*. The effect is similar to using the :c:func:`sprintf` "
"in the C language."
msgstr ""
"Les objets *str* n'exposent qu'une opération : l'opérateur ``%`` (modulo). "
"Aussi connu sous le nom d'opérateur de formatage, ou opérateur "
"d'interpolation. Étant donné ``format % values`` (où *format* est une "
2016-10-30 09:46:26 +00:00
"chaîne), les marqueurs ``%`` de *format* sont remplacés par zéro ou "
"plusieurs éléments de *values*. L'effet est similaire à la fonction :c:func:"
"`sprintf` du langage C."
#: library/stdtypes.rst:2293
2016-10-30 09:46:26 +00:00
msgid ""
"If *format* requires a single argument, *values* may be a single non-tuple "
"object. [5]_ Otherwise, *values* must be a tuple with exactly the number of "
"items specified by the format string, or a single mapping object (for "
"example, a dictionary)."
msgstr ""
"Si *format* ne nécessite qu'un seul argument, *values* peut être un objet "
"unique [5]_. Si *values* est un *n*-uplet, il doit contenir exactement le "
"nombre d'éléments spécifiés par la chaîne de format, ou un seul objet "
"tableau de correspondances (*mapping object*, par exemple, un dictionnaire)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3521
2016-10-30 09:46:26 +00:00
msgid ""
"A conversion specifier contains two or more characters and has the following "
"components, which must occur in this order:"
msgstr ""
"Un indicateur de conversion contient deux ou plusieurs caractères et "
"comporte les éléments suivants, qui doivent apparaître dans cet ordre :"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:3524
2016-10-30 09:46:26 +00:00
msgid "The ``'%'`` character, which marks the start of the specifier."
msgstr "le caractère ``'%'``, qui marque le début du marqueur ;"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:3526
2016-10-30 09:46:26 +00:00
msgid ""
"Mapping key (optional), consisting of a parenthesised sequence of characters "
"(for example, ``(somename)``)."
msgstr ""
"la clé de correspondance (facultative), composée d'une suite de caractères "
"entre parenthèses (par exemple, ``(somename)``) ;"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:3529
2016-10-30 09:46:26 +00:00
msgid ""
"Conversion flags (optional), which affect the result of some conversion "
"types."
msgstr ""
"des indications de conversion, facultatives, qui affectent le résultat de "
"certains types de conversion ;"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:3532
2016-10-30 09:46:26 +00:00
msgid ""
"Minimum field width (optional). If specified as an ``'*'`` (asterisk), the "
"actual width is read from the next element of the tuple in *values*, and the "
"object to convert comes after the minimum field width and optional precision."
msgstr ""
"largeur minimum (facultative). Si elle vaut ``'*'`` (astérisque), la largeur "
"est lue de l'élément suivant du *n*-uplet *values*, et l'objet à convertir "
"vient après la largeur de champ minimale et la précision facultative ;"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:3536
2016-10-30 09:46:26 +00:00
msgid ""
"Precision (optional), given as a ``'.'`` (dot) followed by the precision. "
"If specified as ``'*'`` (an asterisk), the actual precision is read from the "
"next element of the tuple in *values*, and the value to convert comes after "
"the precision."
msgstr ""
"précision (facultatif), donnée sous la forme d'un ``'.'`` (point) suivi de "
2016-10-30 09:46:26 +00:00
"la précision. Si la précision est ``'*'`` (un astérisque), la précision est "
"lue à partir de l'élément suivant du *n*-uplet *values* et la valeur à "
"convertir vient ensuite ;"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:3541
2016-10-30 09:46:26 +00:00
msgid "Length modifier (optional)."
msgstr "modificateur de longueur (facultatif) ;"
2016-10-30 09:46:26 +00:00
# fin d'énumération
#: library/stdtypes.rst:3543
2016-10-30 09:46:26 +00:00
msgid "Conversion type."
msgstr "type de conversion."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2327
2016-10-30 09:46:26 +00:00
msgid ""
"When the right argument is a dictionary (or other mapping type), then the "
"formats in the string *must* include a parenthesised mapping key into that "
"dictionary inserted immediately after the ``'%'`` character. The mapping key "
"selects the value to be formatted from the mapping. For example:"
msgstr ""
"Lorsque l'argument de droite est un dictionnaire (ou un autre type de "
"tableau de correspondances), les marqueurs dans la chaîne *doivent* inclure "
"une clé présente dans le dictionnaire, écrite entre parenthèses, "
"immédiatement après le caractère ``'%'``. La clé indique quelle valeur du "
"dictionnaire doit être formatée. Par exemple :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3554
2016-10-30 09:46:26 +00:00
msgid ""
"In this case no ``*`` specifiers may occur in a format (since they require a "
"sequential parameter list)."
msgstr ""
"Dans ce cas, aucune ``*`` ne peut se trouver dans le format (car ces ``*`` "
"nécessitent une liste (accès séquentiel) de paramètres)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3557
2016-10-30 09:46:26 +00:00
msgid "The conversion flag characters are:"
msgstr "Les caractères indicateurs de conversion sont :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3566
2016-10-30 09:46:26 +00:00
msgid "Flag"
msgstr "Option"
#: library/stdtypes.rst:3568
2016-10-30 09:46:26 +00:00
msgid "``'#'``"
msgstr "``'#'``"
#: library/stdtypes.rst:3568
2016-10-30 09:46:26 +00:00
msgid ""
"The value conversion will use the \"alternate form\" (where defined below)."
msgstr "La conversion utilise la « forme alternative » (définie ci-dessous)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3571
2016-10-30 09:46:26 +00:00
msgid "``'0'``"
msgstr "``'0'``"
#: library/stdtypes.rst:3571
2016-10-30 09:46:26 +00:00
msgid "The conversion will be zero padded for numeric values."
msgstr "Les valeurs numériques converties sont complétées de zéros."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3573
2016-10-30 09:46:26 +00:00
msgid "``'-'``"
msgstr "``'-'``"
#: library/stdtypes.rst:3573
2016-10-30 09:46:26 +00:00
msgid ""
"The converted value is left adjusted (overrides the ``'0'`` conversion if "
"both are given)."
msgstr ""
"La valeur convertie est ajustée à gauche (remplace la conversion ``'0'`` si "
"les deux sont données)."
#: library/stdtypes.rst:3576
2016-10-30 09:46:26 +00:00
msgid "``' '``"
msgstr "``' '``"
#: library/stdtypes.rst:3576
2016-10-30 09:46:26 +00:00
msgid ""
"(a space) A blank should be left before a positive number (or empty string) "
"produced by a signed conversion."
msgstr ""
"(une espace) Une espace doit être laissée avant un nombre positif (ou chaîne "
2016-10-30 09:46:26 +00:00
"vide) produite par la conversion d'une valeur signée."
#: library/stdtypes.rst:3579
2016-10-30 09:46:26 +00:00
msgid "``'+'``"
msgstr "``'+'``"
#: library/stdtypes.rst:3579
2016-10-30 09:46:26 +00:00
msgid ""
"A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides "
"a \"space\" flag)."
msgstr ""
"Un caractère de signe (``'+'`` ou ``'-'``) précède la valeur convertie "
"(remplace le marqueur « espace »)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3583
2016-10-30 09:46:26 +00:00
msgid ""
"A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as "
"it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``."
msgstr ""
"Un modificateur de longueur (``h``, ``l`` ou ``L``) peut être présent, mais "
"est ignoré car il est pas nécessaire pour Python, donc par exemple ``%ld`` "
2016-10-30 09:46:26 +00:00
"est identique à ``%d``."
#: library/stdtypes.rst:3586
2016-10-30 09:46:26 +00:00
msgid "The conversion types are:"
msgstr "Les types utilisables dans les conversions sont :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3589
2016-10-30 09:46:26 +00:00
msgid "Conversion"
msgstr "Conversion"
#: library/stdtypes.rst:3591
2016-10-30 09:46:26 +00:00
msgid "``'d'``"
msgstr "``'d'``"
#: library/stdtypes.rst:2375 library/stdtypes.rst:3593
2016-10-30 09:46:26 +00:00
msgid "Signed integer decimal."
msgstr "Entier décimal signé."
#: library/stdtypes.rst:3593
2016-10-30 09:46:26 +00:00
msgid "``'i'``"
msgstr "``'i'``"
#: library/stdtypes.rst:3595
2016-10-30 09:46:26 +00:00
msgid "``'o'``"
msgstr "``'o'``"
#: library/stdtypes.rst:3595
2016-10-30 09:46:26 +00:00
msgid "Signed octal value."
msgstr "Valeur octale signée."
#: library/stdtypes.rst:3597
2016-10-30 09:46:26 +00:00
msgid "``'u'``"
msgstr "``'u'``"
#: library/stdtypes.rst:3597
2016-10-30 09:46:26 +00:00
msgid "Obsolete type -- it is identical to ``'d'``."
msgstr "Type obsolète — identique à ``'d'``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3599
2016-10-30 09:46:26 +00:00
msgid "``'x'``"
msgstr "``'x'``"
#: library/stdtypes.rst:3599
2016-10-30 09:46:26 +00:00
msgid "Signed hexadecimal (lowercase)."
msgstr "Hexadécimal signé (en minuscules)."
#: library/stdtypes.rst:3601
2016-10-30 09:46:26 +00:00
msgid "``'X'``"
msgstr "``'X'``"
#: library/stdtypes.rst:3601
2016-10-30 09:46:26 +00:00
msgid "Signed hexadecimal (uppercase)."
msgstr "Hexadécimal signé (capitales)."
#: library/stdtypes.rst:3603
2016-10-30 09:46:26 +00:00
msgid "``'e'``"
msgstr "``'e'``"
#: library/stdtypes.rst:3603
2016-10-30 09:46:26 +00:00
msgid "Floating point exponential format (lowercase)."
msgstr "Format exponentiel pour un *float* (minuscule)."
#: library/stdtypes.rst:3605
2016-10-30 09:46:26 +00:00
msgid "``'E'``"
msgstr "``'E'``"
#: library/stdtypes.rst:3605
2016-10-30 09:46:26 +00:00
msgid "Floating point exponential format (uppercase)."
msgstr "Format exponentiel pour un *float* (en capitales)."
#: library/stdtypes.rst:3607
2016-10-30 09:46:26 +00:00
msgid "``'f'``"
msgstr "``'f'``"
#: library/stdtypes.rst:2391 library/stdtypes.rst:3609
2016-10-30 09:46:26 +00:00
msgid "Floating point decimal format."
msgstr "Format décimal pour un *float*."
#: library/stdtypes.rst:3609
2016-10-30 09:46:26 +00:00
msgid "``'F'``"
msgstr "``'F'``"
#: library/stdtypes.rst:3611
2016-10-30 09:46:26 +00:00
msgid "``'g'``"
msgstr "``'g'``"
#: library/stdtypes.rst:3611
2016-10-30 09:46:26 +00:00
msgid ""
"Floating point format. Uses lowercase exponential format if exponent is less "
"than -4 or not less than precision, decimal format otherwise."
msgstr ""
"Format *float*. Utilise le format exponentiel minuscules si l'exposant est "
"inférieur à ``-4`` ou pas plus petit que la précision, sinon le format "
"décimal."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3615
2016-10-30 09:46:26 +00:00
msgid "``'G'``"
msgstr "``'G'``"
#: library/stdtypes.rst:3615
2016-10-30 09:46:26 +00:00
msgid ""
"Floating point format. Uses uppercase exponential format if exponent is less "
"than -4 or not less than precision, decimal format otherwise."
msgstr ""
"Format *float*. Utilise le format exponentiel en capitales si l'exposant est "
"inférieur à ``-4`` ou pas plus petit que la précision, sinon le format "
"décimal."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3619
2016-10-30 09:46:26 +00:00
msgid "``'c'``"
msgstr "``'c'``"
#: library/stdtypes.rst:2401
2016-10-30 09:46:26 +00:00
msgid "Single character (accepts integer or single character string)."
msgstr ""
"Un seul caractère (accepte des entiers ou une chaîne d'un seul caractère)."
#: library/stdtypes.rst:3632
2016-10-30 09:46:26 +00:00
msgid "``'r'``"
msgstr "``'r'``"
#: library/stdtypes.rst:2404
2016-10-30 09:46:26 +00:00
msgid "String (converts any Python object using :func:`repr`)."
msgstr "String (convertit n'importe quel objet Python avec :func:`repr`)."
#: library/stdtypes.rst:3626
2016-10-30 09:46:26 +00:00
msgid "``'s'``"
msgstr "``'s'``"
#: library/stdtypes.rst:2407
2016-10-30 09:46:26 +00:00
msgid "String (converts any Python object using :func:`str`)."
msgstr "String (convertit n'importe quel objet Python avec :func:`str`)."
#: library/stdtypes.rst:3629
2016-10-30 09:46:26 +00:00
msgid "``'a'``"
msgstr "``'a'``"
#: library/stdtypes.rst:2410
2016-10-30 09:46:26 +00:00
msgid "String (converts any Python object using :func:`ascii`)."
msgstr ""
"String (convertit n'importe quel objet Python en utilisant :func:`ascii`)."
#: library/stdtypes.rst:3635
2016-10-30 09:46:26 +00:00
msgid "``'%'``"
msgstr "``'%'``"
#: library/stdtypes.rst:3635
2016-10-30 09:46:26 +00:00
msgid "No argument is converted, results in a ``'%'`` character in the result."
msgstr ""
"Aucun argument n'est converti, donne un caractère de ``'%'`` dans le "
"résultat."
#: library/stdtypes.rst:3642
2016-10-30 09:46:26 +00:00
msgid ""
2017-04-02 20:14:06 +00:00
"The alternate form causes a leading octal specifier (``'0o'``) to be "
"inserted before the first digit."
2016-10-30 09:46:26 +00:00
msgstr ""
"La forme alternative entraîne l'insertion d'un préfixe octal (``'0o'``) "
"avant le premier chiffre."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3646
2016-10-30 09:46:26 +00:00
msgid ""
"The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on "
2017-04-02 20:14:06 +00:00
"whether the ``'x'`` or ``'X'`` format was used) to be inserted before the "
"first digit."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-05-15 11:29:27 +00:00
"La forme alternative entraîne l'insertion d'un préfixe ``'0x'`` ou ``'0X'`` "
"(respectivement pour les formats ``'x'`` et ``'X'``) avant le premier "
"chiffre."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3650
2016-10-30 09:46:26 +00:00
msgid ""
"The alternate form causes the result to always contain a decimal point, even "
"if no digits follow it."
msgstr ""
"La forme alternative implique la présence d'un point décimal, même si aucun "
"chiffre ne le suit."
#: library/stdtypes.rst:3653
2016-10-30 09:46:26 +00:00
msgid ""
"The precision determines the number of digits after the decimal point and "
"defaults to 6."
msgstr ""
"La précision détermine le nombre de chiffres après la virgule, 6 par défaut."
#: library/stdtypes.rst:3657
2016-10-30 09:46:26 +00:00
msgid ""
"The alternate form causes the result to always contain a decimal point, and "
"trailing zeroes are not removed as they would otherwise be."
msgstr ""
"La forme alternative implique la présence d'un point décimal et les zéros "
"non significatifs sont conservés (ils ne le seraient pas autrement)."
#: library/stdtypes.rst:3660
2016-10-30 09:46:26 +00:00
msgid ""
"The precision determines the number of significant digits before and after "
"the decimal point and defaults to 6."
msgstr ""
"La précision détermine le nombre de chiffres significatifs avant et après la "
"virgule. 6 par défaut."
#: library/stdtypes.rst:3664
2016-10-30 09:46:26 +00:00
msgid "If precision is ``N``, the output is truncated to ``N`` characters."
msgstr "Si la précision est ``N``, la sortie est tronquée à ``N`` caractères."
#: library/stdtypes.rst:3673
2016-10-30 09:46:26 +00:00
msgid "See :pep:`237`."
msgstr "Voir la :pep:`237`."
#: library/stdtypes.rst:2447
2016-10-30 09:46:26 +00:00
msgid ""
"Since Python strings have an explicit length, ``%s`` conversions do not "
"assume that ``'\\0'`` is the end of the string."
msgstr ""
"Puisque les chaînes Python ont une longueur explicite, les conversions ``"
"%s`` ne considèrent pas ``'\\0'`` comme la fin de la chaîne."
2016-10-30 09:46:26 +00:00
# suit un :
#: library/stdtypes.rst:2452
2016-10-30 09:46:26 +00:00
msgid ""
"``%f`` conversions for numbers whose absolute value is over 1e50 are no "
"longer replaced by ``%g`` conversions."
msgstr ""
"les conversions ``%f`` des nombres dont la valeur absolue est supérieure à "
"``1e50`` ne sont plus remplacées par des conversions ``%g``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2463
2016-10-30 09:46:26 +00:00
msgid ""
"Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:"
"`memoryview`"
msgstr ""
"Séquences Binaires — :class:`bytes`, :class:`bytearray`, :class:`vue mémoire "
"<memoryview>`"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2471
2016-10-30 09:46:26 +00:00
msgid ""
"The core built-in types for manipulating binary data are :class:`bytes` and :"
"class:`bytearray`. They are supported by :class:`memoryview` which uses the :"
"ref:`buffer protocol <bufferobjects>` to access the memory of other binary "
"objects without needing to make a copy."
msgstr ""
"Les principaux types natifs pour manipuler des données binaires sont :class:"
"`bytes` et :class:`bytearray`. Ils sont gérés par les :class:`vues mémoire "
"<memoryview>` qui utilisent le :ref:`protocole tampon <bufferobjects>` pour "
"accéder à la mémoire d'autres objets binaires sans avoir besoin d'en faire "
"une copie."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2476
2016-10-30 09:46:26 +00:00
msgid ""
"The :mod:`array` module supports efficient storage of basic data types like "
"32-bit integers and IEEE754 double-precision floating values."
msgstr ""
"Le module :mod:`array` permet le stockage efficace de types basiques comme "
"les entiers de 32 bits et les *float* double précision IEEE754."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2482
2017-08-01 11:29:09 +00:00
msgid "Bytes Objects"
msgstr "Objets *bytes*"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2486
2016-10-30 09:46:26 +00:00
msgid ""
"Bytes objects are immutable sequences of single bytes. Since many major "
"binary protocols are based on the ASCII text encoding, bytes objects offer "
"several methods that are only valid when working with ASCII compatible data "
"and are closely related to string objects in a variety of other ways."
msgstr ""
2019-05-23 18:55:52 +00:00
"Les *bytes* sont des séquences immuables d'octets. Comme beaucoup de "
"protocoles binaires utilisent l'ASCII, les objets *bytes* offrent plusieurs "
2016-10-30 09:46:26 +00:00
"méthodes qui ne sont valables que lors de la manipulation de données ASCII "
"et sont étroitement liés aux objets *str* dans bien d'autres aspects."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2493
2016-10-30 09:46:26 +00:00
msgid ""
"Firstly, the syntax for bytes literals is largely the same as that for "
"string literals, except that a ``b`` prefix is added:"
msgstr ""
"Tout d'abord, la syntaxe des *bytes* littéraux est en grande partie la même "
"que pour les chaînes littérales, en dehors du préfixe ``b`` :"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:2496
2016-10-30 09:46:26 +00:00
msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``"
msgstr ""
"entre guillemets simples : ``b'cela autorise les guillemets \"doubles\"'`` ;"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:2497
2021-12-31 10:41:52 +00:00
msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``"
2016-10-30 09:46:26 +00:00
msgstr ""
"entre guillemets (anglais) : ``b\"cela permet aussi les guillemets "
"'simples'\"`` ;"
2016-10-30 09:46:26 +00:00
# fin d'énumération
#: library/stdtypes.rst:2498
2016-10-30 09:46:26 +00:00
msgid ""
"Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``"
msgstr ""
"entre guillemets triples : ``b'''3 single quotes'''``, ``b\"\"\"3 double "
"quotes\"\"\"``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2500
2016-10-30 09:46:26 +00:00
msgid ""
"Only ASCII characters are permitted in bytes literals (regardless of the "
"declared source code encoding). Any binary values over 127 must be entered "
"into bytes literals using the appropriate escape sequence."
msgstr ""
"Seuls les caractères ASCII sont autorisés dans les littéraux de *bytes* "
"(quel que soit l'encodage du code source déclaré). Toutes les valeurs au "
"delà de 127 doivent être écrites en utilisant une séquence d'échappement "
"appropriée."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2504
2016-10-30 09:46:26 +00:00
msgid ""
"As with string literals, bytes literals may also use a ``r`` prefix to "
"disable processing of escape sequences. See :ref:`strings` for more about "
"the various forms of bytes literal, including supported escape sequences."
msgstr ""
"Comme avec les chaînes littérales, les *bytes* littéraux peuvent également "
"utiliser un préfixe ``r`` pour désactiver le traitement des séquences "
"d'échappement. Voir :ref:`strings` pour plus d'informations sur les "
"différentes formes littérales de *bytes*, y compris les séquences "
"d'échappement gérées."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2508
2016-10-30 09:46:26 +00:00
msgid ""
"While bytes literals and representations are based on ASCII text, bytes "
"objects actually behave like immutable sequences of integers, with each "
"value in the sequence restricted such that ``0 <= x < 256`` (attempts to "
"violate this restriction will trigger :exc:`ValueError`). This is done "
2016-10-30 09:46:26 +00:00
"deliberately to emphasise that while many binary formats include ASCII based "
"elements and can be usefully manipulated with some text-oriented algorithms, "
"this is not generally the case for arbitrary binary data (blindly applying "
"text processing algorithms to binary data formats that are not ASCII "
"compatible will usually lead to data corruption)."
msgstr ""
"Bien que les *bytes* littéraux, et leurs représentation, soient basés sur du "
"texte ASCII, les *bytes* se comportent en fait comme des séquences immuables "
"de nombres entiers, dont les valeurs sont restreintes dans l'intervalle ``0 "
"<= x < 256`` (ne pas respecter cette restriction lève une :exc:"
"`ValueError`). C'est délibéré afin de souligner que, bien que de nombreux "
"encodages binaires soient compatibles avec l'ASCII, et peuvent être "
"manipulés avec des algorithmes orientés texte, ce n'est généralement pas le "
"cas pour les données binaires arbitraires (appliquer aveuglément des "
"algorithmes de texte sur des données binaires qui ne sont pas compatibles "
"ASCII conduit généralement à leur corruption)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2518
2016-10-30 09:46:26 +00:00
msgid ""
"In addition to the literal forms, bytes objects can be created in a number "
"of other ways:"
msgstr ""
"En plus des formes littérales, des objets *bytes* peuvent être créés par de "
"nombreux moyens :"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:2521
2016-10-30 09:46:26 +00:00
msgid "A zero-filled bytes object of a specified length: ``bytes(10)``"
msgstr ""
"un objet *bytes* rempli de zéros d'une longueur spécifiée : ``bytes(10)`` ;"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:2522
2016-10-30 09:46:26 +00:00
msgid "From an iterable of integers: ``bytes(range(20))``"
msgstr "un itérable d'entiers : ``bytes(range(20))`` ;"
2016-10-30 09:46:26 +00:00
# fin d'énumération
#: library/stdtypes.rst:2523
2016-10-30 09:46:26 +00:00
msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``"
msgstr ""
"la copie de données binaires existantes via le protocole tampon : "
"``bytes(obj)``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2525
2016-10-30 09:46:26 +00:00
msgid "Also see the :ref:`bytes <func-bytes>` built-in."
msgstr "Voir aussi la fonction native :ref:`bytes <func-bytes>`."
#: library/stdtypes.rst:2527
2016-10-30 09:46:26 +00:00
msgid ""
"Since 2 hexadecimal digits correspond precisely to a single byte, "
"hexadecimal numbers are a commonly used format for describing binary data. "
"Accordingly, the bytes type has an additional class method to read data in "
"that format:"
msgstr ""
"Puisque 2 chiffres hexadécimaux correspondent précisément à un seul octet, "
"les nombres hexadécimaux sont un format couramment utilisé pour décrire les "
"données binaires. Par conséquent, le type *bytes* a une méthode de classe "
"pour lire des données dans ce format :"
#: library/stdtypes.rst:2533
2016-10-30 09:46:26 +00:00
msgid ""
"This :class:`bytes` class method returns a bytes object, decoding the given "
"string object. The string must contain two hexadecimal digits per byte, "
2017-08-01 11:29:09 +00:00
"with ASCII whitespace being ignored."
2016-10-30 09:46:26 +00:00
msgstr ""
"Cette méthode de la classe :class:`bytes` renvoie un objet *bytes*, décodant "
2017-08-01 12:16:10 +00:00
"la chaîne donnée. La chaîne doit contenir deux chiffres hexadécimaux par "
2016-10-30 09:46:26 +00:00
"octet, les espaces ASCII sont ignorés."
#: library/stdtypes.rst:2540
2018-06-28 13:32:56 +00:00
msgid ""
":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just "
"spaces."
msgstr ""
":meth:`bytes.fromhex` saute maintenant dans la chaîne tous les caractères "
"ASCII d'espacement, pas seulement les espaces."
2018-06-28 13:32:56 +00:00
#: library/stdtypes.rst:2544
2016-10-30 09:46:26 +00:00
msgid ""
"A reverse conversion function exists to transform a bytes object into its "
"hexadecimal representation."
msgstr ""
"Une fonction de conversion inverse existe pour transformer un objet *bytes* "
"en sa représentation hexadécimale."
#: library/stdtypes.rst:2634
2016-10-30 09:46:26 +00:00
msgid ""
"Return a string object containing two hexadecimal digits for each byte in "
"the instance."
msgstr ""
"Renvoie une chaîne contenant deux chiffres hexadécimaux pour chaque octet de "
"l'instance."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2555
2019-09-04 09:35:23 +00:00
msgid ""
"If you want to make the hex string easier to read, you can specify a single "
"character separator *sep* parameter to include in the output. By default, "
"this separator will be included between each byte. A second optional "
"*bytes_per_sep* parameter controls the spacing. Positive values calculate "
"the separator position from the right, negative values from the left."
2019-09-04 09:35:23 +00:00
msgstr ""
"Si vous voulez obtenir une chaîne hexadécimale plus facile à lire, vous "
"pouvez spécifier le paramètre *sep* comme « caractère de séparation », à "
"inclure dans la sortie. Par défaut, ce caractère est inséré entre chaque "
"octet. Un second paramètre optionnel *bytes_per_sep* contrôle l'espacement. "
"Les valeurs positives calculent la position du séparateur en partant de la "
"droite, les valeurs négatives de la gauche."
2019-09-04 09:35:23 +00:00
#: library/stdtypes.rst:2572
2019-09-04 09:35:23 +00:00
msgid ""
":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters "
"to insert separators between bytes in the hex output."
msgstr ""
":meth:`bytes.hex` prend désormais en charge les paramètres optionnels *sep* "
"et *bytes_per_sep* pour insérer des séparateurs entre les octets dans la "
"sortie hexadécimale."
2019-09-04 09:35:23 +00:00
#: library/stdtypes.rst:2576
2016-10-30 09:46:26 +00:00
msgid ""
"Since bytes objects are sequences of integers (akin to a tuple), for a bytes "
"object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes "
"object of length 1. (This contrasts with text strings, where both indexing "
"and slicing will produce a string of length 1)"
msgstr ""
"Comme les objets *bytes* sont des séquences d'entiers (semblables à un *n*-"
"uplet), pour une instance de *bytes* *b*, ``b[0]`` est un entier, tandis que "
"``b[0:1]`` est un objet *bytes* de longueur 1. (Cela contraste avec les "
"chaînes, où un indice et le découpage donnent une chaîne de longueur 1.)"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2581
2016-10-30 09:46:26 +00:00
msgid ""
"The representation of bytes objects uses the literal format (``b'...'``) "
"since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can "
"always convert a bytes object into a list of integers using ``list(b)``."
msgstr ""
"La représentation des *bytes* utilise le format littéral (``b'...'``) car il "
"est souvent plus utile que par exemple ``bytes([46, 46, 46])``. Vous pouvez "
"toujours convertir un *bytes* en liste d'entiers en utilisant ``list(b)``."
#: library/stdtypes.rst:2589
2016-10-30 09:46:26 +00:00
msgid "Bytearray Objects"
msgstr "Objets *bytearray*"
#: library/stdtypes.rst:2593
2016-10-30 09:46:26 +00:00
msgid ""
":class:`bytearray` objects are a mutable counterpart to :class:`bytes` "
2017-08-01 11:29:09 +00:00
"objects."
msgstr ""
"Les objets :class:`bytearray` sont l'équivalent muable des objets :class:"
2017-08-01 22:11:48 +00:00
"`bytes`."
2017-08-01 11:29:09 +00:00
#: library/stdtypes.rst:2598
2017-08-01 11:29:09 +00:00
msgid ""
"There is no dedicated literal syntax for bytearray objects, instead they are "
"always created by calling the constructor:"
2016-10-30 09:46:26 +00:00
msgstr ""
2017-08-01 12:16:10 +00:00
"Il n'y a pas de syntaxe littérale dédiée aux *bytearray*, ils sont toujours "
"créés en appelant le constructeur :"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:2601
2016-10-30 09:46:26 +00:00
msgid "Creating an empty instance: ``bytearray()``"
msgstr "créer une instance vide: ``bytearray()`` ;"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:2602
2016-10-30 09:46:26 +00:00
msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``"
msgstr ""
"crée une instance remplie de zéros d'une longueur donnée : "
"``bytearray(10)`` ;"
2016-10-30 09:46:26 +00:00
# énumération
#: library/stdtypes.rst:2603
2016-10-30 09:46:26 +00:00
msgid "From an iterable of integers: ``bytearray(range(20))``"
msgstr "à partir d'un itérable d'entiers : ``bytearray(range(20))`` ;"
2016-10-30 09:46:26 +00:00
# fin d'énumération
#: library/stdtypes.rst:2604
2016-10-30 09:46:26 +00:00
msgid ""
"Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``"
msgstr ""
"copie des données binaires existantes via le protocole tampon : "
"``bytearray(b'Hi!')``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2606
2016-10-30 09:46:26 +00:00
msgid ""
"As bytearray objects are mutable, they support the :ref:`mutable <typesseq-"
"mutable>` sequence operations in addition to the common bytes and bytearray "
"operations described in :ref:`bytes-methods`."
msgstr ""
"Comme les *bytearray* sont muables, ils prennent en charge les opérations de "
"séquences :ref:`muables <typesseq-mutable>` en plus des opérations communes "
"de *bytes* et *bytearray* décrites dans :ref:`bytes-methods`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2610
2016-10-30 09:46:26 +00:00
msgid "Also see the :ref:`bytearray <func-bytearray>` built-in."
msgstr "Voir aussi la fonction native :ref:`bytearray <func-bytearray>`."
#: library/stdtypes.rst:2612
2016-10-30 09:46:26 +00:00
msgid ""
"Since 2 hexadecimal digits correspond precisely to a single byte, "
"hexadecimal numbers are a commonly used format for describing binary data. "
"Accordingly, the bytearray type has an additional class method to read data "
"in that format:"
msgstr ""
"Puisque 2 chiffres hexadécimaux correspondent précisément à un octet, les "
"nombres hexadécimaux sont un format couramment utilisé pour décrire les "
"données binaires. Par conséquent, le type *bytearray* a une méthode de "
"classe pour lire les données dans ce format :"
#: library/stdtypes.rst:2618
2016-10-30 09:46:26 +00:00
msgid ""
"This :class:`bytearray` class method returns bytearray object, decoding the "
"given string object. The string must contain two hexadecimal digits per "
2017-08-01 11:29:09 +00:00
"byte, with ASCII whitespace being ignored."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-08-01 12:16:10 +00:00
"Cette méthode de la classe :class:`bytearray` renvoie un objet *bytearray*, "
"décodant la chaîne donnée. La chaîne doit contenir deux chiffres "
"hexadécimaux par octet, les caractères d'espacement ASCII sont ignorés."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2625
2018-06-28 13:32:56 +00:00
msgid ""
":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not "
"just spaces."
msgstr ""
":meth:`bytearray.fromhex` saute maintenant tous les caractères d'espacement "
"ASCII dans la chaîne, pas seulement les espaces."
2018-06-28 13:32:56 +00:00
#: library/stdtypes.rst:2629
2016-10-30 09:46:26 +00:00
msgid ""
"A reverse conversion function exists to transform a bytearray object into "
"its hexadecimal representation."
msgstr ""
"Une fonction de conversion inverse existe pour transformer un objet "
"*bytearray* en sa représentation hexadécimale."
# suit un :
#: library/stdtypes.rst:2642
2020-05-24 14:31:50 +00:00
msgid ""
"Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional "
"*sep* and *bytes_per_sep* parameters to insert separators between bytes in "
"the hex output."
msgstr ""
"similaire à :meth:`bytes.hex`, :meth:`bytearray.hex` prend désormais en "
"charge les paramètres optionnels *sep* et *bytes_per_sep* pour insérer des "
"séparateurs entre les octets dans la sortie hexadécimale."
2020-05-24 14:31:50 +00:00
#: library/stdtypes.rst:2647
2016-10-30 09:46:26 +00:00
msgid ""
"Since bytearray objects are sequences of integers (akin to a list), for a "
"bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be "
"a bytearray object of length 1. (This contrasts with text strings, where "
"both indexing and slicing will produce a string of length 1)"
msgstr ""
"Comme les *bytearray* sont des séquences d'entiers (semblables à une liste), "
"pour un objet *bytearray* *b*, ``b[0]`` est un entier, tandis que ``b[0:1]`` "
"est un objet *bytearray* de longueur 1. (Ceci contraste avec les chaînes de "
"texte, où l'indice et le découpage produisent une chaîne de longueur 1)"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2652
2016-10-30 09:46:26 +00:00
msgid ""
"The representation of bytearray objects uses the bytes literal format "
"(``bytearray(b'...')``) since it is often more useful than e.g. "
"``bytearray([46, 46, 46])``. You can always convert a bytearray object into "
"a list of integers using ``list(b)``."
msgstr ""
"La représentation des objets *bytearray* utilise le format littéral des "
"*bytes* (``bytearray(b'...')``) car il est souvent plus utile que par "
"exemple ``bytearray([46, 46, 46])``. Vous pouvez toujours convertir un objet "
"*bytearray* en une liste de nombres entiers en utilisant ``list(b)``."
#: library/stdtypes.rst:2661
2016-10-30 09:46:26 +00:00
msgid "Bytes and Bytearray Operations"
msgstr "Opérations sur les *bytes* et *bytearray*"
#: library/stdtypes.rst:2666
2016-10-30 09:46:26 +00:00
msgid ""
"Both bytes and bytearray objects support the :ref:`common <typesseq-common>` "
"sequence operations. They interoperate not just with operands of the same "
"type, but with any :term:`bytes-like object`. Due to this flexibility, they "
"can be freely mixed in operations without causing errors. However, the "
"return type of the result may depend on the order of operands."
msgstr ""
"*bytes* et *bytearray* prennent en charge les opérations :ref:`communes "
"<typesseq-common>` des séquences. Ils interagissent non seulement avec des "
"opérandes de même type, mais aussi avec les :term:`objets octet-compatibles "
"<bytes-like object>`. En raison de cette flexibilité, ils peuvent être "
"mélangés librement dans des opérations sans provoquer d'erreurs. Cependant, "
"le type du résultat peut dépendre de l'ordre des opérandes."
2016-10-30 09:46:26 +00:00
# suit un :
#: library/stdtypes.rst:2674
2016-10-30 09:46:26 +00:00
msgid ""
"The methods on bytes and bytearray objects don't accept strings as their "
"arguments, just as the methods on strings don't accept bytes as their "
"arguments. For example, you have to write::"
msgstr ""
"les méthodes sur les *bytes* et les *bytearray* n'acceptent pas les chaînes "
2016-10-30 09:46:26 +00:00
"comme arguments, tout comme les méthodes sur les chaînes n'acceptent pas les "
"*bytes* comme arguments. Par exemple, vous devez écrire ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2681
2016-10-30 09:46:26 +00:00
msgid "and::"
msgstr "et ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2686
2016-10-30 09:46:26 +00:00
msgid ""
"Some bytes and bytearray operations assume the use of ASCII compatible "
"binary formats, and hence should be avoided when working with arbitrary "
"binary data. These restrictions are covered below."
msgstr ""
"Quelques opérations de *bytes* et *bytesarray* supposent l'utilisation de "
"formats binaires compatibles ASCII, et donc doivent être évités lorsque vous "
"travaillez avec des données binaires arbitraires. Ces restrictions sont "
"couvertes ci-dessous."
# suit un :
#: library/stdtypes.rst:2691
2016-10-30 09:46:26 +00:00
msgid ""
"Using these ASCII based operations to manipulate binary data that is not "
"stored in an ASCII based format may lead to data corruption."
msgstr ""
"utiliser ces opérations basées sur l'ASCII pour manipuler des données "
2016-10-30 09:46:26 +00:00
"binaires qui ne sont pas au format ASCII peut les corrompre."
#: library/stdtypes.rst:2694
2016-10-30 09:46:26 +00:00
msgid ""
"The following methods on bytes and bytearray objects can be used with "
"arbitrary binary data."
msgstr ""
"Les méthodes suivantes sur les *bytes* et *bytearray* peuvent être utilisées "
"avec des données binaires arbitraires."
#: library/stdtypes.rst:2700
2016-10-30 09:46:26 +00:00
msgid ""
"Return the number of non-overlapping occurrences of subsequence *sub* in the "
"range [*start*, *end*]. Optional arguments *start* and *end* are "
"interpreted as in slice notation."
msgstr ""
"Renvoie le nombre d'occurrences qui ne se chevauchent pas de la sous-"
"séquence *sub* dans l'intervalle [*start*, *end*]. Les arguments facultatifs "
"*start* et *end* sont interprétés comme dans la notation des découpages."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2809 library/stdtypes.rst:2897
#: library/stdtypes.rst:2910
2016-10-30 09:46:26 +00:00
msgid ""
"The subsequence to search for may be any :term:`bytes-like object` or an "
"integer in the range 0 to 255."
msgstr ""
"La sous-séquence à rechercher peut être un quelconque :term:`objet octet-"
"compatible <bytes-like object>` ou un nombre entier compris entre 0 et 255."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2707
msgid ""
"If *sub* is empty, returns the number of empty slices between characters "
"which is the length of the bytes object plus one."
msgstr ""
"Si *sub* est vide, renvoie le nombre de tranches vides entre les caractères "
"de début et de fin, ce qui correspond à la longueur de l'objet bytes plus un."
# suit un :
#: library/stdtypes.rst:2821 library/stdtypes.rst:2900
#: library/stdtypes.rst:2913
2016-10-30 09:46:26 +00:00
msgid "Also accept an integer in the range 0 to 255 as the subsequence."
msgstr ""
"accepte aussi un nombre entier compris entre 0 et 255 comme sous-séquence."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2717
2020-07-20 08:56:42 +00:00
msgid ""
"If the binary data starts with the *prefix* string, return "
"``bytes[len(prefix):]``. Otherwise, return a copy of the original binary "
"data::"
msgstr ""
"Si les données binaires commencent par la chaîne *prefix*, renvoie "
"``bytes[len(prefix):]``. Sinon, renvoie une copie des données binaires "
"d'origine ::"
2020-07-20 08:56:42 +00:00
#: library/stdtypes.rst:2726
2020-07-20 08:56:42 +00:00
msgid "The *prefix* may be any :term:`bytes-like object`."
msgstr ""
"Le *prefix* peut être n'importe quel :term:`objet octet-compatible <bytes-"
"like object>`."
2020-07-20 08:56:42 +00:00
# suit un :
#: library/stdtypes.rst:2752 library/stdtypes.rst:2978
#: library/stdtypes.rst:3023 library/stdtypes.rst:3079
#: library/stdtypes.rst:3167 library/stdtypes.rst:3334
#: library/stdtypes.rst:3432 library/stdtypes.rst:3475
#: library/stdtypes.rst:3677
2020-07-20 08:56:42 +00:00
msgid ""
"The bytearray version of this method does *not* operate in place - it always "
"produces a new object, even if no changes were made."
msgstr ""
"la version *bytearray* de cette méthode *ne modifie pas* les octets, elle "
2020-07-20 08:56:42 +00:00
"produit toujours un nouvel objet, même si aucune modification n'a été "
"effectuée."
#: library/stdtypes.rst:2739
2020-07-20 08:56:42 +00:00
msgid ""
"If the binary data ends with the *suffix* string and that *suffix* is not "
"empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the "
"original binary data::"
msgstr ""
"Si les données binaires terminent par la chaîne *suffix*, renvoie ``bytes[:-"
"len(suffix)]``. Sinon, renvoie une copie des données binaires d'origine ::"
2020-07-20 08:56:42 +00:00
#: library/stdtypes.rst:2748
2020-07-20 08:56:42 +00:00
msgid "The *suffix* may be any :term:`bytes-like object`."
msgstr ""
"Le *suffix* peut être n'importe quel :term:`objet octet-compatible <bytes-"
"like object>`."
2020-07-20 08:56:42 +00:00
#: library/stdtypes.rst:2761
msgid "Return the bytes decoded to a :class:`str`."
msgstr "Renvoie la chaine d'octets décodée en instance de :class:`str`."
#: library/stdtypes.rst:2766
2016-10-30 09:46:26 +00:00
msgid ""
"*errors* controls how decoding errors are handled. If ``'strict'`` (the "
"default), a :exc:`UnicodeError` exception is raised. Other possible values "
"are ``'ignore'``, ``'replace'``, and any other name registered via :func:"
"`codecs.register_error`. See :ref:`error-handlers` for details."
2016-10-30 09:46:26 +00:00
msgstr ""
"*errors* détermine la manière dont sont traitées les erreurs. Sa valeur par "
"défaut est ``'strict'``, ce qui signifie que les erreurs d'encodage lèvent "
"une :exc:`UnicodeError`. Les autres valeurs possibles sont ``'ignore'``, "
"``'replace'`` et tout autre nom enregistré *via* :func:`codecs."
"register_error`, voir la section :ref:`error-handlers` pour les détails."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2772
2020-07-20 08:56:42 +00:00
msgid ""
"For performance reasons, the value of *errors* is not checked for validity "
"unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:"
"`debug build <debug-build>` is used."
2020-07-20 08:56:42 +00:00
msgstr ""
"Pour des raisons de performances, la valeur de *errors* n'est pas vérifiée à "
"moins qu'une erreur de décodage ne se produise réellement, que le :ref:`mode "
"développeur <devmode>` ne soit activé ou que Python ait été compilé en :ref:"
"`mode débogage <debug-build>`."
2020-07-20 08:56:42 +00:00
# suit un :
#: library/stdtypes.rst:2778
2016-10-30 09:46:26 +00:00
msgid ""
"Passing the *encoding* argument to :class:`str` allows decoding any :term:"
"`bytes-like object` directly, without needing to make a temporary :class:`!"
"bytes` or :class:`!bytearray` object."
2016-10-30 09:46:26 +00:00
msgstr ""
"passer l'argument *encoding* à :class:`str` permet de décoder tout :term:"
"`objet octet-compatible <bytes-like object>` directement, sans avoir besoin "
"d'utiliser un :class:`!bytes` ou :class:`!bytearray` temporaire."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2793
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if the binary data ends with the specified *suffix*, "
"otherwise return ``False``. *suffix* can also be a tuple of suffixes to "
"look for. With optional *start*, test beginning at that position. With "
"optional *end*, stop comparing at that position."
msgstr ""
"Renvoie ``True`` si les octets se terminent par *suffix*, sinon ``False``. "
"*suffix* peut aussi être un *n*-uplet de suffixes à rechercher. Avec "
"l'argument optionnel *start*, la recherche se fait à partir de cette "
"position. Avec l'argument optionnel *end*, la comparaison s'arrête à cette "
"position."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2798
2016-10-30 09:46:26 +00:00
msgid "The suffix(es) to search for may be any :term:`bytes-like object`."
msgstr ""
"Les suffixes à rechercher peuvent être n'importe quel :term:`objet octet-"
"compatible <bytes-like object>`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2804
2016-10-30 09:46:26 +00:00
msgid ""
"Return the lowest index in the data where the subsequence *sub* is found, "
"such that *sub* is contained in the slice ``s[start:end]``. Optional "
"arguments *start* and *end* are interpreted as in slice notation. Return "
"``-1`` if *sub* is not found."
msgstr ""
"Renvoie la première position où le *sub* se trouve dans les données, de "
"telle sorte que *sub* soit contenue dans ``s[start:end]``. Les arguments "
2016-10-30 09:46:26 +00:00
"facultatifs *start* et *end* sont interprétés comme dans la notation des "
"découpages. Renvoie ``-1`` si *sub* n'est pas trouvé."
2016-10-30 09:46:26 +00:00
# suit un :
#: library/stdtypes.rst:2814
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`~bytes.find` method should be used only if you need to know the "
"position of *sub*. To check if *sub* is a substring or not, use the :"
"keyword:`in` operator::"
msgstr ""
"la méthode :meth:`~bytes.find` ne doit être utilisée que si vous avez besoin "
2016-10-30 09:46:26 +00:00
"de connaître la position de *sub*. Pour vérifier si *sub* est présent ou "
"non, utilisez l'opérateur :keyword:`in` ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2828
2016-10-30 09:46:26 +00:00
msgid ""
"Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence "
"is not found."
msgstr ""
"Comme :meth:`~bytes.find`, mais lève une :exc:`ValueError` lorsque la "
"séquence est introuvable."
#: library/stdtypes.rst:2841
2016-10-30 09:46:26 +00:00
msgid ""
"Return a bytes or bytearray object which is the concatenation of the binary "
2017-08-01 11:29:09 +00:00
"data sequences in *iterable*. A :exc:`TypeError` will be raised if there "
"are any values in *iterable* that are not :term:`bytes-like objects <bytes-"
"like object>`, including :class:`str` objects. The separator between "
"elements is the contents of the bytes or bytearray object providing this "
"method."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie un *bytes* ou *bytearray* qui est la concaténation des séquences de "
2017-08-01 12:16:10 +00:00
"données binaires dans *iterable*. Une exception :exc:`TypeError` est levée "
"si une valeur d'*iterable* n'est pas un :term:`objet octet-compatible <bytes-"
"like object>`, y compris pour des :class:`str`. Le séparateur entre les "
2017-08-01 12:16:10 +00:00
"éléments est le contenu du *bytes* ou du *bytearray* depuis lequel cette "
"méthode est appelée."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2852
2016-10-30 09:46:26 +00:00
msgid ""
"This static method returns a translation table usable for :meth:`bytes."
"translate` that will map each character in *from* into the character at the "
"same position in *to*; *from* and *to* must both be :term:`bytes-like "
"objects <bytes-like object>` and have the same length."
msgstr ""
"Cette méthode statique renvoie une table de traduction utilisable par :meth:"
"`bytes.translate` qui permettra de changer chaque caractère de *from* par un "
"caractère à la même position dans *to* ; *from* et *to* doivent tous deux "
"être des :term:`objets octet-compatibles <bytes-like object>` et avoir la "
"même longueur."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2863
2016-10-30 09:46:26 +00:00
msgid ""
"Split the sequence at the first occurrence of *sep*, and return a 3-tuple "
2017-12-01 06:48:13 +00:00
"containing the part before the separator, the separator itself or its "
"bytearray copy, and the part after the separator. If the separator is not "
"found, return a 3-tuple containing a copy of the original sequence, followed "
"by two empty bytes or bytearray objects."
msgstr ""
"Divise la séquence à la première occurrence de *sep*, et renvoie un triplet "
"contenant la partie précédant le séparateur, le séparateur lui même (ou sa "
"copie en *byterray*), et la partie suivant le séparateur. Si le séparateur "
"n'est pas trouvé, le triplet renvoyé contient une copie de la séquence "
"d'origine, suivi de deux *bytes* ou *bytearray* vides."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2927
2016-10-30 09:46:26 +00:00
msgid "The separator to search for may be any :term:`bytes-like object`."
msgstr ""
"Le séparateur à rechercher peut être tout :term:`objet octet-compatible "
"<bytes-like object>`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2876
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the sequence with all occurrences of subsequence *old* "
"replaced by *new*. If the optional argument *count* is given, only the "
"first *count* occurrences are replaced."
msgstr ""
"Renvoie une copie de la séquence dont toutes les occurrences de la sous-"
"séquence *old* sont remplacées par *new*. Si l'argument optionnel *count* "
"est donné, seules les *count* premières occurrences sont remplacées."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2880
2016-10-30 09:46:26 +00:00
msgid ""
"The subsequence to search for and its replacement may be any :term:`bytes-"
"like object`."
msgstr ""
"La sous-séquence à rechercher et son remplacement peuvent être n'importe "
"quel :term:`objet octet-compatible <bytes-like object>`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2892
2016-10-30 09:46:26 +00:00
msgid ""
"Return the highest index in the sequence where the subsequence *sub* is "
"found, such that *sub* is contained within ``s[start:end]``. Optional "
"arguments *start* and *end* are interpreted as in slice notation. Return "
"``-1`` on failure."
msgstr ""
"Renvoie la plus grande position de *sub* dans la séquence, de telle sorte "
"que *sub* soit dans ``s[start:end]``. Les arguments facultatifs *start* et "
"*end* sont interprétés comme dans la notation des découpages. Renvoie ``-1`` "
"si *sub* n'est pas trouvable."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2907
2016-10-30 09:46:26 +00:00
msgid ""
"Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence "
"*sub* is not found."
msgstr ""
"Semblable à :meth:`~bytes.rfind` mais lève une :exc:`ValueError` lorsque "
"*sub* est introuvable."
#: library/stdtypes.rst:2920
2016-10-30 09:46:26 +00:00
msgid ""
"Split the sequence at the last occurrence of *sep*, and return a 3-tuple "
2017-12-01 06:48:13 +00:00
"containing the part before the separator, the separator itself or its "
"bytearray copy, and the part after the separator. If the separator is not "
"found, return a 3-tuple containing two empty bytes or bytearray objects, "
"followed by a copy of the original sequence."
msgstr ""
"Coupe la séquence à la dernière occurrence de *sep*, et renvoie un triplet "
2019-05-24 16:34:22 +00:00
"de trois éléments contenant la partie précédent le séparateur, le séparateur "
"lui même (ou sa copie, un *bytearray*), et la partie suivant le séparateur. "
"Si le séparateur n'est pas trouvé, le triplet contient deux *bytes* ou "
2019-05-28 18:41:08 +00:00
"*bytesarray* vides suivi dune copie de la séquence d'origine."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2933
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if the binary data starts with the specified *prefix*, "
"otherwise return ``False``. *prefix* can also be a tuple of prefixes to "
"look for. With optional *start*, test beginning at that position. With "
"optional *end*, stop comparing at that position."
msgstr ""
"Renvoie ``True`` si les données binaires commencent par le *prefix* "
"spécifié, sinon ``False``. *prefix* peut aussi être un *n*-uplet de préfixes "
"à rechercher. Avec l'argument *start* la recherche commence à cette "
"position. Avec l'argument *end* option, la recherche s'arrête à cette "
"position."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2938
2016-10-30 09:46:26 +00:00
msgid "The prefix(es) to search for may be any :term:`bytes-like object`."
msgstr ""
"Les préfixes à rechercher peuvent être n'importe quels :term:`objets octet-"
"compatibles <bytes-like object>`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2944
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the bytes or bytearray object where all bytes occurring in "
"the optional argument *delete* are removed, and the remaining bytes have "
"been mapped through the given translation table, which must be a bytes "
"object of length 256."
msgstr ""
"Renvoie une copie du *bytes* ou *bytearray* dont tous les octets de "
"*delete* sont supprimés, et les octets restants changés par la table de "
"correspondance donnée, qui doit être un objet *bytes* d'une longueur de 256."
#: library/stdtypes.rst:2949
2016-10-30 09:46:26 +00:00
msgid ""
"You can use the :func:`bytes.maketrans` method to create a translation table."
msgstr ""
"Vous pouvez utiliser la méthode :func:`bytes.maketrans` pour créer une table "
"de correspondance."
#: library/stdtypes.rst:2952
2016-10-30 09:46:26 +00:00
msgid ""
"Set the *table* argument to ``None`` for translations that only delete "
"characters::"
msgstr ""
"Donnez ``None`` comme *table* pour seulement supprimer des caractères ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2958
2016-10-30 09:46:26 +00:00
msgid "*delete* is now supported as a keyword argument."
2018-03-20 23:16:43 +00:00
msgstr "*delete* est maintenant accepté comme argument nommé."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2962
2016-10-30 09:46:26 +00:00
msgid ""
"The following methods on bytes and bytearray objects have default behaviours "
"that assume the use of ASCII compatible binary formats, but can still be "
"used with arbitrary binary data by passing appropriate arguments. Note that "
"all of the bytearray methods in this section do *not* operate in place, and "
"instead produce new objects."
msgstr ""
"Les méthodes suivantes sur les *bytes* et *bytearray* supposent par défaut "
"que les données traitées sont compatibles ASCII, mais peuvent toujours être "
2016-10-30 09:46:26 +00:00
"utilisées avec des données binaires, arbitraires, en passant des arguments "
"appropriés. Notez que toutes les méthodes de *bytearray* de cette section ne "
"travaillent jamais sur l'objet lui-même, mais renvoient un nouvel objet."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2971
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the object centered in a sequence of length *width*. "
"Padding is done using the specified *fillbyte* (default is an ASCII space). "
"For :class:`bytes` objects, the original sequence is returned if *width* is "
"less than or equal to ``len(s)``."
msgstr ""
"Renvoie une copie de l'objet centrée dans une séquence de longueur *width*. "
"Le remplissage est fait en utilisant *fillbyte* (qui par défaut est une "
2016-10-30 09:46:26 +00:00
"espace ASCII). Pour les objets :class:`bytes`, la séquence initiale est "
"renvoyée si *width* est inférieure ou égale à ``len(s)``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:2985
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the object left justified in a sequence of length *width*. "
"Padding is done using the specified *fillbyte* (default is an ASCII space). "
"For :class:`bytes` objects, the original sequence is returned if *width* is "
"less than or equal to ``len(s)``."
msgstr ""
"Renvoie une copie de l'objet aligné à gauche dans une séquence de longueur "
"*width*. Le remplissage est fait en utilisant *fillbyte* (par défaut un "
"espace ASCII). Pour les objets :class:`bytes`, la séquence initiale est "
"renvoyée si *width* est inférieure ou égale à ``len(s)``."
#: library/stdtypes.rst:2999
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the sequence with specified leading bytes removed. The "
"*chars* argument is a binary sequence specifying the set of byte values to "
"be removed - the name refers to the fact this method is usually used with "
"ASCII characters. If omitted or ``None``, the *chars* argument defaults to "
"removing ASCII whitespace. The *chars* argument is not a prefix; rather, "
"all combinations of its values are stripped::"
msgstr ""
"Renvoie une copie de la séquence dont certains préfixes ont été supprimés. "
"Largument *chars* est une séquence binaire spécifiant le jeu d'octets à "
"supprimer. Ce nom se réfère au fait de cette méthode est généralement "
"utilisée avec des caractères ASCII. En cas domission ou ``None``, la valeur "
"par défaut de *chars* permet de supprimer des espaces ASCII. Largument "
"*chars* nest pas un préfixe, toutes les combinaisons de ses valeurs sont "
"supprimées ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3011
2016-10-30 09:46:26 +00:00
msgid ""
"The binary sequence of byte values to remove may be any :term:`bytes-like "
2020-07-20 08:56:42 +00:00
"object`. See :meth:`~bytes.removeprefix` for a method that will remove a "
"single prefix string rather than all of a set of characters. For example::"
2016-10-30 09:46:26 +00:00
msgstr ""
"Les octets à retirer peuvent être n'importe quel :term:`bytes-like object`. "
"Voir :meth:`~bytes.removeprefix` pour une méthode qui supprime, au début de "
"la séquence, la chaîne de caractères en tant que telle plutôt que l'ensemble "
"des caractères passés en paramètre. Par exemple ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3030
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the object right justified in a sequence of length *width*. "
"Padding is done using the specified *fillbyte* (default is an ASCII space). "
"For :class:`bytes` objects, the original sequence is returned if *width* is "
"less than or equal to ``len(s)``."
msgstr ""
"Renvoie une copie de l'objet justifié à droite dans une séquence de longueur "
"*width*. Le remplissage est fait en utilisant le caractère *fillbyte* (par "
"défaut est un espace ASCII). Pour les objets :class:`bytes`, la séquence "
"d'origine est renvoyée si *width* est inférieure ou égale à ``len(s)``."
#: library/stdtypes.rst:3044
2016-10-30 09:46:26 +00:00
msgid ""
"Split the binary sequence into subsequences of the same type, using *sep* as "
"the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are "
"done, the *rightmost* ones. If *sep* is not specified or ``None``, any "
"subsequence consisting solely of ASCII whitespace is a separator. Except for "
"splitting from the right, :meth:`rsplit` behaves like :meth:`split` which is "
"described in detail below."
msgstr ""
"Divise la séquence d'octets en sous-séquences du même type, en utilisant "
"*sep* comme séparateur. Si *maxsplit* est donné, c'est le nombre maximum de "
"divisions qui pourront être faites, celles \"à droite\". Si *sep* est pas "
"spécifié ou est ``None``, toute sous-séquence composée uniquement d'espaces "
"ASCII est un séparateur. En dehors du fait qu'il découpe par la droite, :"
"meth:`rsplit` se comporte comme :meth:`split` qui est décrit en détail ci-"
"dessous."
#: library/stdtypes.rst:3055
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the sequence with specified trailing bytes removed. The "
"*chars* argument is a binary sequence specifying the set of byte values to "
"be removed - the name refers to the fact this method is usually used with "
"ASCII characters. If omitted or ``None``, the *chars* argument defaults to "
"removing ASCII whitespace. The *chars* argument is not a suffix; rather, "
"all combinations of its values are stripped::"
msgstr ""
"Renvoie une copie de la séquence dont des octets finaux sont supprimés. "
"L'argument *chars* est une séquence d'octets spécifiant le jeu de caractères "
"à supprimer. En cas d'omission ou ``None``, les espaces ASCII sont "
"supprimées. L'argument *chars* n'est pas un suffixe : toutes les "
"combinaisons de ses valeurs sont retirées ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3067
2020-07-20 08:56:42 +00:00
msgid ""
"The binary sequence of byte values to remove may be any :term:`bytes-like "
"object`. See :meth:`~bytes.removesuffix` for a method that will remove a "
"single suffix string rather than all of a set of characters. For example::"
msgstr ""
"Les octets à retirer peuvent être n'importe quel :term:`bytes-like object`. "
"Voir :meth:`~bytes.removesuffix` pour une méthode qui supprime, à la fin de "
"la séquence, la chaîne de caractères en tant que telle plutôt que l'ensemble "
"des caractères passés en paramètre. Par exemple ::"
2020-07-20 08:56:42 +00:00
#: library/stdtypes.rst:3086
2016-10-30 09:46:26 +00:00
msgid ""
"Split the binary sequence into subsequences of the same type, using *sep* as "
"the delimiter string. If *maxsplit* is given and non-negative, at most "
"*maxsplit* splits are done (thus, the list will have at most ``maxsplit+1`` "
"elements). If *maxsplit* is not specified or is ``-1``, then there is no "
"limit on the number of splits (all possible splits are made)."
msgstr ""
"Divise la séquence en sous-séquences du même type, en utilisant *sep* comme "
"séparateur. Si *maxsplit* est donné, c'est le nombre maximum de divisions "
"qui pourront être faites (la liste aura donc au plus ``maxsplit+1`` "
"éléments), Si *maxsplit* n'est pas spécifié ou faut ``-1``, il n'y a aucune "
"limite au nombre de découpes (elles sont toutes effectuées)."
#: library/stdtypes.rst:3092
2016-10-30 09:46:26 +00:00
msgid ""
"If *sep* is given, consecutive delimiters are not grouped together and are "
"deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` "
"returns ``[b'1', b'', b'2']``). The *sep* argument may consist of a "
"multibyte sequence (for example, ``b'1<>2<>3'.split(b'<>')`` returns "
"``[b'1', b'2', b'3']``). Splitting an empty sequence with a specified "
"separator returns ``[b'']`` or ``[bytearray(b'')]`` depending on the type of "
"object being split. The *sep* argument may be any :term:`bytes-like object`."
msgstr ""
"Si *sep* est donné, les délimiteurs consécutifs ne sont pas regroupés et "
"ainsi délimitent ainsi des chaînes vides (par exemple, ``b'1,,2'."
"split(b',')`` renvoie ``[b'1', b'', b'2']``). L'argument *sep* peut contenir "
"plusieurs sous-séquences (par exemple, ``b'1<>2<>3'.split(b'<>')`` renvoie "
"``[b'1', b'2', b'3']``). Découper une chaîne vide en spécifiant *sep* "
"renvoie ``[b'']`` ou ``[bytearray(b'')]`` en fonction du type de l'objet "
"découpé. L'argument *sep* peut être n'importe quel :term:`bytes-like object`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3110
2016-10-30 09:46:26 +00:00
msgid ""
"If *sep* is not specified or is ``None``, a different splitting algorithm is "
"applied: runs of consecutive ASCII whitespace are regarded as a single "
"separator, and the result will contain no empty strings at the start or end "
"if the sequence has leading or trailing whitespace. Consequently, splitting "
"an empty sequence or a sequence consisting solely of ASCII whitespace "
"without a specified separator returns ``[]``."
msgstr ""
"Si *sep* n'est pas spécifié ou est ``None``, un autre algorithme de découpe "
"est appliqué : les espaces ASCII consécutifs sont considérés comme un seul "
2016-10-30 09:46:26 +00:00
"séparateur, et le résultat ne contiendra pas les chaînes vides de début ou "
"de la fin si la chaîne est préfixée ou suffixé d'espaces. Par conséquent, "
"diviser une séquence vide ou une séquence composée d'espaces ASCII avec un "
"séparateur ``None`` renvoie ``[]``."
#: library/stdtypes.rst:3131
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the sequence with specified leading and trailing bytes "
"removed. The *chars* argument is a binary sequence specifying the set of "
"byte values to be removed - the name refers to the fact this method is "
"usually used with ASCII characters. If omitted or ``None``, the *chars* "
"argument defaults to removing ASCII whitespace. The *chars* argument is not "
"a prefix or suffix; rather, all combinations of its values are stripped::"
msgstr ""
"Renvoie une copie de la séquence dont des caractères initiaux et finaux sont "
"supprimés. L'argument *chars* est une séquence spécifiant le jeu d'octets à "
"supprimer, le nom se réfère au fait de cette méthode est généralement "
2016-10-30 09:46:26 +00:00
"utilisée avec des caractères ASCII. En cas d'omission ou ``None``, les "
"espaces ASCII sont supprimés. L'argument *chars* n'est ni un préfixe ni un "
"suffixe, toutes les combinaisons de ses valeurs sont supprimées ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3144
2020-07-20 08:56:42 +00:00
msgid ""
"The binary sequence of byte values to remove may be any :term:`bytes-like "
"object`."
msgstr "Les octets à retirer peuvent être tout :term:`bytes-like object`."
2020-07-20 08:56:42 +00:00
#: library/stdtypes.rst:3153
2016-10-30 09:46:26 +00:00
msgid ""
"The following methods on bytes and bytearray objects assume the use of ASCII "
"compatible binary formats and should not be applied to arbitrary binary "
"data. Note that all of the bytearray methods in this section do *not* "
"operate in place, and instead produce new objects."
msgstr ""
"Les méthodes suivantes sur les *bytes* et *bytearray* supposent "
"l'utilisation d'un format binaire compatible ASCII, et donc doivent être "
"évités lorsque vous travaillez avec des données binaires arbitraires. Notez "
"que toutes les méthodes de *bytearray* de cette section *ne modifient pas* "
"les octets, ils produisent de nouveaux objets."
#: library/stdtypes.rst:3161
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the sequence with each byte interpreted as an ASCII "
"character, and the first byte capitalized and the rest lowercased. Non-ASCII "
"byte values are passed through unchanged."
msgstr ""
"Renvoie une copie de la séquence dont chaque octet est interprété comme un "
"caractère ASCII, le premier octet en capitale et le reste en minuscules. Les "
"octets non ASCII ne sont pas modifiés."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3174
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the sequence where all ASCII tab characters are replaced by "
"one or more ASCII spaces, depending on the current column and the given tab "
"size. Tab positions occur every *tabsize* bytes (default is 8, giving tab "
"positions at columns 0, 8, 16 and so on). To expand the sequence, the "
"current column is set to zero and the sequence is examined byte by byte. If "
"the byte is an ASCII tab character (``b'\\t'``), one or more space "
"characters are inserted in the result until the current column is equal to "
"the next tab position. (The tab character itself is not copied.) If the "
"current byte is an ASCII newline (``b'\\n'``) or carriage return "
"(``b'\\r'``), it is copied and the current column is reset to zero. Any "
"other byte value is copied unchanged and the current column is incremented "
"by one regardless of how the byte value is represented when printed::"
msgstr ""
"Renvoie une copie de la séquence où toutes les tabulations ASCII sont "
"remplacées par un ou plusieurs espaces ASCII, en fonction de la colonne "
"courante et de la taille de tabulation donnée. Les positions des tabulations "
"se trouvent tous les *tabsize* caractères (8 par défaut, ce qui donne les "
"positions de tabulations aux colonnes 0, 8, 16 et ainsi de suite). Pour "
"travailler sur la séquence, la colonne en cours est mise à zéro et la "
"séquence est examinée octets par octets. Si l'octet est une tabulation ASCII "
2022-10-18 10:38:19 +00:00
"(``b'\\t'``), un ou plusieurs espaces sont insérés au résultat jusquà ce "
"que la colonne courante soit égale à la position de tabulation suivante. (Le "
2016-10-30 09:46:26 +00:00
"caractère tabulation lui-même nest pas copié.) Si l'octet courant est un "
2022-10-18 10:38:19 +00:00
"saut de ligne ASCII (``b'\\n'``) ou un retour chariot (``b'\\r'``), il est "
"copié et la colonne en cours est remise à zéro. Tout autre octet est copié "
"inchangé et la colonne en cours est incrémentée de un indépendamment de la "
"façon dont l'octet est représenté lors de laffichage ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3202
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if all bytes in the sequence are alphabetical ASCII "
"characters or ASCII decimal digits and the sequence is not empty, ``False`` "
"otherwise. Alphabetic ASCII characters are those byte values in the sequence "
2016-10-30 09:46:26 +00:00
"``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``. ASCII decimal "
"digits are those byte values in the sequence ``b'0123456789'``."
msgstr ""
"Renvoie ``True`` si tous les caractères de la chaîne sont des caractères "
"ASCII alphabétiques ou chiffres et que la séquence n'est pas vide, sinon "
"``False``. Les caractères ASCII alphabétiques sont les suivants dans la "
"séquence d'octets "
2016-10-30 09:46:26 +00:00
"``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'`` et les "
"chiffres : ``b'0123456789'``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3219
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if all bytes in the sequence are alphabetic ASCII characters "
"and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII "
"characters are those byte values in the sequence "
2016-10-30 09:46:26 +00:00
"``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``."
msgstr ""
"Renvoie ``True`` si tous les octets dans la séquence sont des caractères "
"alphabétiques ASCII et que la séquence n'est pas vide, sinon ``False``. Les "
"caractères ASCII alphabétiques sont : "
2016-10-30 09:46:26 +00:00
"``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``."
#: library/stdtypes.rst:3235
2018-06-28 13:32:56 +00:00
msgid ""
"Return ``True`` if the sequence is empty or all bytes in the sequence are "
"ASCII, ``False`` otherwise. ASCII bytes are in the range 0-0x7F."
2018-06-28 13:32:56 +00:00
msgstr ""
2018-07-27 07:25:53 +00:00
"Renvoie ``True`` si la séquence est vide, ou si tous ses octets sont des "
"octets ASCII, renvoie ``False`` dans le cas contraire. Les octets ASCII dans "
"l'intervalle ``0````0x7F``."
2018-06-28 13:32:56 +00:00
#: library/stdtypes.rst:3245
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if all bytes in the sequence are ASCII decimal digits and "
"the sequence is not empty, ``False`` otherwise. ASCII decimal digits are "
"those byte values in the sequence ``b'0123456789'``."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie ``True`` si tous les octets de la séquence sont des chiffres ASCII "
"et que la séquence n'est pas vide, sinon ``False``. Les chiffres ASCII sont "
"ceux dans la séquence d'octets ``b'0123456789'``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3260
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if there is at least one lowercase ASCII character in the "
"sequence and no uppercase ASCII characters, ``False`` otherwise."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie ``True`` s'il y a au moins un caractère ASCII minuscule dans la "
2016-10-30 09:46:26 +00:00
"séquence et aucune capitale, sinon ``False``."
#: library/stdtypes.rst:3312 library/stdtypes.rst:3378
#: library/stdtypes.rst:3447
2016-10-30 09:46:26 +00:00
msgid ""
"Lowercase ASCII characters are those byte values in the sequence "
"``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte "
"values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``."
msgstr ""
"Les caractères ASCII minuscules sont ``b'abcdefghijklmnopqrstuvwxyz'``. Les "
2016-10-30 09:46:26 +00:00
"capitales ASCII sont ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``."
#: library/stdtypes.rst:3278
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if all bytes in the sequence are ASCII whitespace and the "
"sequence is not empty, ``False`` otherwise. ASCII whitespace characters are "
2016-10-30 09:46:26 +00:00
"those byte values in the sequence ``b' \\t\\n\\r\\x0b\\f'`` (space, tab, "
"newline, carriage return, vertical tab, form feed)."
msgstr ""
"Renvoie ``True`` si tous les octets de la séquence sont des espaces ASCII et "
2016-10-30 09:46:26 +00:00
"que la séquence n'est pas vide, sinon ``False``. Les espèces ASCII sont ``b' "
"\\t\\n\\r\\x0b\\f'`` (espace, tabulation, saut de ligne, retour chariot, "
"tabulation verticale, saut de page)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3287
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if the sequence is ASCII titlecase and the sequence is not "
"empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the "
2016-10-30 09:46:26 +00:00
"definition of \"titlecase\"."
msgstr ""
"Renvoie ``True`` si la séquence ASCII est *titlecased*, et qu'elle n'est pas "
"vide, sinon ``False``. Voir :meth:`bytes.title` pour plus de détails sur la "
"définition de *titlecase*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3302
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if there is at least one uppercase alphabetic ASCII "
"character in the sequence and no lowercase ASCII characters, ``False`` "
"otherwise."
2016-10-30 09:46:26 +00:00
msgstr ""
"Renvoie ``True`` s'il y a au moins un caractère alphabétique majuscule ASCII "
"dans la séquence et aucun caractère ASCII minuscule, sinon ``False``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3320
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the sequence with all the uppercase ASCII characters "
"converted to their corresponding lowercase counterpart."
msgstr ""
"Renvoie une copie de la séquence dont tous les caractères ASCII en "
"majuscules sont convertis en leur équivalent en minuscules."
#: library/stdtypes.rst:3345
2016-10-30 09:46:26 +00:00
msgid ""
"Return a list of the lines in the binary sequence, breaking at ASCII line "
"boundaries. This method uses the :term:`universal newlines` approach to "
"splitting lines. Line breaks are not included in the resulting list unless "
"*keepends* is given and true."
msgstr ""
"Renvoie une liste des lignes de la séquence d'octets, découpant au niveau "
"des fin de lignes ASCII. Cette méthode utilise l'approche :term:`universal "
"newlines` pour découper les lignes. Les fins de ligne ne sont pas inclus "
"dans la liste des résultats, sauf si *keepends* est donné et vrai."
#: library/stdtypes.rst:3357
2016-10-30 09:46:26 +00:00
msgid ""
"Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this "
"method returns an empty list for the empty string, and a terminal line break "
"does not result in an extra line::"
msgstr ""
"Contrairement à :meth:`~bytes.split` lorsque le délimiteur *sep* est fourni, "
"cette méthode renvoie une liste vide pour la chaîne vide, et un saut de "
"ligne à la fin ne se traduit pas par une ligne supplémentaire ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3370
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the sequence with all the lowercase ASCII characters "
"converted to their corresponding uppercase counterpart and vice-versa."
msgstr ""
"Renvoie une copie de la séquence dont tous les caractères ASCII minuscules "
"sont convertis en majuscules et vice-versa."
#: library/stdtypes.rst:3382
2016-10-30 09:46:26 +00:00
msgid ""
"Unlike :func:`str.swapcase()`, it is always the case that ``bin.swapcase()."
"swapcase() == bin`` for the binary versions. Case conversions are "
"symmetrical in ASCII, even though that is not generally true for arbitrary "
"Unicode code points."
msgstr ""
"Contrairement à :func:`str.swapcase()`, ``bin.swapcase().swapcase() == "
"bin`` est toujours vrai. Les conversions majuscule/minuscule en ASCII étant "
"toujours symétrique, ce qui n'est pas toujours vrai avec Unicode."
#: library/stdtypes.rst:3396
2016-10-30 09:46:26 +00:00
msgid ""
"Return a titlecased version of the binary sequence where words start with an "
"uppercase ASCII character and the remaining characters are lowercase. "
"Uncased byte values are left unmodified."
msgstr ""
"Renvoie une version *titlecased* de la séquence d'octets où les mots "
"commencent par un caractère ASCII majuscule et les caractères restants sont "
"en minuscules. Les octets non capitalisables ne sont pas modifiés."
#: library/stdtypes.rst:3405
2016-10-30 09:46:26 +00:00
msgid ""
"Lowercase ASCII characters are those byte values in the sequence "
"``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte "
"values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. All other byte "
"values are uncased."
msgstr ""
"Les caractères ASCII minuscules sont ``b'abcdefghijklmnopqrstuvwxyz'``. Les "
"caractères ASCII majuscules sont ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``. Aucun "
"autre octet n'est capitalisable."
#: library/stdtypes.rst:3418
2022-05-22 21:15:02 +00:00
msgid ""
"A workaround for apostrophes can be constructed using regular expressions::"
msgstr ""
"Une solution pour contourner le problème des apostrophes peut être obtenue "
"en utilisant des expressions rationnelles ::"
#: library/stdtypes.rst:3439
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the sequence with all the lowercase ASCII characters "
"converted to their corresponding uppercase counterpart."
msgstr ""
"Renvoie une copie de la séquence dont tous les caractères ASCII minuscules "
"sont convertis en leur équivalent majuscule."
#: library/stdtypes.rst:3460
2016-10-30 09:46:26 +00:00
msgid ""
"Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make "
2018-12-24 13:20:55 +00:00
"a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is "
2016-10-30 09:46:26 +00:00
"handled by inserting the padding *after* the sign character rather than "
"before. For :class:`bytes` objects, the original sequence is returned if "
"*width* is less than or equal to ``len(seq)``."
msgstr ""
"Renvoie une copie de la séquence remplie par la gauche du chiffre ``b'0'`` "
"pour en faire une séquence de longueur *width*. Un préfixe (``b'+'`` / "
"``b'-'``) est permis par l'insertion du caractère de remplissage *après* le "
"caractère de signe plutôt qu'avant. Pour les objets :class:`bytes` la "
"séquence d'origine est renvoyée si *width* est inférieur ou égale à "
"``len(seq)``."
#: library/stdtypes.rst:3482
2016-10-30 09:46:26 +00:00
msgid "``printf``-style Bytes Formatting"
msgstr "Formatage de *bytes* a la ``printf``"
#: library/stdtypes.rst:3499
2016-10-30 09:46:26 +00:00
msgid ""
"The formatting operations described here exhibit a variety of quirks that "
"lead to a number of common errors (such as failing to display tuples and "
"dictionaries correctly). If the value being printed may be a tuple or "
"dictionary, wrap it in a tuple."
msgstr ""
"Les opérations de formatage décrites ici présentent une variété de "
"bizarreries qui conduisent à un certain nombre derreurs classiques "
"(typiquement, échouer à afficher des *n*-uplets ou des dictionnaires "
"correctement). Si la valeur à afficher peut être un *n*-uplet ou un "
"dictionnaire, mettez-le à l'intérieur d'un autre *n*-uplet."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3504
2016-10-30 09:46:26 +00:00
msgid ""
"Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: "
"the ``%`` operator (modulo). This is also known as the bytes *formatting* or "
"*interpolation* operator. Given ``format % values`` (where *format* is a "
"bytes object), ``%`` conversion specifications in *format* are replaced with "
"zero or more elements of *values*. The effect is similar to using the :c:"
"func:`sprintf` in the C language."
msgstr ""
2017-05-15 11:29:27 +00:00
"Les objets *bytes* (``bytes`` et ``bytearray``) ont un unique opérateur : "
"l'opérateur ``%`` (modulo). Il est aussi connu sous le nom d'opérateur de "
"mise en forme. Avec ``format % values`` (où *format* est un objet *bytes*), "
"les marqueurs de conversion ``%`` dans *format* sont remplacés par zéro ou "
"plus de *values*. L'effet est similaire à la fonction :c:func:`sprintf` du "
"langage C."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3511
2016-10-30 09:46:26 +00:00
msgid ""
"If *format* requires a single argument, *values* may be a single non-tuple "
"object. [5]_ Otherwise, *values* must be a tuple with exactly the number of "
"items specified by the format bytes object, or a single mapping object (for "
"example, a dictionary)."
msgstr ""
"Si *format* ne nécessite qu'un seul argument, *values* peut être un objet "
"unique. [5]_ Si *values* est un *n*-uplet, il doit contenir exactement le "
"nombre d'éléments spécifiés dans le format en *bytes*, ou un seul objet de "
2016-10-30 09:46:26 +00:00
"correspondances ( *mapping object*, par exemple, un dictionnaire)."
#: library/stdtypes.rst:3545
2016-10-30 09:46:26 +00:00
msgid ""
"When the right argument is a dictionary (or other mapping type), then the "
"formats in the bytes object *must* include a parenthesised mapping key into "
"that dictionary inserted immediately after the ``'%'`` character. The "
"mapping key selects the value to be formatted from the mapping. For example:"
msgstr ""
"Lorsque l'argument de droite est un dictionnaire (ou un autre type de "
"*mapping*), les marqueurs dans le *bytes* *doivent* inclure une clé présente "
"dans le dictionnaire, écrite entre parenthèses, immédiatement après le "
"caractère ``'%'``. La clé indique quelle valeur du dictionnaire doit être "
"formatée. Par exemple :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3619
2016-10-30 09:46:26 +00:00
msgid "Single byte (accepts integer or single byte objects)."
2017-05-15 11:29:27 +00:00
msgstr "Octet simple (Accepte un nombre entier ou un seul objet *byte*)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3622
2016-10-30 09:46:26 +00:00
msgid "``'b'``"
msgstr "``'b'``"
#: library/stdtypes.rst:3622
2016-10-30 09:46:26 +00:00
msgid ""
"Bytes (any object that follows the :ref:`buffer protocol <bufferobjects>` or "
"has :meth:`__bytes__`)."
msgstr ""
2017-05-15 11:29:27 +00:00
"*Bytes* (tout objet respectant le :ref:`buffer protocol <bufferobjects>` ou "
"ayant la méthode :meth:`__bytes__`)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3626
2016-10-30 09:46:26 +00:00
msgid ""
"``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code "
"bases."
msgstr ""
2017-05-15 11:29:27 +00:00
"``'s'`` est un alias de ``'b'`` et ne devrait être utilisé que pour du code "
"Python2/3."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3629
2016-10-30 09:46:26 +00:00
msgid ""
2022-05-22 21:15:02 +00:00
"Bytes (converts any Python object using ``repr(obj).encode('ascii', "
"'backslashreplace')``)."
2016-10-30 09:46:26 +00:00
msgstr ""
"*Bytes* (convertit n'importe quel objet Python en utilisant ``repr(obj)."
2017-05-15 11:29:27 +00:00
"encode('ascii', 'backslashreplace)``)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3632
2016-10-30 09:46:26 +00:00
msgid ""
"``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code "
"bases."
msgstr ""
2017-05-15 11:29:27 +00:00
"``'r'`` est un alias de ``'a'`` et ne devrait être utilise que dans du code "
"Python2/3."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3632
2017-04-02 20:14:06 +00:00
msgid "\\(7)"
msgstr "\\(7)"
#: library/stdtypes.rst:3667
2016-10-30 09:46:26 +00:00
msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series."
2018-06-10 22:04:53 +00:00
msgstr "``b'%s'`` est obsolète, mais ne sera pas retiré des version 3.x."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3670
2016-10-30 09:46:26 +00:00
msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series."
2018-06-10 22:04:53 +00:00
msgstr "``b'%r'`` est obsolète mais ne sera pas retiré dans Python 3.x."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3682
2018-06-17 08:43:33 +00:00
msgid ":pep:`461` - Adding % formatting to bytes and bytearray"
msgstr ":pep:`461` -- Ajout du formatage via % aux *bytes* et *bytesarray*"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3689
2016-10-30 09:46:26 +00:00
msgid "Memory Views"
msgstr "Vues de mémoires"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3691
2016-10-30 09:46:26 +00:00
msgid ""
":class:`memoryview` objects allow Python code to access the internal data of "
"an object that supports the :ref:`buffer protocol <bufferobjects>` without "
"copying."
msgstr ""
"Les :class:`vues mémoire <memoryview>` permettent à du code Python d'accéder "
"sans copie aux données internes d'un objet prenant en charge le :ref:"
"`protocole tampon <bufferobjects>`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3697
2016-10-30 09:46:26 +00:00
msgid ""
2021-06-04 11:47:25 +00:00
"Create a :class:`memoryview` that references *object*. *object* must "
"support the buffer protocol. Built-in objects that support the buffer "
"protocol include :class:`bytes` and :class:`bytearray`."
2016-10-30 09:46:26 +00:00
msgstr ""
"Crée une :class:`vue mémoire <memoryview>` faisant référence à *object*. "
"*object* doit savoir gérer le protocole tampon. :class:`bytes` et :class:"
"`bytearray` sont des classes natives prenant en charge le protocole tampon."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3701
2016-10-30 09:46:26 +00:00
msgid ""
"A :class:`memoryview` has the notion of an *element*, which is the atomic "
2021-06-04 11:47:25 +00:00
"memory unit handled by the originating *object*. For many simple types such "
"as :class:`bytes` and :class:`bytearray`, an element is a single byte, but "
"other types such as :class:`array.array` may have bigger elements."
2016-10-30 09:46:26 +00:00
msgstr ""
"Une :class:`vue mémoire <memoryview>` a la notion d'*élement*, qui est "
"l'unité de mémoire atomique gérée par l'objet *object* d'origine. Pour de "
"nombreux types simples comme :class:`bytes` et :class:`bytearray`, l'élément "
"est l'octet, mais pour d'autres types tels que :class:`array.array` les "
"éléments peuvent être plus grands."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3706
2016-10-30 09:46:26 +00:00
msgid ""
"``len(view)`` is equal to the length of :class:`~memoryview.tolist`. If "
"``view.ndim = 0``, the length is 1. If ``view.ndim = 1``, the length is "
"equal to the number of elements in the view. For higher dimensions, the "
"length is equal to the length of the nested list representation of the view. "
"The :class:`~memoryview.itemsize` attribute will give you the number of "
"bytes in a single element."
msgstr ""
"``len(view)`` est égal à la grandeur de :class:`~memoryview.tolist`. Si "
"``view.ndim = 0``, la longueur vaut 1. Si ``view.ndim = 1``, la longueur est "
"égale au nombre d'éléments de la vue. Pour les dimensions plus grandes, la "
"longueur est égale à la longueur de la sous-liste représentée par la vue. "
"L'attribut :class:`~memoryview.itemsize` vous renvoie la taille en octets "
"d'un élément."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3713
2016-10-30 09:46:26 +00:00
msgid ""
"A :class:`memoryview` supports slicing and indexing to expose its data. One-"
"dimensional slicing will result in a subview::"
msgstr ""
"Une :class:`vue mémoire <memoryview>` autorise le découpage et l'indiçage de "
"ses données. Découper sur une dimension donne une sous-vue ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3726
2016-10-30 09:46:26 +00:00
msgid ""
"If :class:`~memoryview.format` is one of the native format specifiers from "
"the :mod:`struct` module, indexing with an integer or a tuple of integers is "
"also supported and returns a single *element* with the correct type. One-"
"dimensional memoryviews can be indexed with an integer or a one-integer "
"tuple. Multi-dimensional memoryviews can be indexed with tuples of exactly "
"*ndim* integers where *ndim* is the number of dimensions. Zero-dimensional "
"memoryviews can be indexed with the empty tuple."
msgstr ""
"Si le :class:`~memoryview.format` est un des formats natif du module :mod:"
"`struct`, indexer avec un nombre entier ou un *n*-uplet de nombres entiers "
"est aussi autorisé et renvoie un seul *element* du bon type. Les "
"*memoryview* à une dimension peuvent être indexées avec un nombre entier ou "
"un *n*-uplet d'un entier. Les *memoryview* multi-dimensionnelles peuvent "
"être indexées avec des *ndim*-uplets où *ndim* est le nombre de dimensions. "
"Les *memoryviews* à zéro dimension peuvent être indexées avec un *n*-uplet "
"vide."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3735
2016-10-30 09:46:26 +00:00
msgid "Here is an example with a non-byte format::"
msgstr "Voici un exemple avec un autre format que *byte* ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3747
2016-10-30 09:46:26 +00:00
msgid ""
"If the underlying object is writable, the memoryview supports one-"
"dimensional slice assignment. Resizing is not allowed::"
msgstr ""
"Si l'objet sous-jacent est accessible en écriture, la vue mémoire autorise "
"les assignations de tranches à une dimension. Redimensionner n'est cependant "
"pas autorisé ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3768
2016-10-30 09:46:26 +00:00
msgid ""
"One-dimensional memoryviews of hashable (read-only) types with formats 'B', "
"'b' or 'c' are also hashable. The hash is defined as ``hash(m) == hash(m."
"tobytes())``::"
msgstr ""
"Les vues mémoire à une dimension de types hachables (lecture seule) avec les "
"formats 'B', 'b', ou 'c' sont aussi hachables. La fonction de hachage est "
"définie tel que ``hash(m) == hash(m.tobytes())`` ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3780
2016-10-30 09:46:26 +00:00
msgid ""
"One-dimensional memoryviews can now be sliced. One-dimensional memoryviews "
"with formats 'B', 'b' or 'c' are now hashable."
msgstr ""
"Les vues mémoire à une dimension peuvent aussi être découpées. Les "
"*memoryviews* à une dimension avec les formats 'B', 'b', ou 'c' sont "
"maintenant hachables."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3784
2016-10-30 09:46:26 +00:00
msgid ""
"memoryview is now registered automatically with :class:`collections.abc."
"Sequence`"
msgstr ""
"*memoryview* est maintenant enregistrée automatiquement avec :class:"
"`collections.abc.Sequence`"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3788
2016-10-30 09:46:26 +00:00
msgid "memoryviews can now be indexed with tuple of integers."
msgstr ""
"les vues mémoire peuvent maintenant être indicées par un *n*-uplet d'entiers."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3791
2016-10-30 09:46:26 +00:00
msgid ":class:`memoryview` has several methods:"
msgstr "La :class:`memoryview` dispose de plusieurs méthodes :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3795
2016-10-30 09:46:26 +00:00
msgid ""
"A memoryview and a :pep:`3118` exporter are equal if their shapes are "
"equivalent and if all corresponding values are equal when the operands' "
"respective format codes are interpreted using :mod:`struct` syntax."
msgstr ""
"Une *memoryview* et un *exporter* de la :pep:`3118` sont égaux si leurs "
"formes sont équivalentes et si toutes les valeurs correspondantes sont "
"égales, le format respectifs des opérandes étant interprétés en utilisant la "
"syntaxe de :mod:`struct`."
#: library/stdtypes.rst:3799
2016-10-30 09:46:26 +00:00
msgid ""
"For the subset of :mod:`struct` format strings currently supported by :meth:"
"`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::"
msgstr ""
"Pour le sous-ensemble des formats de :mod:`struct` supportés par :meth:"
"`tolist`, ``v`` et ``w`` sont égaux si ``v.tolist() ==w.tolist()`` ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3818
2016-10-30 09:46:26 +00:00
msgid ""
"If either format string is not supported by the :mod:`struct` module, then "
"the objects will always compare as unequal (even if the format strings and "
"buffer contents are identical)::"
msgstr ""
"Si l'un des format n'est pas supporté par le module de :mod:`struct`, les "
"objets seront toujours considérés différents (même si les formats et les "
"valeurs contenues sont identiques) ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3834
2016-10-30 09:46:26 +00:00
msgid ""
"Note that, as with floating point numbers, ``v is w`` does *not* imply ``v "
"== w`` for memoryview objects."
msgstr ""
"Notez que pour les *memoryview*, comme pour les nombres à virgule flottante, "
"``v is w`` *n'implique pas* ``v == w``."
#: library/stdtypes.rst:3837
2016-10-30 09:46:26 +00:00
msgid ""
"Previous versions compared the raw memory disregarding the item format and "
"the logical array structure."
msgstr ""
"Les versions précédentes comparaient la mémoire brute sans tenir compte du "
"format de l'objet ni de sa structure logique."
#: library/stdtypes.rst:3843
2016-10-30 09:46:26 +00:00
msgid ""
"Return the data in the buffer as a bytestring. This is equivalent to "
"calling the :class:`bytes` constructor on the memoryview. ::"
msgstr ""
"Renvoie les données du *buffer* sous forme de *bytes*. Cela équivaut à "
"appeler le constructeur :class:`bytes` sur le *memoryview*. ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3852
2016-10-30 09:46:26 +00:00
msgid ""
"For non-contiguous arrays the result is equal to the flattened list "
"representation with all elements converted to bytes. :meth:`tobytes` "
"supports all format strings, including those that are not in :mod:`struct` "
"module syntax."
msgstr ""
"Pour les listes non contiguës le résultat est égal à la représentation en "
2016-10-30 09:46:26 +00:00
"liste aplatie dont tous les éléments sont convertis en octets. :meth:"
"`tobytes` supporte toutes les chaînes de format, y compris celles qui ne "
"sont pas connues du module :mod:`struct`."
#: library/stdtypes.rst:3857
2019-09-04 09:35:23 +00:00
msgid ""
2019-12-05 22:41:32 +00:00
"*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the "
2019-09-04 09:35:23 +00:00
"original array is converted to C or Fortran order. For contiguous views, 'A' "
"returns an exact copy of the physical memory. In particular, in-memory "
"Fortran order is preserved. For non-contiguous views, the data is converted "
"to C first. *order=None* is the same as *order='C'*."
msgstr ""
"*order* peut être ``'C'``, ``'F'`` ou ``'A'``. Lorsque *order* est ``'C'`` "
"ou ``'F'``, les données du tableau original sont converties en ordre C ou "
"Fortran. Pour les vues contiguës, ``'A'`` renvoie une copie exacte de la "
"mémoire physique. En particulier, l'ordre Fortran en mémoire est conservé. "
"Pour les vues non contiguës, les données sont d'abord converties en C. "
"``order=None`` est identique à ``order='C'``."
2019-09-04 09:35:23 +00:00
#: library/stdtypes.rst:3866
2016-10-30 09:46:26 +00:00
msgid ""
"Return a string object containing two hexadecimal digits for each byte in "
"the buffer. ::"
msgstr ""
"Renvoie une chaîne contenant deux chiffres hexadécimaux pour chaque octet de "
"la mémoire. ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3875
2020-05-24 14:31:50 +00:00
msgid ""
"Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional "
"*sep* and *bytes_per_sep* parameters to insert separators between bytes in "
"the hex output."
msgstr ""
"Similaire à :meth:`bytes.hex`, :meth:`memoryview.hex` prend désormais en "
"charge les paramètres optionnels *sep* et *bytes_per_sep* pour insérer des "
"séparateurs entre les octets dans la sortie hexadécimale."
2020-05-24 14:31:50 +00:00
#: library/stdtypes.rst:3882
2016-10-30 09:46:26 +00:00
msgid "Return the data in the buffer as a list of elements. ::"
msgstr ""
"Renvoie les données de la mémoire sous la forme d'une liste d'éléments. ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3892
2016-10-30 09:46:26 +00:00
msgid ""
":meth:`tolist` now supports all single character native formats in :mod:"
"`struct` module syntax as well as multi-dimensional representations."
msgstr ""
":meth:`tolist` prend désormais en charge tous les formats d'un caractère du "
"module :mod:`struct` ainsi que des représentations multidimensionnelles."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3899
2019-09-04 09:35:23 +00:00
msgid ""
"Return a readonly version of the memoryview object. The original memoryview "
"object is unchanged. ::"
msgstr ""
"Renvoie une version en lecture seule de l'objet *memoryview*. Cet objet "
"original *memoryview* est inchangé. ::"
2019-09-04 09:35:23 +00:00
#: library/stdtypes.rst:3918
2016-10-30 09:46:26 +00:00
msgid ""
"Release the underlying buffer exposed by the memoryview object. Many "
"objects take special actions when a view is held on them (for example, a :"
"class:`bytearray` would temporarily forbid resizing); therefore, calling "
"release() is handy to remove these restrictions (and free any dangling "
"resources) as soon as possible."
msgstr ""
"Libère le tampon sous-jacent exposé par l'objet *memoryview*. Beaucoup "
"d'objets prennent des initiatives particulières lorsqu'ils sont liés à une "
"vue (par exemple, un :class:`bytearray` refusera temporairement de se faire "
"redimensionner). Par conséquent, appeler *release()* peut être pratique pour "
"lever ces restrictions (et en libérer les ressources liées) aussi tôt que "
"possible."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3924
2016-10-30 09:46:26 +00:00
msgid ""
"After this method has been called, any further operation on the view raises "
"a :class:`ValueError` (except :meth:`release()` itself which can be called "
"multiple times)::"
msgstr ""
"Après le premier appel de cette méthode, toute nouvelle opération sur la "
"*view* lève une :class:`ValueError` (sauf :meth:`release()` elle-même qui "
"peut être appelée plusieurs fois) ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3935
2016-10-30 09:46:26 +00:00
msgid ""
"The context management protocol can be used for a similar effect, using the "
"``with`` statement::"
msgstr ""
"Le protocole de gestion de contexte peut être utilisé pour obtenir un effet "
"similaire, via l'instruction ``with`` ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3951
2016-10-30 09:46:26 +00:00
msgid ""
"Cast a memoryview to a new format or shape. *shape* defaults to "
"``[byte_length//new_itemsize]``, which means that the result view will be "
"one-dimensional. The return value is a new memoryview, but the buffer itself "
"is not copied. Supported casts are 1D -> C-:term:`contiguous` and C-"
"contiguous -> 1D."
msgstr ""
"Change le format ou la forme d'une *memoryview*. Par défaut *shape* vaut "
"``[byte_length//new_itemsize]``, ce qui signifie que la vue résultante "
"n'aura qu'une dimension. La valeur renvoyée est une nouvelle *memoryview*, "
"mais la mémoire elle-même n'est pas copiée. Les changements supportés sont "
"une dimension vers C-:term:`contiguous` et *C-contiguous* vers une dimension."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3957
2016-10-30 09:46:26 +00:00
msgid ""
"The destination format is restricted to a single element native format in :"
"mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or "
"'c'). The byte length of the result must be the same as the original length."
msgstr ""
"Le format de destination est limité à un seul élément natif de la syntaxe du "
"module :mod:`struct`. L'un des formats doit être un *byte* ('B', 'b', ou "
"'c'). La longueur du résultat en octets doit être la même que la longueur "
"initiale."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3962
2016-10-30 09:46:26 +00:00
msgid "Cast 1D/long to 1D/unsigned bytes::"
msgstr "Transforme *1D/long* en *1D/unsigned bytes* ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3985
2016-10-30 09:46:26 +00:00
msgid "Cast 1D/unsigned bytes to 1D/char::"
msgstr "Transforme *1D/unsigned bytes* en *1D/char* ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:3998
2016-10-30 09:46:26 +00:00
msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::"
msgstr "Transforme *1D/bytes* en *3D/ints* en *1D/signed char* ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4024
2019-09-04 09:35:23 +00:00
msgid "Cast 1D/unsigned long to 2D/unsigned long::"
msgstr "Transforme *1D/unsigned char* en *2D/unsigned long* ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4038
2016-10-30 09:46:26 +00:00
msgid "The source format is no longer restricted when casting to a byte view."
msgstr ""
"Le format de la source n'est plus restreint lors de la transformation vers "
"une vue d'octets."
#: library/stdtypes.rst:4041
2016-10-30 09:46:26 +00:00
msgid "There are also several readonly attributes available:"
msgstr "Plusieurs attributs en lecture seule sont également disponibles :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4045
2016-10-30 09:46:26 +00:00
msgid "The underlying object of the memoryview::"
msgstr "L'objet sous-jacent de la *memoryview* ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4056
2016-10-30 09:46:26 +00:00
msgid ""
"``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the "
"amount of space in bytes that the array would use in a contiguous "
2018-11-29 15:13:39 +00:00
"representation. It is not necessarily equal to ``len(m)``::"
2016-10-30 09:46:26 +00:00
msgstr ""
"``nbytes == product(shape) * itemsize == len(m.tobytes())``. Ceci est "
"l'espace que la liste utiliserait en octets, dans une représentation "
"contiguë. Ce n'est pas nécessairement égale à ``len(m)`` ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4075
2016-10-30 09:46:26 +00:00
msgid "Multi-dimensional arrays::"
msgstr "Tableaux multidimensionnels ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4092
2016-10-30 09:46:26 +00:00
msgid "A bool indicating whether the memory is read only."
msgstr "Un booléen indiquant si la mémoire est en lecture seule."
#: library/stdtypes.rst:4096
2016-10-30 09:46:26 +00:00
msgid ""
"A string containing the format (in :mod:`struct` module style) for each "
"element in the view. A memoryview can be created from exporters with "
"arbitrary format strings, but some methods (e.g. :meth:`tolist`) are "
"restricted to native single element formats."
msgstr ""
"Une chaîne contenant le format (dans le style de :mod:`struct`) pour chaque "
"élément de la vue. Une *memoryview* peut être crée depuis des exportateurs "
"de formats arbitraires, mais certaines méthodes (comme :meth:`tolist`) sont "
"limitées aux formats natifs à un seul élément."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4101
2016-10-30 09:46:26 +00:00
msgid ""
"format ``'B'`` is now handled according to the struct module syntax. This "
"means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``."
msgstr ""
"le format ``'B'`` est maintenant traité selon la syntaxe du module *struct*. "
"Cela signifie que ``memoryview(b'abc')[0] == b'abc'[0] == 97``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4107
2016-10-30 09:46:26 +00:00
msgid "The size in bytes of each element of the memoryview::"
msgstr "La taille en octets de chaque élément d'une *memoryview* ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4120
2016-10-30 09:46:26 +00:00
msgid ""
"An integer indicating how many dimensions of a multi-dimensional array the "
"memory represents."
msgstr ""
"Un nombre entier indiquant le nombre de dimensions d'un tableau multi-"
"dimensionnel représenté par la *memoryview*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4125
2016-10-30 09:46:26 +00:00
msgid ""
"A tuple of integers the length of :attr:`ndim` giving the shape of the "
"memory as an N-dimensional array."
msgstr ""
"Un *n*-uplet d'entiers de longueur :attr:`ndim` donnant la forme de la "
"*memoryview* sous forme d'un tableau à N dimensions."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4136
2016-10-30 09:46:26 +00:00
msgid "An empty tuple instead of ``None`` when ndim = 0."
msgstr "Un *n*-uplet vide au lieu de ``None`` lorsque *ndim = 0*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4133
2016-10-30 09:46:26 +00:00
msgid ""
"A tuple of integers the length of :attr:`ndim` giving the size in bytes to "
"access each element for each dimension of the array."
msgstr ""
"Un *n*-uplet d'entiers de longueur :attr:`ndim` donnant la taille en octets "
"permettant d'accéder à chaque dimensions du tableau."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4141
2016-10-30 09:46:26 +00:00
msgid "Used internally for PIL-style arrays. The value is informational only."
msgstr ""
"Détail de l'implémentation des *PIL-style arrays*. La valeur n'est donnée "
"qu'à titre d'information."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4145
2016-10-30 09:46:26 +00:00
msgid "A bool indicating whether the memory is C-:term:`contiguous`."
msgstr "Un booléen indiquant si la mémoire est C-:term:`contiguous`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4151
2016-10-30 09:46:26 +00:00
msgid "A bool indicating whether the memory is Fortran :term:`contiguous`."
msgstr "Un booléen indiquant si la mémoire est Fortran :term:`contiguous`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4157
2016-10-30 09:46:26 +00:00
msgid "A bool indicating whether the memory is :term:`contiguous`."
msgstr "Un booléen indiquant si la mémoire est :term:`contiguous`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4165
2016-10-30 09:46:26 +00:00
msgid "Set Types --- :class:`set`, :class:`frozenset`"
msgstr "Types d'ensembles — :class:`set`, :class:`frozenset`"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4169
2016-10-30 09:46:26 +00:00
msgid ""
"A :dfn:`set` object is an unordered collection of distinct :term:`hashable` "
"objects. Common uses include membership testing, removing duplicates from a "
"sequence, and computing mathematical operations such as intersection, union, "
"difference, and symmetric difference. (For other containers see the built-"
"in :class:`dict`, :class:`list`, and :class:`tuple` classes, and the :mod:"
"`collections` module.)"
msgstr ""
"Un objet :dfn:`set` est une collection non-triée d'objets :term:`hashable` "
"distincts. Les utilisations classiques sont le test d'appartenance, la "
"déduplication d'une séquence, ou le calcul d'opérations mathématiques telles "
"que l'intersection, l'union, la différence, ou la différence symétrique. "
"(Pour les autres conteneurs, voir les classes natives :class:`dict`, :class:"
"`list`, et :class:`tuple`, ainsi que le module :mod:`collections`.)"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4176
2016-10-30 09:46:26 +00:00
msgid ""
"Like other collections, sets support ``x in set``, ``len(set)``, and ``for x "
"in set``. Being an unordered collection, sets do not record element "
"position or order of insertion. Accordingly, sets do not support indexing, "
"slicing, or other sequence-like behavior."
msgstr ""
"Comme pour les autres collections, les ensembles supportent ``x in set``, "
"``len(set)``, et ``for x in set``. En tant que collection non-triée, les "
"ensembles n'enregistrent pas la position des éléments ou leur ordre "
"d'insertion. En conséquence, les *sets* n'autorisent ni l'indexation, ni le "
"découpage, ou tout autre comportement de séquence."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4181
2016-10-30 09:46:26 +00:00
msgid ""
"There are currently two built-in set types, :class:`set` and :class:"
"`frozenset`. The :class:`set` type is mutable --- the contents can be "
"changed using methods like :meth:`~set.add` and :meth:`~set.remove`. Since "
"it is mutable, it has no hash value and cannot be used as either a "
"dictionary key or as an element of another set. The :class:`frozenset` type "
"is immutable and :term:`hashable` --- its contents cannot be altered after "
"it is created; it can therefore be used as a dictionary key or as an element "
"of another set."
msgstr ""
2017-05-16 12:01:57 +00:00
"Il existe actuellement deux types natifs pour les ensembles, :class:`set` "
"et :class:`fronzenset`. Le type :class:`set` est muable — son contenu peut "
"changer en utilisant des méthodes comme :meth:`~set.add` et :meth:`~set."
"remove`. Puisqu'il est muable, il n'a pas de valeur de hachage et ne peut "
"donc pas être utilisé ni comme clé de dictionnaire ni comme élément d'un "
2017-05-16 12:01:57 +00:00
"autre ensemble. Le type :class:`frozenset` est immuable et :term:`hashable` "
"— son contenu ne peut être modifié après sa création, il peut ainsi être "
"utilisé comme clé de dictionnaire ou élément d'un autre *set*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4189
2016-10-30 09:46:26 +00:00
msgid ""
"Non-empty sets (not frozensets) can be created by placing a comma-separated "
"list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in "
"addition to the :class:`set` constructor."
msgstr ""
"Des *sets* (mais pas des *frozensets*) peuvent être créés par une liste "
"d'éléments séparés par des virgules et entre accolades, par exemple "
2017-05-16 22:07:16 +00:00
"``{'jack', 'sjoerd'}``, en plus du constructeur de la classe :class:`set`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4193
2016-10-30 09:46:26 +00:00
msgid "The constructors for both classes work the same:"
msgstr "Les constructeurs des deux classes fonctionnent de la même manière :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4198
2016-10-30 09:46:26 +00:00
msgid ""
"Return a new set or frozenset object whose elements are taken from "
"*iterable*. The elements of a set must be :term:`hashable`. To represent "
"sets of sets, the inner sets must be :class:`frozenset` objects. If "
"*iterable* is not specified, a new empty set is returned."
msgstr ""
2017-05-16 22:07:16 +00:00
"Renvoie un nouveau *set* ou *frozenset* dont les éléments viennent "
"d'*iterable*. Les éléments d'un *set* doivent être :term:`hachables "
"<hashable>`. Pour représenter des *sets* de *sets* les *sets* intérieurs "
"doivent être des :class:`frozenset`. Si *iterable* n'est pas spécifié, un "
"nouveau *set* vide est renvoyé."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4204
2020-12-18 06:09:57 +00:00
msgid "Sets can be created by several means:"
msgstr "Les ensembles peuvent être construits de différentes manières :"
2020-12-18 06:09:57 +00:00
# énumération
#: library/stdtypes.rst:4206
2020-12-18 06:09:57 +00:00
msgid ""
"Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``"
msgstr ""
"en utilisant une liste d'éléments séparés par des virgules entre accolades : "
"``{'jack', 'sjoerd'}`` ;"
2020-12-18 06:09:57 +00:00
# énumération
#: library/stdtypes.rst:4207
2020-12-18 06:09:57 +00:00
msgid ""
"Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``"
msgstr ""
"en utilisant un ensemble en compréhension : ``{c for c in 'abracadabra' if c "
"not in 'abc'}`` ;"
2020-12-18 06:09:57 +00:00
# énumération
#: library/stdtypes.rst:4208
2020-12-18 06:09:57 +00:00
msgid ""
"Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', "
"'foo'])``"
msgstr ""
"en utilisant le constructeur du type : ``set()``, ``set('foobar')``, "
"``set(['a', 'b', 'foo'])``."
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4210
2016-10-30 09:46:26 +00:00
msgid ""
"Instances of :class:`set` and :class:`frozenset` provide the following "
"operations:"
msgstr ""
2017-05-16 22:07:16 +00:00
"Les instances de :class:`set` et :class:`frozenset` fournissent les "
"opérations suivantes :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4215
2016-10-30 09:46:26 +00:00
msgid "Return the number of elements in set *s* (cardinality of *s*)."
msgstr "Renvoie le nombre d'éléments dans le *set* *s* (cardinalité de *s*)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4219
2016-10-30 09:46:26 +00:00
msgid "Test *x* for membership in *s*."
2017-05-16 22:07:16 +00:00
msgstr "Test d'appartenance de *x* dans *s*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4223
2016-10-30 09:46:26 +00:00
msgid "Test *x* for non-membership in *s*."
2017-05-16 22:07:16 +00:00
msgstr "Test de non-appartenance de *x* dans *s*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4227
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if the set has no elements in common with *other*. Sets are "
"disjoint if and only if their intersection is the empty set."
msgstr ""
2017-05-16 22:07:16 +00:00
"Renvoie ``True`` si l'ensemble n'a aucun élément en commun avec *other*. "
"Les ensembles sont disjoints si et seulement si leurs intersection est un "
"ensemble vide."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4233
2016-10-30 09:46:26 +00:00
msgid "Test whether every element in the set is in *other*."
2017-05-16 22:07:16 +00:00
msgstr "Teste si tous les éléments du set sont dans *other*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4237
2016-10-30 09:46:26 +00:00
msgid ""
"Test whether the set is a proper subset of *other*, that is, ``set <= other "
"and set != other``."
msgstr ""
2017-05-16 22:07:16 +00:00
"Teste si l'ensemble est un sous-ensemble de *other*, c'est-à-dire, ``set <= "
"other and set != other``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4243
2016-10-30 09:46:26 +00:00
msgid "Test whether every element in *other* is in the set."
2017-05-16 22:07:16 +00:00
msgstr "Teste si tous les éléments de *other* sont dans l'ensemble."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4247
2016-10-30 09:46:26 +00:00
msgid ""
"Test whether the set is a proper superset of *other*, that is, ``set >= "
"other and set != other``."
msgstr ""
2017-05-16 22:07:16 +00:00
"Teste si l'ensemble est un sur-ensemble de *other*, c'est-à-dire, ``set >= "
"other and set != other``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4253
2016-10-30 09:46:26 +00:00
msgid "Return a new set with elements from the set and all others."
msgstr ""
2017-05-16 22:07:16 +00:00
"Renvoie un nouvel ensemble dont les éléments viennent de l'ensemble et de "
"tous les autres."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4258
2016-10-30 09:46:26 +00:00
msgid "Return a new set with elements common to the set and all others."
msgstr ""
"Renvoie un nouvel ensemble dont les éléments sont communs à l'ensemble et à "
2017-05-16 22:07:16 +00:00
"tous les autres."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4263
2016-10-30 09:46:26 +00:00
msgid "Return a new set with elements in the set that are not in the others."
msgstr ""
2017-05-16 22:07:16 +00:00
"Renvoie un nouvel ensemble dont les éléments sont dans l'ensemble mais ne "
"sont dans aucun des autres."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4268
2016-10-30 09:46:26 +00:00
msgid ""
"Return a new set with elements in either the set or *other* but not both."
msgstr ""
2017-05-16 22:07:16 +00:00
"Renvoie un nouvel ensemble dont les éléments sont soit dans l'ensemble, soit "
"dans les autres, mais pas dans les deux."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4272
2019-03-20 08:41:37 +00:00
msgid "Return a shallow copy of the set."
msgstr "Renvoie une copie de surface du dictionnaire."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4275
2016-10-30 09:46:26 +00:00
msgid ""
"Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :"
"meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:"
"`issuperset` methods will accept any iterable as an argument. In contrast, "
"their operator based counterparts require their arguments to be sets. This "
"precludes error-prone constructions like ``set('abc') & 'cbs'`` in favor of "
"the more readable ``set('abc').intersection('cbs')``."
2016-10-30 09:46:26 +00:00
msgstr ""
"Remarque : les méthodes :meth:`union`, :meth:`intersection`, :meth:"
"`difference`, :meth:`symmetric_difference`, :meth:`issubset`, et :meth:"
"`issuperset` acceptent n'importe quel itérable comme argument, contrairement "
2017-05-25 14:24:27 +00:00
"aux opérateurs équivalents qui n'acceptent que des *sets*. Il est donc "
"préférable d'éviter les constructions comme ``set('abc') & 'cbs'``, sources "
"typiques d'erreurs, en faveur d'une construction plus lisible : ``set('abc')."
2017-05-25 14:24:27 +00:00
"intersection('cbs')``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4282
2016-10-30 09:46:26 +00:00
msgid ""
"Both :class:`set` and :class:`frozenset` support set to set comparisons. Two "
"sets are equal if and only if every element of each set is contained in the "
"other (each is a subset of the other). A set is less than another set if and "
"only if the first set is a proper subset of the second set (is a subset, but "
"is not equal). A set is greater than another set if and only if the first "
"set is a proper superset of the second set (is a superset, but is not equal)."
msgstr ""
"Les classes :class:`set` et :class:`frozenset` gèrent les comparaisons "
2017-05-28 21:45:20 +00:00
"d'ensemble à ensemble. Deux ensembles sont égaux si et seulement si chaque "
"éléments de chaque ensemble est contenu dans l'autre (autrement dit que "
"chaque ensemble est un sous-ensemble de l'autre). Un ensemble est plus petit "
"qu'un autre ensemble si et seulement si le premier est un sous-ensemble du "
"second (un sous-ensemble, mais pas égal). Un ensemble est plus grand qu'un "
"autre ensemble si et seulement si le premier est un sur-ensemble du second "
"(est un sur-ensemble mais n'est pas égal)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4289
2016-10-30 09:46:26 +00:00
msgid ""
"Instances of :class:`set` are compared to instances of :class:`frozenset` "
"based on their members. For example, ``set('abc') == frozenset('abc')`` "
"returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``."
msgstr ""
2017-05-28 21:45:20 +00:00
"Les instances de :class:`set` se comparent aux instances de :class:"
"`frozenset` en fonction de leurs membres. Par exemple, ``set('abc') == "
"frozenset('abc')`` envoie ``True``, ainsi que ``set('abc') in "
"set([frozenset('abc')])``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4293
2016-10-30 09:46:26 +00:00
msgid ""
"The subset and equality comparisons do not generalize to a total ordering "
"function. For example, any two nonempty disjoint sets are not equal and are "
"not subsets of each other, so *all* of the following return ``False``: "
"``a<b``, ``a==b``, or ``a>b``."
msgstr ""
2017-05-28 21:45:20 +00:00
"Les comparaisons de sous-ensemble et d'égalité ne se généralisent pas en une "
"fonction donnant un ordre total. Par exemple, deux ensemble disjoints non "
2017-05-28 21:45:20 +00:00
"vides ne sont ni égaux et ni des sous-ensembles l'un de l'autre, donc toutes "
"ces comparaisons donnent ``False`` : ``a<b``, ``a==b``, et ``a>b``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4298
2016-10-30 09:46:26 +00:00
msgid ""
"Since sets only define partial ordering (subset relationships), the output "
"of the :meth:`list.sort` method is undefined for lists of sets."
msgstr ""
2017-05-28 21:45:20 +00:00
"Puisque les *sets* ne définissent qu'un ordre partiel (par leurs relations "
"de sous-ensembles), la sortie de la méthode :meth:`list.sort` n'est pas "
"définie pour des listes d'ensembles."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4301
2016-10-30 09:46:26 +00:00
msgid "Set elements, like dictionary keys, must be :term:`hashable`."
msgstr ""
"Les éléments des *sets*, comme les clés de dictionnaires, doivent être :term:"
"`hachables <hashable>`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4303
2016-10-30 09:46:26 +00:00
msgid ""
"Binary operations that mix :class:`set` instances with :class:`frozenset` "
"return the type of the first operand. For example: ``frozenset('ab') | "
"set('bc')`` returns an instance of :class:`frozenset`."
msgstr ""
2017-05-28 21:45:20 +00:00
"Les opérations binaires mélangeant des instances de :class:`set` et :class:"
"`frozenset` renvoient le type de la première opérande. Par exemple, "
2017-05-28 21:45:20 +00:00
"``frozenset('ab') | set('bc')`` renvoie une instance de :class:`frozenset`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4307
2016-10-30 09:46:26 +00:00
msgid ""
"The following table lists operations available for :class:`set` that do not "
"apply to immutable instances of :class:`frozenset`:"
msgstr ""
2017-05-28 21:45:20 +00:00
"La table suivante liste les opérations disponibles pour les :class:`set` "
"mais qui ne s'appliquent pas aux instances de :class:`frozenset` :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4313
2016-10-30 09:46:26 +00:00
msgid "Update the set, adding elements from all others."
2017-05-28 21:45:20 +00:00
msgstr "Met à jour l'ensemble, ajoutant les éléments de tous les autres."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4318
2016-10-30 09:46:26 +00:00
msgid "Update the set, keeping only elements found in it and all others."
msgstr ""
2017-05-28 21:45:20 +00:00
"Met à jour l'ensemble, ne gardant que les éléments trouvés dans tous les "
"autres."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4323
2016-10-30 09:46:26 +00:00
msgid "Update the set, removing elements found in others."
2017-05-28 21:45:20 +00:00
msgstr "Met à jour l'ensemble, retirant les éléments trouvés dans les autres."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4328
2016-10-30 09:46:26 +00:00
msgid ""
"Update the set, keeping only elements found in either set, but not in both."
msgstr ""
2017-05-28 21:45:20 +00:00
"Met à jour le set, ne gardant que les éléments trouvés dans un des ensembles "
"mais pas dans les deux."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4332
2016-10-30 09:46:26 +00:00
msgid "Add element *elem* to the set."
2017-05-28 21:45:20 +00:00
msgstr "Ajoute l'élément *elem* au set."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4336
2016-10-30 09:46:26 +00:00
msgid ""
"Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not "
"contained in the set."
msgstr ""
2017-05-28 21:45:20 +00:00
"Retire l'élément *elem* de l'ensemble. Lève une exception :exc:`KeyError` si "
"*elem* n'est pas dans l'ensemble."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4341
2016-10-30 09:46:26 +00:00
msgid "Remove element *elem* from the set if it is present."
2017-05-28 21:45:20 +00:00
msgstr "Retire l'élément *elem* de l'ensemble s'il y est."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4345
2016-10-30 09:46:26 +00:00
msgid ""
"Remove and return an arbitrary element from the set. Raises :exc:`KeyError` "
"if the set is empty."
msgstr ""
2017-05-28 21:45:20 +00:00
"Retire et renvoie un élément arbitraire de l'ensemble. Lève une exception :"
"exc:`KeyError` si l'ensemble est vide."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4350
2016-10-30 09:46:26 +00:00
msgid "Remove all elements from the set."
2017-05-28 21:45:20 +00:00
msgstr "Supprime tous les éléments du *set*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4353
2016-10-30 09:46:26 +00:00
msgid ""
"Note, the non-operator versions of the :meth:`update`, :meth:"
"`intersection_update`, :meth:`difference_update`, and :meth:"
"`symmetric_difference_update` methods will accept any iterable as an "
"argument."
msgstr ""
2017-05-28 21:45:20 +00:00
"Notez que les versions non-opérateurs des méthodes :meth:`update`, :meth:"
"`intersection_update`, :meth:`difference_update`, et :meth:"
"`symmetric_difference_update` acceptent n'importe quel itérable comme "
"argument."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4358
2016-10-30 09:46:26 +00:00
msgid ""
"Note, the *elem* argument to the :meth:`__contains__`, :meth:`remove`, and :"
"meth:`discard` methods may be a set. To support searching for an equivalent "
2017-08-01 11:29:09 +00:00
"frozenset, a temporary one is created from *elem*."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-05-28 21:45:20 +00:00
"Notez que l'argument *elem* des méthodes :meth:`__contains__`, :meth:"
2017-08-01 12:16:10 +00:00
"`remove`, et :meth:`discard` peut être un ensemble. Pour supporter la "
"recherche d'un *frozenset* équivalent, un *frozenset* temporaire est crée "
"depuis *elem*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4366
2016-10-30 09:46:26 +00:00
msgid "Mapping Types --- :class:`dict`"
msgstr "Les types de correspondances — :class:`dict`"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4376
2016-10-30 09:46:26 +00:00
msgid ""
"A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. "
"Mappings are mutable objects. There is currently only one standard mapping "
"type, the :dfn:`dictionary`. (For other containers see the built-in :class:"
"`list`, :class:`set`, and :class:`tuple` classes, and the :mod:`collections` "
"module.)"
msgstr ""
2017-05-27 21:39:44 +00:00
"Un objet :term:`mapping` fait correspondre des valeurs :term:`hashable` à "
"des objets arbitraires. Les *mappings* sont des objets muables. Il n'existe "
"pour le moment qu'un type de *mapping* standard, le :dfn:`dictionary`. "
"(Pour les autres conteneurs, voir les types natifs :class:`list`, :class:"
"`set`, et :class:`tuple`, ainsi que le module :mod:`collections`.)"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4382
2016-10-30 09:46:26 +00:00
msgid ""
"A dictionary's keys are *almost* arbitrary values. Values that are not :"
"term:`hashable`, that is, values containing lists, dictionaries or other "
"mutable types (that are compared by value rather than by object identity) "
"may not be used as keys. Values that compare equal (such as ``1``, ``1.0``, "
"and ``True``) can be used interchangeably to index the same dictionary entry."
2016-10-30 09:46:26 +00:00
msgstr ""
"Les clés d'un dictionnaire sont *presque* des données arbitraires. Les "
"valeurs qui ne sont pas :term:`hachables <hashable>`, c'est-à-dire les "
"valeurs contenant des listes, dictionnaires ou autres types muables (qui "
"sont comparés à l'aide de leurs valeurs plutôt que par l'identité de "
"l'objet) ne peuvent pas être utilisées comme clés. Des valeurs qui sont "
"considérées égales lors d'une comparaison (comme ``1``, ``1.0`` et ``True``) "
"ils peuvent être utilisées pour obtenir la même entrée d'un dictionnaire."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4393
2016-10-30 09:46:26 +00:00
msgid ""
"Return a new dictionary initialized from an optional positional argument and "
"a possibly empty set of keyword arguments."
msgstr ""
"Renvoie un nouveau dictionnaire initialisé à partir d'un argument "
"positionnel optionnel, et un ensemble (vide ou non) d'arguments nommés."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4396
2020-12-18 06:09:57 +00:00
msgid "Dictionaries can be created by several means:"
msgstr "Les dictionnaires peuvent être construits de différentes manières :"
2020-12-18 06:09:57 +00:00
# énumération
#: library/stdtypes.rst:4398
2020-12-18 06:09:57 +00:00
msgid ""
"Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': "
"4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``"
msgstr ""
"en utilisant une liste de paires ``clé: valeur`` séparées par des virgules "
"entre accolades : ``{'jack': 4098, 'sjoerd': 4127}`` ou ``{4098: 'jack', "
"4127: 'sjoerd'}`` ;"
2020-12-18 06:09:57 +00:00
# énumération
#: library/stdtypes.rst:4400
2020-12-18 06:09:57 +00:00
msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``"
msgstr ""
"en utilisant un dictionnaire en compréhension : ``{}``, ``{x: x ** 2 for x "
"in range(10)}`` ;"
2020-12-18 06:09:57 +00:00
# fin d'énumération
#: library/stdtypes.rst:4401
2020-12-18 06:09:57 +00:00
msgid ""
"Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', "
"200)])``, ``dict(foo=100, bar=200)``"
msgstr ""
"en utilisant le constructeur du type : ``dict()``, ``dict([('foo', 100), "
"('bar', 200)])``, ``dict(foo=100, bar=200)``."
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4404
2016-10-30 09:46:26 +00:00
msgid ""
"If no positional argument is given, an empty dictionary is created. If a "
"positional argument is given and it is a mapping object, a dictionary is "
"created with the same key-value pairs as the mapping object. Otherwise, the "
"positional argument must be an :term:`iterable` object. Each item in the "
"iterable must itself be an iterable with exactly two objects. The first "
"object of each item becomes a key in the new dictionary, and the second "
"object the corresponding value. If a key occurs more than once, the last "
"value for that key becomes the corresponding value in the new dictionary."
msgstr ""
"Si aucun argument positionnel n'est donné, un dictionnaire vide est crée. Si "
2017-05-28 21:45:20 +00:00
"un argument positionnel est donné et est un *mapping object*, un "
"dictionnaire est crée avec les mêmes paires de clé-valeur que le *mapping* "
2017-05-28 21:45:20 +00:00
"donné. Autrement, l'argument positionnel doit être un objet :term:"
"`iterable`. Chaque élément de cet itérable doit lui même être un itérable "
"contenant exactement deux objets. Le premier objet de chaque élément "
"devient une clé du nouveau dictionnaire, et le second devient sa valeur "
"correspondante. Si une clé apparaît plus d'une fois, la dernière valeur "
"pour cette clé devient la valeur correspondante à cette clé dans le nouveau "
"dictionnaire."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4414
2016-10-30 09:46:26 +00:00
msgid ""
"If keyword arguments are given, the keyword arguments and their values are "
"added to the dictionary created from the positional argument. If a key "
"being added is already present, the value from the keyword argument replaces "
"the value from the positional argument."
msgstr ""
"Si des arguments nommés sont donnés, ils sont ajoutés au dictionnaire créé "
"depuis l'argument positionnel. Si une clé est déjà présente, la valeur de "
2017-05-28 21:45:20 +00:00
"l'argument nommé remplace la valeur reçue par l'argument positionnel."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4419
2016-10-30 09:46:26 +00:00
msgid ""
"To illustrate, the following examples all return a dictionary equal to "
"``{\"one\": 1, \"two\": 2, \"three\": 3}``::"
msgstr ""
2017-06-05 19:57:45 +00:00
"Typiquement, les exemples suivants renvoient tous un dictionnaire valant "
"``{\"one\": 1, \"two\": 2, \"three\": 3}`` ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4431
2016-10-30 09:46:26 +00:00
msgid ""
"Providing keyword arguments as in the first example only works for keys that "
"are valid Python identifiers. Otherwise, any valid keys can be used."
msgstr ""
2017-06-05 19:57:45 +00:00
"Fournir les arguments nommés comme dans le premier exemple en fonctionne que "
"pour des clés qui sont des identifiants valide en Python. Dans les autres "
"cas, toutes les clés valides sont utilisables."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4435
2016-10-30 09:46:26 +00:00
msgid ""
"These are the operations that dictionaries support (and therefore, custom "
"mapping types should support too):"
msgstr ""
2017-06-05 19:57:45 +00:00
"Voici les opérations gérées par les dictionnaires, (par conséquent, d'autres "
"types de tableaux de correspondances peuvent les gérer aussi) :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4440
2019-10-09 16:10:12 +00:00
msgid "Return a list of all the keys used in the dictionary *d*."
msgstr ""
"Renvoie une liste de toutes les clés utilisées dans le dictionnaire *d*."
2019-10-09 16:10:12 +00:00
#: library/stdtypes.rst:4444
2016-10-30 09:46:26 +00:00
msgid "Return the number of items in the dictionary *d*."
2017-06-05 19:57:45 +00:00
msgstr "Renvoie le nombre d'éléments dans le dictionnaire *d*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4448
2016-10-30 09:46:26 +00:00
msgid ""
"Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is "
"not in the map."
msgstr ""
"Renvoie l'élément de *d* dont la clé est *key*. Lève une exception :exc:"
2017-06-05 19:57:45 +00:00
"`KeyError` si *key* n'est pas dans le dictionnaire."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4453
2016-10-30 09:46:26 +00:00
msgid ""
"If a subclass of dict defines a method :meth:`__missing__` and *key* is not "
"present, the ``d[key]`` operation calls that method with the key *key* as "
"argument. The ``d[key]`` operation then returns or raises whatever is "
"returned or raised by the ``__missing__(key)`` call. No other operations or "
"methods invoke :meth:`__missing__`. If :meth:`__missing__` is not defined, :"
"exc:`KeyError` is raised. :meth:`__missing__` must be a method; it cannot be "
"an instance variable::"
msgstr ""
2017-06-06 21:45:34 +00:00
"Si une sous-classe de *dict* définit une méthode :meth:`__missing__` et que "
"*key* manque, l'opération ``d[key]`` appelle cette méthode avec la clé *key* "
"en argument. L'opération ``d[key]`` renverra la valeur, ou lèvera "
2017-06-06 21:45:34 +00:00
"l'exception renvoyée ou levée par l'appel à ``__missing__(key)``. Aucune "
"autre opération ni méthode n'appellent :meth:`__missing__`. If :meth:"
"`__missing__` n'est pas définie, une exception :exc:`KeyError` est levée. :"
"meth:`__missing__` doit être une méthode ; ça ne peut pas être une variable "
"d'instance ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4471
2016-10-30 09:46:26 +00:00
msgid ""
"The example above shows part of the implementation of :class:`collections."
"Counter`. A different ``__missing__`` method is used by :class:`collections."
"defaultdict`."
msgstr ""
2017-06-06 21:45:34 +00:00
"L'exemple ci-dessus montre une partie de l'implémentation de :class:"
"`collections.Counter`. :class:`collections.defaultdict` implémente aussi "
"``__missing__``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4477
2016-10-30 09:46:26 +00:00
msgid "Set ``d[key]`` to *value*."
2017-06-06 21:45:34 +00:00
msgstr "Assigne ``d[key]`` à *value*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4481
2016-10-30 09:46:26 +00:00
msgid ""
"Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the "
"map."
msgstr ""
2017-06-06 21:45:34 +00:00
"Supprime ``d[key]`` de *d*. Lève une exception :exc:`KeyError` si *key* "
"n'est pas dans le dictionnaire."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4486
2016-10-30 09:46:26 +00:00
msgid "Return ``True`` if *d* has a key *key*, else ``False``."
msgstr "Renvoie ``True`` si *d* a la clé *key*, sinon ``False``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4490
2016-10-30 09:46:26 +00:00
msgid "Equivalent to ``not key in d``."
2017-06-06 21:45:34 +00:00
msgstr "Équivalent à ``not key in d``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4494
2016-10-30 09:46:26 +00:00
msgid ""
"Return an iterator over the keys of the dictionary. This is a shortcut for "
"``iter(d.keys())``."
msgstr ""
"Renvoie un itérateur sur les clés du dictionnaire. C'est un raccourci pour "
2017-06-06 21:45:34 +00:00
"``iter(d.keys())``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4499
2016-10-30 09:46:26 +00:00
msgid "Remove all items from the dictionary."
2017-05-28 21:45:20 +00:00
msgstr "Supprime tous les éléments du dictionnaire."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4503
2016-10-30 09:46:26 +00:00
msgid "Return a shallow copy of the dictionary."
2017-06-06 21:45:34 +00:00
msgstr "Renvoie une copie de surface du dictionnaire."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4507
msgid ""
"Create a new dictionary with keys from *iterable* and values set to *value*."
2016-10-30 09:46:26 +00:00
msgstr ""
"Crée un nouveau dictionnaire avec les clés de *iterable* et les valeurs à "
2017-06-06 21:45:34 +00:00
"*value*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4509
2016-10-30 09:46:26 +00:00
msgid ""
":meth:`fromkeys` is a class method that returns a new dictionary. *value* "
2019-09-04 09:35:23 +00:00
"defaults to ``None``. All of the values refer to just a single instance, so "
"it generally doesn't make sense for *value* to be a mutable object such as "
"an empty list. To get distinct values, use a :ref:`dict comprehension "
"<dict>` instead."
2016-10-30 09:46:26 +00:00
msgstr ""
":meth:`fromkeys` est une méthode de classe qui renvoie un nouveau "
"dictionnaire. *value* vaut par défaut ``None``. Toutes les valeurs se "
"réfèrent à une seule instance, donc il n'est généralement pas logique que "
"*value* soit un objet mutable comme une liste vide. Pour avoir des valeurs "
"distinctes, utiliser plutôt une :ref:`compréhension de dictionnaire <dict>`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4517
2016-10-30 09:46:26 +00:00
msgid ""
"Return the value for *key* if *key* is in the dictionary, else *default*. If "
"*default* is not given, it defaults to ``None``, so that this method never "
"raises a :exc:`KeyError`."
msgstr ""
2017-06-06 21:45:34 +00:00
"Renvoie la valeur de *key* si *key* est dans le dictionnaire, sinon "
"*default*. Si *default* n'est pas donné, il vaut ``None`` par défaut, de "
"manière à ce que cette méthode ne lève jamais :exc:`KeyError`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4523
2016-10-30 09:46:26 +00:00
msgid ""
"Return a new view of the dictionary's items (``(key, value)`` pairs). See "
"the :ref:`documentation of view objects <dict-views>`."
msgstr ""
2017-08-01 22:11:48 +00:00
"Renvoie une nouvelle vue des éléments du dictionnaire (paires de ``(key, "
2017-08-08 08:45:02 +00:00
"value)``). Voir la :ref:`documentation des vues <dict-views>`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4528
2016-10-30 09:46:26 +00:00
msgid ""
"Return a new view of the dictionary's keys. See the :ref:`documentation of "
"view objects <dict-views>`."
msgstr ""
"Renvoie une nouvelle vue des clés du dictionnaire. Voir la :ref:"
2017-08-01 22:11:48 +00:00
"`documentation des vues <dict-views>`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4533
2016-10-30 09:46:26 +00:00
msgid ""
"If *key* is in the dictionary, remove it and return its value, else return "
"*default*. If *default* is not given and *key* is not in the dictionary, a :"
"exc:`KeyError` is raised."
msgstr ""
2017-08-01 22:11:48 +00:00
"Si *key* est dans le dictionnaire elle est supprimée et sa valeur est "
"renvoyée, sinon renvoie *default*. Si *default* n'est pas donné et que "
"*key* n'est pas dans le dictionnaire, une :exc:`KeyError` est levée."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4539
2016-10-30 09:46:26 +00:00
msgid ""
"Remove and return a ``(key, value)`` pair from the dictionary. Pairs are "
"returned in :abbr:`LIFO (last-in, first-out)` order."
msgstr ""
"Supprime et renvoie une paire ``(key, value)`` du dictionnaire. Les paires "
"sont renvoyées dans un ordre :abbr:`LIFO (dernière entrée, prenière sortie)`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4542
2016-10-30 09:46:26 +00:00
msgid ""
":meth:`popitem` is useful to destructively iterate over a dictionary, as "
"often used in set algorithms. If the dictionary is empty, calling :meth:"
"`popitem` raises a :exc:`KeyError`."
msgstr ""
2017-05-27 21:39:44 +00:00
":meth:`popitem` est pratique pour itérer un dictionnaire de manière "
"destructive, comme souvent dans les algorithmes sur les ensembles. Si le "
2017-05-27 21:39:44 +00:00
"dictionnaire est vide, appeler :meth:`popitem` lève une :exc:`KeyError`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4546
msgid ""
"LIFO order is now guaranteed. In prior versions, :meth:`popitem` would "
"return an arbitrary key/value pair."
msgstr ""
2018-11-12 10:16:00 +00:00
"L'ordre \"dernier entré, premier sorti\" (LIFO) est désormais assuré. Dans "
"les versions précédentes, :meth:`popitem` renvoyait une paire clé/valeur "
"arbitraire."
#: library/stdtypes.rst:4552
2019-09-04 09:35:23 +00:00
msgid ""
"Return a reverse iterator over the keys of the dictionary. This is a "
"shortcut for ``reversed(d.keys())``."
msgstr ""
"Renvoie un itérateur inversé sur les clés du dictionnaire. C'est un "
"raccourci pour ``reversed(d.keys())``."
2019-09-04 09:35:23 +00:00
#: library/stdtypes.rst:4559
2016-10-30 09:46:26 +00:00
msgid ""
"If *key* is in the dictionary, return its value. If not, insert *key* with "
"a value of *default* and return *default*. *default* defaults to ``None``."
msgstr ""
2017-08-01 22:11:48 +00:00
"Si *key* est dans le dictionnaire, sa valeur est renvoyée. Sinon, insère "
"*key* avec comme valeur *default* et renvoie *default*. *default* vaut "
"``None`` par défaut."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4565
2016-10-30 09:46:26 +00:00
msgid ""
"Update the dictionary with the key/value pairs from *other*, overwriting "
"existing keys. Return ``None``."
msgstr ""
"Met à jour le dictionnaire avec les paires de clé/valeur d'*other*, écrasant "
"les clés existantes. Renvoie ``None``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4568
2016-10-30 09:46:26 +00:00
msgid ""
":meth:`update` accepts either another dictionary object or an iterable of "
"key/value pairs (as tuples or other iterables of length two). If keyword "
"arguments are specified, the dictionary is then updated with those key/value "
"pairs: ``d.update(red=1, blue=2)``."
msgstr ""
2017-05-27 21:39:44 +00:00
":meth:`update` accepte aussi bien un autre dictionnaire qu'un itérable de "
"clé/valeurs (sous forme de *n*-uplets ou autres itérables de longueur deux). "
"Si des arguments nommés sont donnés, le dictionnaire est alors mis à jour "
"avec ces paires de clé-valeur : ``d.update(red=1, blue=2)``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4575
2016-10-30 09:46:26 +00:00
msgid ""
"Return a new view of the dictionary's values. See the :ref:`documentation "
"of view objects <dict-views>`."
msgstr ""
2017-08-01 22:11:48 +00:00
"Renvoie une nouvelle vue des valeurs du dictionnaire. Voir la :ref:"
"`documentation des vues <dict-views>`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4578
2019-10-09 16:10:12 +00:00
msgid ""
"An equality comparison between one ``dict.values()`` view and another will "
"always return ``False``. This also applies when comparing ``dict.values()`` "
"to itself::"
msgstr ""
"Une comparaison d'égalité entre une vue de ``dict.values()`` et une autre "
"renvoie toujours ``False``. Cela s'applique aussi lorsque l'on compare "
"``dict.values()`` à lui-même ::"
2019-10-09 16:10:12 +00:00
#: library/stdtypes.rst:4588
2020-07-20 08:56:42 +00:00
msgid ""
"Create a new dictionary with the merged keys and values of *d* and *other*, "
"which must both be dictionaries. The values of *other* take priority when "
"*d* and *other* share keys."
msgstr ""
"Crée un nouveau dictionnaire avec les clés et les valeurs fusionnées de *d* "
"et *other*, qui doivent tous deux être des dictionnaires. Les valeurs de "
"*other* sont prioritaires lorsque *d* et *other* partagent des clés."
2020-07-20 08:56:42 +00:00
#: library/stdtypes.rst:4596
2020-07-20 08:56:42 +00:00
msgid ""
"Update the dictionary *d* with keys and values from *other*, which may be "
"either a :term:`mapping` or an :term:`iterable` of key/value pairs. The "
"values of *other* take priority when *d* and *other* share keys."
msgstr ""
"Met à jour le dictionnaire *d* avec les clés et les valeurs de *other*, qui "
"peut être soit un :term:`mapping` soit un :term:`iterable` de paires clé/"
"valeur. Les valeurs de *other* sont prioritaires lorsque *d* et *other* "
"partagent des clés."
2020-07-20 08:56:42 +00:00
#: library/stdtypes.rst:4602
2016-10-30 09:46:26 +00:00
msgid ""
"Dictionaries compare equal if and only if they have the same ``(key, "
2019-10-09 16:10:12 +00:00
"value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', "
"'>') raise :exc:`TypeError`."
2016-10-30 09:46:26 +00:00
msgstr ""
"Deux dictionnaires sont égaux si et seulement s'ils ont les mêmes paires de "
"clé-valeur (``(key, value)``, peu importe leur ordre). Les comparaisons "
"d'ordre (``<``, ``<=``, ``>=``, ``>``) lèvent une :exc:`TypeError`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4606
2018-06-28 13:32:56 +00:00
msgid ""
"Dictionaries preserve insertion order. Note that updating a key does not "
"affect the order. Keys added after deletion are inserted at the end. ::"
msgstr ""
"Les dictionnaires préservent l'ordre des insertions. Notez que modifier une "
"clé n'affecte pas l'ordre. Les clés ajoutées après un effacement sont "
"insérées à la fin. ::"
2018-06-28 13:32:56 +00:00
#: library/stdtypes.rst:4624
2018-06-28 13:32:56 +00:00
msgid ""
2018-11-29 15:13:39 +00:00
"Dictionary order is guaranteed to be insertion order. This behavior was an "
2018-06-28 13:32:56 +00:00
"implementation detail of CPython from 3.6."
msgstr ""
"L'ordre d'un dictionnaire est toujours l'ordre des insertions. Ce "
"comportement était un détail d'implémentation de CPython depuis la version "
"3.6."
2018-06-28 13:32:56 +00:00
#: library/stdtypes.rst:4628
2019-09-04 09:35:23 +00:00
msgid "Dictionaries and dictionary views are reversible. ::"
msgstr "Les dictionnaires et les vues de dictionnaires sont réversibles. ::"
2019-09-04 09:35:23 +00:00
# suit un ':' ("changed in version X.Y")
#: library/stdtypes.rst:4640
2019-09-04 09:35:23 +00:00
msgid "Dictionaries are now reversible."
msgstr "les dictionnaires sont maintenant réversibles."
2019-09-04 09:35:23 +00:00
#: library/stdtypes.rst:4645
2016-10-30 09:46:26 +00:00
msgid ""
":class:`types.MappingProxyType` can be used to create a read-only view of a :"
"class:`dict`."
msgstr ""
2017-05-27 21:39:44 +00:00
":class:`types.MappingProxyType` peut être utilisé pour créer une vue en "
"lecture seule d'un :class:`dict`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4652
2016-10-30 09:46:26 +00:00
msgid "Dictionary view objects"
2017-08-01 22:11:48 +00:00
msgstr "Les vues de dictionnaires"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4654
2016-10-30 09:46:26 +00:00
msgid ""
"The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:"
"`dict.items` are *view objects*. They provide a dynamic view on the "
"dictionary's entries, which means that when the dictionary changes, the view "
"reflects these changes."
msgstr ""
2017-08-01 22:11:48 +00:00
"Les objets renvoyés par :meth:`dict.keys`, :meth:`dict.values` et :meth:"
"`dict.items` sont des *vues*. Ils fournissent une vue dynamique des "
"éléments du dictionnaire, ce qui signifie que si le dictionnaire change, la "
"vue reflète ces changements."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4659
2016-10-30 09:46:26 +00:00
msgid ""
"Dictionary views can be iterated over to yield their respective data, and "
"support membership tests:"
msgstr ""
"Les vues de dictionnaires peuvent être itérées et ainsi renvoyer les données "
"du dictionnaire, elle gèrent aussi les tests de présence :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4664
2016-10-30 09:46:26 +00:00
msgid "Return the number of entries in the dictionary."
2017-08-01 22:11:48 +00:00
msgstr "Renvoie le nombre d'entrées du dictionnaire."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4668
2016-10-30 09:46:26 +00:00
msgid ""
"Return an iterator over the keys, values or items (represented as tuples of "
"``(key, value)``) in the dictionary."
msgstr ""
"Renvoie un itérateur sur les clés, les valeurs, ou les éléments (représentés "
"par des paires ``(clé, valeur)`` du dictionnaire."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4671
2016-10-30 09:46:26 +00:00
msgid ""
2018-06-28 13:32:56 +00:00
"Keys and values are iterated over in insertion order. This allows the "
"creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d."
"values(), d.keys())``. Another way to create the same list is ``pairs = "
"[(v, k) for (k, v) in d.items()]``."
2016-10-30 09:46:26 +00:00
msgstr ""
"Les clés et les valeurs sont itérées dans l'ordre de leur insertion. Ceci "
"permet la création de paires de ``(key, value)`` en utilisant :func:`zip` : "
"``pairs = zip(d.values(), d.keys())``. Un autre moyen de construire la même "
2018-07-05 09:39:28 +00:00
"liste est ``pairs = [(v, k) for (k, v) in d.items()]``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4676
2016-10-30 09:46:26 +00:00
msgid ""
"Iterating views while adding or deleting entries in the dictionary may raise "
"a :exc:`RuntimeError` or fail to iterate over all entries."
msgstr ""
2017-08-01 22:11:48 +00:00
"Parcourir des vues tout en ajoutant ou supprimant des entrées dans un "
"dictionnaire peut lever une :exc:`RuntimeError` ou ne pas fournir toutes les "
"entrées."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4679
2018-06-28 13:32:56 +00:00
msgid "Dictionary order is guaranteed to be insertion order."
msgstr "L'ordre d'un dictionnaire est toujours l'ordre des insertions."
2018-06-28 13:32:56 +00:00
#: library/stdtypes.rst:4684
2016-10-30 09:46:26 +00:00
msgid ""
"Return ``True`` if *x* is in the underlying dictionary's keys, values or "
"items (in the latter case, *x* should be a ``(key, value)`` tuple)."
msgstr ""
"Renvoie ``True`` si *x* est dans les clés, les valeurs, ou les éléments du "
"dictionnaire sous-jacent (dans le dernier cas, *x* doit être une paire "
2017-08-01 22:11:48 +00:00
"``(key, value)``)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4689
2019-09-04 09:35:23 +00:00
msgid ""
"Return a reverse iterator over the keys, values or items of the dictionary. "
"The view will be iterated in reverse order of the insertion."
msgstr ""
"Renvoie un itérateur inversé sur les clés, les valeurs ou les éléments du "
"dictionnaire. La vue est itérée dans l'ordre inverse d'insertion."
2019-09-04 09:35:23 +00:00
# suit un ':' ("changed in version X.Y")
#: library/stdtypes.rst:4692
2019-09-04 09:35:23 +00:00
msgid "Dictionary views are now reversible."
msgstr "les vues de dictionnaires sont dorénavant réversibles."
2019-09-04 09:35:23 +00:00
#: library/stdtypes.rst:4697
msgid ""
"Return a :class:`types.MappingProxyType` that wraps the original dictionary "
"to which the view refers."
msgstr ""
"Renvoie une :class:`types.MappingProxyType` qui encapsule le dictionnaire "
"original auquel la vue se réfère."
#: library/stdtypes.rst:4702
2016-10-30 09:46:26 +00:00
msgid ""
"Keys views are set-like since their entries are unique and hashable. If all "
"values are hashable, so that ``(key, value)`` pairs are unique and hashable, "
"then the items view is also set-like. (Values views are not treated as set-"
"like since the entries are generally not unique.) For set-like views, all "
"of the operations defined for the abstract base class :class:`collections."
"abc.Set` are available (for example, ``==``, ``<``, or ``^``)."
msgstr ""
"Les vues de clés sont semblables à des ensembles puisque leurs entrées sont "
"uniques et hachables. Si toutes les valeurs sont hachables, et qu'ainsi "
"toutes les paires de ``(clé, valeur)`` sont uniques et hachables, alors la "
"vue donnée par *items()* est aussi semblable à un ensemble. (Les vues "
"données par *items()* ne sont généralement pas traitées comme des ensembles, "
"car leurs valeurs ne sont généralement pas uniques.) Pour les vues "
"semblables aux ensembles, toutes les opérations définies dans la classe mère "
"abstraite :class:`collections.abc.Set` sont disponibles (comme ``==``, "
2017-08-13 22:08:36 +00:00
"``<``, ou ``^``)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4709
2016-10-30 09:46:26 +00:00
msgid "An example of dictionary view usage::"
msgstr "Exemple d'utilisation de vue de dictionnaire ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4750
2016-10-30 09:46:26 +00:00
msgid "Context Manager Types"
msgstr "Le type gestionnaire de contexte"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4757
2016-10-30 09:46:26 +00:00
msgid ""
"Python's :keyword:`with` statement supports the concept of a runtime context "
"defined by a context manager. This is implemented using a pair of methods "
"that allow user-defined classes to define a runtime context that is entered "
"before the statement body is executed and exited when the statement ends:"
msgstr ""
"L'instruction :keyword:`with` permet l'existence de contextes définis à "
"l'exécution par des gestionnaires de contextes. C'est implémenté via une "
2017-08-13 22:08:36 +00:00
"paire de méthodes permettant de définir un contexte, à l'exécution, qui est "
"entré avant l'exécution du corps de l'instruction, et qui est quitté lorsque "
"l'instruction se termine :"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4765
2016-10-30 09:46:26 +00:00
msgid ""
"Enter the runtime context and return either this object or another object "
"related to the runtime context. The value returned by this method is bound "
2018-12-24 13:20:55 +00:00
"to the identifier in the :keyword:`!as` clause of :keyword:`with` statements "
2016-10-30 09:46:26 +00:00
"using this context manager."
msgstr ""
2017-08-13 22:08:36 +00:00
"Entre dans le contexte à l'exécution, soit se renvoyant lui-même, soit en "
"renvoyant un autre objet en lien avec ce contexte. La valeur renvoyée par "
"cette méthode est liée à l'identifiant donné au :keyword:`!as` de "
2017-08-13 22:08:36 +00:00
"l'instruction :keyword:`with` utilisant ce gestionnaire de contexte."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4770
2016-10-30 09:46:26 +00:00
msgid ""
"An example of a context manager that returns itself is a :term:`file "
"object`. File objects return themselves from __enter__() to allow :func:"
"`open` to be used as the context expression in a :keyword:`with` statement."
msgstr ""
2017-05-28 21:45:20 +00:00
"Un exemple de gestionnaire de contexte se renvoyant lui-même est :term:`file "
"object`. Les *file objects* se renvoient eux-même depuis ``__enter__()`` et "
2017-05-28 21:45:20 +00:00
"autorisent :func:`open` à être utilisé comme contexte à une instruction :"
"keyword:`with`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4774
2016-10-30 09:46:26 +00:00
msgid ""
"An example of a context manager that returns a related object is the one "
"returned by :func:`decimal.localcontext`. These managers set the active "
"decimal context to a copy of the original decimal context and then return "
"the copy. This allows changes to be made to the current decimal context in "
"the body of the :keyword:`with` statement without affecting code outside "
2018-12-24 13:20:55 +00:00
"the :keyword:`!with` statement."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-05-28 21:45:20 +00:00
"Un exemple de gestionnaire de contexte renvoyant un objet connexe est celui "
"renvoyé par :func:`decimal.localcontext`. Ces gestionnaires remplacent le "
"contexte décimal courant par une copie de l'original, copie qui est "
"renvoyée. Ça permet de changer le contexte courant dans le corps du :keyword:"
"`with` sans affecter le code en dehors de l'instruction :keyword:`!with`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4784
2016-10-30 09:46:26 +00:00
msgid ""
"Exit the runtime context and return a Boolean flag indicating if any "
"exception that occurred should be suppressed. If an exception occurred while "
"executing the body of the :keyword:`with` statement, the arguments contain "
"the exception type, value and traceback information. Otherwise, all three "
"arguments are ``None``."
msgstr ""
2017-08-13 22:08:36 +00:00
"Sort du contexte et renvoie un booléen indiquant si une exception survenue "
"doit être supprimée. Si une exception est survenue lors de l'exécution du "
"corps de l'instruction :keyword:`with`, les arguments contiennent le type de "
"l'exception, sa valeur, et la trace de la pile (*traceback*). Sinon les "
"trois arguments valent ``None``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4789
2016-10-30 09:46:26 +00:00
msgid ""
"Returning a true value from this method will cause the :keyword:`with` "
"statement to suppress the exception and continue execution with the "
2018-12-24 13:20:55 +00:00
"statement immediately following the :keyword:`!with` statement. Otherwise "
"the exception continues propagating after this method has finished "
"executing. Exceptions that occur during execution of this method will "
"replace any exception that occurred in the body of the :keyword:`!with` "
"statement."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-12 11:36:14 +00:00
"L'instruction :keyword:`with` inhibera l'exception si cette méthode renvoie "
"une valeur vraie, l'exécution continuera ainsi à l'instruction suivant "
"immédiatement l'instruction :keyword:`!with`. Sinon, l'exception continuera "
"de se propager après la fin de cette méthode. Les exceptions se produisant "
2017-09-12 11:36:14 +00:00
"pendant l'exécution de cette méthode remplaceront toute exception qui s'est "
"produite dans le corps du :keyword:`!with`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4796
2016-10-30 09:46:26 +00:00
msgid ""
"The exception passed in should never be reraised explicitly - instead, this "
"method should return a false value to indicate that the method completed "
"successfully and does not want to suppress the raised exception. This allows "
"context management code to easily detect whether or not an :meth:`__exit__` "
"method has actually failed."
msgstr ""
"L'exception reçue ne doit jamais être relancée explicitement, cette méthode "
2017-09-12 11:36:14 +00:00
"devrait plutôt renvoyer une valeur fausse pour indiquer que son exécution "
"s'est terminée avec succès et qu'elle ne veut pas supprimer l'exception. "
"Ceci permet au code de gestion du contexte de comprendre si une méthode :"
2017-09-24 21:19:43 +00:00
"meth:`__exit__` a échoué."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4802
2016-10-30 09:46:26 +00:00
msgid ""
"Python defines several context managers to support easy thread "
"synchronisation, prompt closure of files or other objects, and simpler "
"manipulation of the active decimal arithmetic context. The specific types "
"are not treated specially beyond their implementation of the context "
"management protocol. See the :mod:`contextlib` module for some examples."
msgstr ""
2017-09-12 11:36:14 +00:00
"Python définit plusieurs gestionnaires de contexte pour faciliter la "
2017-12-08 11:58:06 +00:00
"synchronisation des fils d'exécution, la fermeture des fichiers ou d'autres "
"objets, et la configuration du contexte arithmétique décimal. Ces types "
"spécifiques ne sont pas traités différemment, ils respectent simplement le "
"protocole de gestion du contexte. Voir les exemples dans la documentation du "
2017-12-08 11:58:06 +00:00
"module :mod:`contextlib`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4808
2016-10-30 09:46:26 +00:00
msgid ""
"Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` "
"decorator provide a convenient way to implement these protocols. If a "
"generator function is decorated with the :class:`contextlib.contextmanager` "
"decorator, it will return a context manager implementing the necessary :meth:"
2021-12-31 10:41:52 +00:00
"`~contextmanager.__enter__` and :meth:`~contextmanager.__exit__` methods, "
"rather than the iterator produced by an undecorated generator function."
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-12 11:36:14 +00:00
"Les :term:`generator`\\s de Python et le décorateur :class:`contextlib."
"contextmanager` permettent d'implémenter simplement ces protocoles. Si un "
"générateur est décoré avec :class:`contextlib. contextmanager`, elle "
"renverra un gestionnaire de contexte implémentant les méthodes :meth:"
"`~contextmanager.__enter__` et :meth:`~contextmanager.__exit__`, plutôt que "
"l'itérateur produit par un générateur non décoré."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4815
2016-10-30 09:46:26 +00:00
msgid ""
"Note that there is no specific slot for any of these methods in the type "
"structure for Python objects in the Python/C API. Extension types wanting to "
"define these methods must provide them as a normal Python accessible method. "
"Compared to the overhead of setting up the runtime context, the overhead of "
"a single class dictionary lookup is negligible."
msgstr ""
"Notez qu'il n'y a pas d'emplacement spécifique pour ces méthodes dans la "
"structure de type pour les objets Python dans l'API Python/C. Les types "
"souhaitant définir ces méthodes doivent les fournir comme une méthode "
"accessible en Python. Comparé au coût de la mise en place du contexte "
"d'exécution, les le coût d'un accès au dictionnaire d'une classe unique est "
"négligeable."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:4823
msgid ""
"Type Annotation Types --- :ref:`Generic Alias <types-genericalias>`, :ref:"
"`Union <types-union>`"
msgstr ""
"Types d'annotation de type — :ref:`Alias générique <types-genericalias>`, :"
"ref:`Union <types-union>`"
#: library/stdtypes.rst:4828
msgid ""
"The core built-in types for :term:`type annotations <annotation>` are :ref:"
"`Generic Alias <types-genericalias>` and :ref:`Union <types-union>`."
msgstr ""
"Les principaux types natifs pour l':term:`annotation de types <annotation>` "
"sont l':ref:`Alias générique <types-genericalias>` et l':ref:`Union <types-"
"union>`."
#: library/stdtypes.rst:4835
2020-12-18 06:09:57 +00:00
msgid "Generic Alias Type"
msgstr "Type Alias générique"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4841
2020-12-18 06:09:57 +00:00
msgid ""
2022-03-23 17:40:12 +00:00
"``GenericAlias`` objects are generally created by :ref:`subscripting "
"<subscriptions>` a class. They are most often used with :ref:`container "
"classes <sequence-types>`, such as :class:`list` or :class:`dict`. For "
"example, ``list[int]`` is a ``GenericAlias`` object created by subscripting "
"the ``list`` class with the argument :class:`int`. ``GenericAlias`` objects "
"are intended primarily for use with :term:`type annotations <annotation>`."
2020-12-18 06:09:57 +00:00
msgstr ""
"Les objets ``GenericAlias`` sont généralement créés en :ref:`indiçant "
"<subscriptions>` une classe. Ils sont le plus souvent utilisés avec des :ref:"
"`classes conteneurs <sequence-types>`, telles que :class:`list` ou :class:"
"`dict`. Par exemple, ``list[int]`` est un objet GenericAlias créé en "
"indiçant la classe ``list`` avec l'argument :class:`int`. Les objets "
"``GenericAlias`` sont principalement destinés à être utilisés en tant qu':"
"term:`annotations de types <annotation>`."
2020-12-18 06:09:57 +00:00
# suit un :
#: library/stdtypes.rst:4851
2020-12-18 06:09:57 +00:00
msgid ""
2022-03-23 17:40:12 +00:00
"It is generally only possible to subscript a class if the class implements "
"the special method :meth:`~object.__class_getitem__`."
2020-12-18 06:09:57 +00:00
msgstr ""
"il n'est généralement possible d'indicer une classe que si la classe "
"implémente la méthode spéciale :meth:`~object.__class_getitem__`."
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4854
2020-12-18 06:09:57 +00:00
msgid ""
2022-03-23 17:40:12 +00:00
"A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, "
"implementing *parameterized generics*."
2020-12-18 06:09:57 +00:00
msgstr ""
"Un objet ``GenericAlias`` agit comme un mandataire pour un :term:`type "
"générique`, en implémentant des *types génériques pouvant recevoir des "
"paramètres*."
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4857
2022-03-23 17:40:12 +00:00
msgid ""
"For a container class, the argument(s) supplied to a :ref:`subscription "
"<subscriptions>` of the class may indicate the type(s) of the elements an "
"object contains. For example, ``set[bytes]`` can be used in type annotations "
"to signify a :class:`set` in which all the elements are of type :class:"
"`bytes`."
msgstr ""
"Pour une classe conteneur, les arguments fournis comme :ref:`indices "
"<subscriptions>` de la classe indiquent les types des éléments que l'objet "
"peut contenir. Par exemple, ``set[bytes]`` peut être utilisé dans les "
"annotations de type pour signifier un :class:`ensemble <set>` dans lequel "
"tous les éléments sont de type :class:`bytes`."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:4863
2022-03-23 17:40:12 +00:00
msgid ""
"For a class which defines :meth:`~object.__class_getitem__` but is not a "
"container, the argument(s) supplied to a subscription of the class will "
"often indicate the return type(s) of one or more methods defined on an "
"object. For example, :mod:`regular expressions <re>` can be used on both "
"the :class:`str` data type and the :class:`bytes` data type:"
msgstr ""
"Pour une classe qui définit :meth:`~object.__class_getitem__` mais n'est pas "
"un conteneur, les arguments fournis comme indices de la classe indiquent "
"souvent les types de retour d'une ou plusieurs méthodes définies sur un "
"objet. Par exemple, :mod:`re` (expressions rationnelles) peut être utilisé à "
"la fois sur le type de données :class:`str` et sur le type de données :class:"
"`bytes` :"
2022-03-23 17:40:12 +00:00
# énumération
#: library/stdtypes.rst:4869
2022-03-23 17:40:12 +00:00
msgid ""
"If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match <match-"
"objects>` object where the return values of ``x.group(0)`` and ``x[0]`` will "
"both be of type :class:`str`. We can represent this kind of object in type "
"annotations with the ``GenericAlias`` ``re.Match[str]``."
msgstr ""
"si ``x = re.search('foo', 'foo')``, ``x`` est un objet :ref:`re.Match <match-"
"objects>` où les valeurs de retour de ``x.group(0)`` et ``x[0]`` sont toutes "
"les deux de type :class:`str`. Nous pouvons représenter ce type d'objet dans "
"des annotations de type avec le ``GenericAlias`` ``re.Match[str]`` ;"
2022-03-23 17:40:12 +00:00
# fin d'énumération
#: library/stdtypes.rst:4875
2020-12-18 06:09:57 +00:00
msgid ""
2022-03-23 17:40:12 +00:00
"If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), "
"``y`` will also be an instance of ``re.Match``, but the return values of ``y."
"group(0)`` and ``y[0]`` will both be of type :class:`bytes`. In type "
"annotations, we would represent this variety of :ref:`re.Match <match-"
"objects>` objects with ``re.Match[bytes]``."
2020-12-18 06:09:57 +00:00
msgstr ""
"si ``y = re.search(b'bar', b'bar')``, (notez le ``b`` pour :class:`bytes`), "
"``y`` est également une instance de ``re.Match``, mais les valeurs de retour "
"de ``y.group(0)`` et ``y[0]`` sont toutes les deux de type :class:`bytes`. "
"Dans les annotations de type, nous représenterons cette variété d'objets :"
"ref:`re.Match <match-objects>` par ``re.Match[bytes]``."
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4881
2020-12-18 06:09:57 +00:00
msgid ""
2022-03-23 17:40:12 +00:00
"``GenericAlias`` objects are instances of the class :class:`types."
"GenericAlias`, which can also be used to create ``GenericAlias`` objects "
"directly."
2020-12-18 06:09:57 +00:00
msgstr ""
"Les objets ``GenericAlias`` sont des instances de la classe :class:`types."
"GenericAlias`, qui peut également être utilisée pour créer directement des "
"objets ``GenericAlias``."
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4887
2020-12-18 06:09:57 +00:00
msgid ""
2022-03-23 17:40:12 +00:00
"Creates a ``GenericAlias`` representing a type ``T`` parameterized by types "
"*X*, *Y*, and more depending on the ``T`` used. For example, a function "
"expecting a :class:`list` containing :class:`float` elements::"
2020-12-18 06:09:57 +00:00
msgstr ""
"Crée un ``GenericAlias`` représentant un type ``T`` paramétré par les types "
"*X*, *Y* et plus selon le ``T`` utilisé. Par exemple, pour une fonction "
"attendant une :class:`list` contenant des éléments :class:`float` ::"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4895
2020-12-18 06:09:57 +00:00
msgid ""
"Another example for :term:`mapping` objects, using a :class:`dict`, which is "
"a generic type expecting two type parameters representing the key type and "
"the value type. In this example, the function expects a ``dict`` with keys "
"of type :class:`str` and values of type :class:`int`::"
msgstr ""
"Un autre exemple peut être un objet :term:`tableau de correspondances "
"<mapping>`, utilisant un :class:`dict`, qui est un type générique attendant "
"deux paramètres de type représentant le type clé et le type valeur. Dans cet "
"exemple, la fonction attend un ``dict`` avec des clés de type :class:`str` "
"et des valeurs de type :class:`int` ::"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4903
2020-12-18 06:09:57 +00:00
msgid ""
"The builtin functions :func:`isinstance` and :func:`issubclass` do not "
"accept ``GenericAlias`` types for their second argument::"
msgstr ""
"Les fonctions natives :func:`isinstance` et :func:`issubclass` n'acceptent "
"pas les types ``GenericAlias`` pour leur second argument ::"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4911
2020-12-18 06:09:57 +00:00
msgid ""
"The Python runtime does not enforce :term:`type annotations <annotation>`. "
2022-03-23 17:40:12 +00:00
"This extends to generic types and their type parameters. When creating a "
"container object from a ``GenericAlias``, the elements in the container are "
"not checked against their type. For example, the following code is "
"discouraged, but will run without errors::"
2020-12-18 06:09:57 +00:00
msgstr ""
"Lors de l'exécution, Python ne regarde pas les :term:`annotations de type "
"<annotation>`. Cela vaut pour les types génériques et les types qu'on leur "
"passe en paramètres. Lors de la création d'un objet conteneur à partir d'un "
"``GenericAlias``, les types des éléments du conteneur ne sont pas vérifiés. "
"Par exemple, le code suivant est déconseillé, mais s'exécute sans erreur ::"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4921
2020-12-18 06:09:57 +00:00
msgid ""
"Furthermore, parameterized generics erase type parameters during object "
"creation::"
msgstr ""
"De plus, les types génériques pouvant recevoir des paramètres effacent les "
"paramètres de type lors de la création d'objet ::"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4932
2020-12-18 06:09:57 +00:00
msgid ""
"Calling :func:`repr` or :func:`str` on a generic shows the parameterized "
"type::"
msgstr ""
"Appeler :func:`repr` ou :func:`str` sur un type générique affiche le type "
"pouvant recevoir des paramètres ::"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4940
2020-12-18 06:09:57 +00:00
msgid ""
2022-03-23 17:40:12 +00:00
"The :meth:`~object.__getitem__` method of generic containers will raise an "
"exception to disallow mistakes like ``dict[str][str]``::"
2020-12-18 06:09:57 +00:00
msgstr ""
"La méthode :meth:`~object.__getitem__` des conteneurs génériques lève une "
"exception pour interdire les erreurs telles que ``dict[str][str]`` ::"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4948
2020-12-18 06:09:57 +00:00
msgid ""
"However, such expressions are valid when :ref:`type variables <generics>` "
"are used. The index must have as many elements as there are type variable "
2022-03-23 17:40:12 +00:00
"items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`. ::"
2020-12-18 06:09:57 +00:00
msgstr ""
"Cependant, de telles expressions sont valides lorsque :ref:`des variables de "
"type <generics>` sont utilisées. L'indice doit avoir autant d'éléments qu'il "
"y a d'éléments variables de type dans l'objet ``GenericAlias`` :attr:"
"`~genericalias.__args__`. ::"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4959
2022-03-23 17:40:12 +00:00
msgid "Standard Generic Classes"
msgstr "Classes génériques standards"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4961
2022-03-23 17:40:12 +00:00
msgid ""
"The following standard library classes support parameterized generics. This "
"list is non-exhaustive."
2020-12-18 06:09:57 +00:00
msgstr ""
"Les classes suivantes de la bibliothèque standard prennent en charge les "
"types génériques pouvant accepter des paramètres. Cette liste est non "
"exhaustive."
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4964
2020-12-18 06:09:57 +00:00
msgid ":class:`tuple`"
msgstr ":class:`tuple`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4965
2020-12-18 06:09:57 +00:00
msgid ":class:`list`"
msgstr ":class:`list`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4966
2020-12-18 06:09:57 +00:00
msgid ":class:`dict`"
msgstr ":class:`dict`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4967
2020-12-18 06:09:57 +00:00
msgid ":class:`set`"
msgstr ":class:`set`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4968
2020-12-18 06:09:57 +00:00
msgid ":class:`frozenset`"
msgstr ":class:`frozenset`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4969
2020-12-18 06:09:57 +00:00
msgid ":class:`type`"
msgstr ":class:`type`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4970
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.deque`"
msgstr ":class:`collections.deque`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4971
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.defaultdict`"
msgstr ":class:`collections.defaultdict`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4972
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.OrderedDict`"
msgstr ":class:`collections.OrderedDict`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4973
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.Counter`"
msgstr ":class:`collections.Counter`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4974
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.ChainMap`"
msgstr ":class:`collections.ChainMap`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4975
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.Awaitable`"
msgstr ":class:`collections.abc.Awaitable`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4976
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.Coroutine`"
msgstr ":class:`collections.abc.Coroutine`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4977
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.AsyncIterable`"
msgstr ":class:`collections.abc.AsyncIterable`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4978
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.AsyncIterator`"
msgstr ":class:`collections.abc.AsyncIterator`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4979
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.AsyncGenerator`"
msgstr ":class:`collections.abc.AsyncGenerator`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4980
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.Iterable`"
msgstr ":class:`collections.abc.Iterable`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4981
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.Iterator`"
msgstr ":class:`collections.abc.Iterator`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4982
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.Generator`"
msgstr ":class:`collections.abc.Generator`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4983
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.Reversible`"
msgstr ":class:`collections.abc.Reversible`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4984
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.Container`"
msgstr ":class:`collections.abc.Container`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4985
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.Collection`"
msgstr ":class:`collections.abc.Collection`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4986
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.Callable`"
msgstr ":class:`collections.abc.Callable`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4987
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.Set`"
msgstr ":class:`collections.abc.Set`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4988
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.MutableSet`"
msgstr ":class:`collections.abc.MutableSet`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4989
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.Mapping`"
msgstr ":class:`collections.abc.Mapping`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4990
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.MutableMapping`"
msgstr ":class:`collections.abc.MutableMapping`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4991
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.Sequence`"
msgstr ":class:`collections.abc.Sequence`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4992
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.MutableSequence`"
msgstr ":class:`collections.abc.MutableSequence`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4993
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.ByteString`"
msgstr ":class:`collections.abc.ByteString`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4994
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.MappingView`"
msgstr ":class:`collections.abc.MappingView`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4995
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.KeysView`"
msgstr ":class:`collections.abc.KeysView`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4996
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.ItemsView`"
msgstr ":class:`collections.abc.ItemsView`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4997
2020-12-18 06:09:57 +00:00
msgid ":class:`collections.abc.ValuesView`"
msgstr ":class:`collections.abc.ValuesView`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4998
2020-12-18 06:09:57 +00:00
msgid ":class:`contextlib.AbstractContextManager`"
msgstr ":class:`contextlib.AbstractContextManager`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:4999
2020-12-18 06:09:57 +00:00
msgid ":class:`contextlib.AbstractAsyncContextManager`"
msgstr ":class:`contextlib.AbstractAsyncContextManager`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:5000
2022-03-23 17:40:12 +00:00
msgid ":class:`dataclasses.Field`"
msgstr ":class:`dataclasses.Field`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5001
2022-03-23 17:40:12 +00:00
msgid ":class:`functools.cached_property`"
msgstr ":class:`functools.cached_property`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5002
2022-03-23 17:40:12 +00:00
msgid ":class:`functools.partialmethod`"
msgstr ":class:`functools.partialmethod`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5003
2022-03-23 17:40:12 +00:00
msgid ":class:`os.PathLike`"
msgstr ":class:`os.PathLike`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5004
2022-03-23 17:40:12 +00:00
msgid ":class:`queue.LifoQueue`"
msgstr ":class:`queue.LifoQueue`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5005
2022-03-23 17:40:12 +00:00
msgid ":class:`queue.Queue`"
msgstr ":class:`queue.Queue`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5006
2022-03-23 17:40:12 +00:00
msgid ":class:`queue.PriorityQueue`"
msgstr ":class:`queue.PriorityQueue`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5007
2022-03-23 17:40:12 +00:00
msgid ":class:`queue.SimpleQueue`"
msgstr ":class:`queue.SimpleQueue`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5008
2020-12-18 06:09:57 +00:00
msgid ":ref:`re.Pattern <re-objects>`"
msgstr ":ref:`re.Pattern <re-objects>`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:5009
2020-12-18 06:09:57 +00:00
msgid ":ref:`re.Match <match-objects>`"
msgstr ":ref:`re.Match <match-objects>`"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:5010
2022-03-23 17:40:12 +00:00
msgid ":class:`shelve.BsdDbShelf`"
msgstr ":class:`shelve.BsdDbShelf`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5011
2022-03-23 17:40:12 +00:00
msgid ":class:`shelve.DbfilenameShelf`"
msgstr ":class:`shelve.DbfilenameShelf`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5012
2022-03-23 17:40:12 +00:00
msgid ":class:`shelve.Shelf`"
msgstr ":class:`shelve.Shelf`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5013
2022-03-23 17:40:12 +00:00
msgid ":class:`types.MappingProxyType`"
msgstr ":class:`types.MappingProxyType`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5014
2022-03-23 17:40:12 +00:00
msgid ":class:`weakref.WeakKeyDictionary`"
msgstr ":class:`weakref.WeakKeyDictionary`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5015
2022-03-23 17:40:12 +00:00
msgid ":class:`weakref.WeakMethod`"
msgstr ":class:`weakref.WeakMethod`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5016
2022-03-23 17:40:12 +00:00
msgid ":class:`weakref.WeakSet`"
msgstr ":class:`weakref.WeakSet`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5017
2022-03-23 17:40:12 +00:00
msgid ":class:`weakref.WeakValueDictionary`"
msgstr ":class:`weakref.WeakValueDictionary`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5022
2022-03-23 17:40:12 +00:00
msgid "Special Attributes of ``GenericAlias`` objects"
msgstr "Attributs spéciaux des alias génériques"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:5024
2020-12-18 06:09:57 +00:00
msgid "All parameterized generics implement special read-only attributes."
msgstr ""
"Tous les types génériques pouvant accepter des paramètres implémentent des "
"attributs spéciaux en lecture seule."
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:5028
2020-12-18 06:09:57 +00:00
msgid "This attribute points at the non-parameterized generic class::"
msgstr "Cet attribut pointe vers la classe générique sans paramètres ::"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:5036
2020-12-18 06:09:57 +00:00
msgid ""
"This attribute is a :class:`tuple` (possibly of length 1) of generic types "
2022-03-23 17:40:12 +00:00
"passed to the original :meth:`~object.__class_getitem__` of the generic "
"class::"
2020-12-18 06:09:57 +00:00
msgstr ""
"Cet attribut est un :class:`n-uplet <tuple>` (éventuellement de longueur 1) "
"de types génériques passés à la :meth:`~object.__class_getitem__` d'origine "
"de la classe générique ::"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:5046
2020-12-18 06:09:57 +00:00
msgid ""
"This attribute is a lazily computed tuple (possibly empty) of unique type "
"variables found in ``__args__``::"
msgstr ""
"Cet attribut est un *n*-uplet calculé paresseusement (éventuellement vide) "
"de variables de type (chaque type n'est mentionné qu'une seule fois) "
"trouvées dans ``__args__`` ::"
2020-12-18 06:09:57 +00:00
# suit un :
#: library/stdtypes.rst:5057
msgid ""
"A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not "
"have correct ``__parameters__`` after substitution because :class:`typing."
"ParamSpec` is intended primarily for static type checking."
msgstr ""
"un objet ``GenericAlias`` avec des paramètres :class:`typing.ParamSpec` peut "
"ne pas avoir de ``__parameters__`` corrects après substitution car :class:"
"`typing.ParamSpec` est principalement destiné à la vérification de type "
"statique."
#: library/stdtypes.rst:5064
2022-05-22 21:15:02 +00:00
msgid ""
"A boolean that is true if the alias has been unpacked using the ``*`` "
"operator (see :data:`~typing.TypeVarTuple`)."
msgstr ""
"Booléen qui est vrai si l'alias a été décompressé à l'aide de l'opérateur "
"``*`` (voir :data:`~typing.TypeVarTuple`)."
2022-05-22 21:15:02 +00:00
#: library/stdtypes.rst:5073
2022-03-23 17:40:12 +00:00
msgid ":pep:`484` - Type Hints"
msgstr ":pep:`484` - Indications des types (page en anglais)"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:5073
2022-03-23 17:40:12 +00:00
msgid "Introducing Python's framework for type annotations."
msgstr "Présentation du cadre Python pour les annotations de type."
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:5078
2022-03-23 17:40:12 +00:00
msgid ":pep:`585` - Type Hinting Generics In Standard Collections"
2020-12-18 06:09:57 +00:00
msgstr ""
":pep:`585` Types génériques d'indication de type dans les conteneurs "
"standard (page en anglais)"
2020-12-18 06:09:57 +00:00
#: library/stdtypes.rst:5076
2022-03-23 17:40:12 +00:00
msgid ""
"Introducing the ability to natively parameterize standard-library classes, "
"provided they implement the special class method :meth:`~object."
"__class_getitem__`."
msgstr ""
"Présentation de la possibilité de paramétrer nativement les classes de la "
"bibliothèque standard, à condition qu'elles implémentent la méthode de "
"classe spéciale :meth:`~object.__class_getitem__`."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5081
2022-03-23 17:40:12 +00:00
msgid ""
":ref:`Generics`, :ref:`user-defined generics <user-defined-generics>` and :"
"class:`typing.Generic`"
msgstr ""
":ref:`Génériques <Generics>`, :ref:`génériques personnalisés <user-defined-"
"generics>` et :class:`typing.Generic`"
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5081
2022-03-23 17:40:12 +00:00
msgid ""
"Documentation on how to implement generic classes that can be parameterized "
"at runtime and understood by static type-checkers."
msgstr ""
"Documentation sur la façon d'implémenter des classes génériques qui peuvent "
"être paramétrées à l'exécution et comprises par les vérificateurs de type "
"statiques."
2022-03-23 17:40:12 +00:00
#: library/stdtypes.rst:5090
msgid "Union Type"
msgstr "Type Union"
#: library/stdtypes.rst:5096
msgid ""
"A union object holds the value of the ``|`` (bitwise or) operation on "
"multiple :ref:`type objects <bltin-type-objects>`. These types are intended "
"primarily for :term:`type annotations <annotation>`. The union type "
"expression enables cleaner type hinting syntax compared to :data:`typing."
"Union`."
msgstr ""
"Un objet *union* contient la valeur de l'opération ``|`` (OU bit à bit) sur "
"plusieurs :ref:`objets types <bltin-type-objects>`. Ces types sont "
"principalement destinés aux :term:`annotations de types <annotation>`. "
"L'expression d'union de types permet une syntaxe plus claire pour les "
"indications de type par rapport à :data:`typing.Union`."
#: library/stdtypes.rst:5103
msgid ""
"Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` "
"means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For "
"example, the following function expects an argument of type :class:`int` or :"
"class:`float`::"
msgstr ""
"Définit un objet *union* qui contient les types *X*, *Y*, etc. ``X | Y`` "
"signifie X ou Y. Cela équivaut à ``typing.Union[X, Y]``. Par exemple, la "
"fonction suivante attend un argument de type :class:`int` ou :class:"
"`float` ::"
#: library/stdtypes.rst:5113
msgid ""
"Union objects can be tested for equality with other union objects. Details:"
msgstr ""
"Les objets *union* peuvent être testés pour savoir s'ils sont égaux à "
"d'autres objets *union*. Plus en détails :"
#: library/stdtypes.rst:5115
msgid "Unions of unions are flattened::"
msgstr "Les unions d'unions sont aplaties ::"
#: library/stdtypes.rst:5119
msgid "Redundant types are removed::"
msgstr "Les types redondants sont supprimés ::"
#: library/stdtypes.rst:5123
msgid "When comparing unions, the order is ignored::"
msgstr "Lors de la comparaison d'unions, l'ordre est ignoré ::"
#: library/stdtypes.rst:5127
msgid "It is compatible with :data:`typing.Union`::"
msgstr "Il est compatible avec :data:`typing.Union` ::"
#: library/stdtypes.rst:5131
msgid "Optional types can be spelled as a union with ``None``::"
msgstr ""
"Les types optionnels peuvent être orthographiés comme une union avec "
"``None`` ::"
#: library/stdtypes.rst:5138
msgid ""
"Calls to :func:`isinstance` and :func:`issubclass` are also supported with a "
"union object::"
msgstr ""
"Les appels à :func:`isinstance` et :func:`issubclass` sont également pris en "
"charge avec un objet *union* ::"
#: library/stdtypes.rst:5144
msgid ""
"However, union objects containing :ref:`parameterized generics <types-"
"genericalias>` cannot be used::"
msgstr ""
"Cependant, les objets *union* contenant des :ref:`types génériques acceptant "
"des paramètres <types-genericalias>` ne peuvent pas être utilisés ::"
#: library/stdtypes.rst:5152
msgid ""
"The user-exposed type for the union object can be accessed from :data:`types."
"UnionType` and used for :func:`isinstance` checks. An object cannot be "
"instantiated from the type::"
msgstr ""
"Le type indiqué à l'utilisateur pour l'objet *union* est accessible par :"
"data:`types.UnionType` et utilisé pour les vérifications :func:`isinstance`. "
"Un objet ne peut pas être instancié à partir du type ::"
# suit un :
#: library/stdtypes.rst:5165
msgid ""
"The :meth:`__or__` method for type objects was added to support the syntax "
"``X | Y``. If a metaclass implements :meth:`__or__`, the Union may override "
"it::"
msgstr ""
"la méthode :meth:`__or__` pour les objets de type a été ajoutée pour prendre "
"en charge la syntaxe ``X | Y``. Si une métaclasse implémente :meth:`__or__`, "
"l'*union* peut la remplacer ::"
#: library/stdtypes.rst:5183
msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type."
msgstr ":pep:`604` PEP proposant la syntaxe ``X | Y`` et le type *Union*."
#: library/stdtypes.rst:5191
2016-10-30 09:46:26 +00:00
msgid "Other Built-in Types"
2017-05-28 21:45:20 +00:00
msgstr "Autres types natifs"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5193
2016-10-30 09:46:26 +00:00
msgid ""
"The interpreter supports several other kinds of objects. Most of these "
"support only one or two operations."
msgstr ""
"L'interpréteur gère aussi d'autres types d'objets, la plupart ne gèrent "
2017-09-21 11:06:21 +00:00
"cependant qu'une ou deux opérations."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5200
2016-10-30 09:46:26 +00:00
msgid "Modules"
msgstr "Modules"
#: library/stdtypes.rst:5202
2016-10-30 09:46:26 +00:00
msgid ""
"The only special operation on a module is attribute access: ``m.name``, "
"where *m* is a module and *name* accesses a name defined in *m*'s symbol "
"table. Module attributes can be assigned to. (Note that the :keyword:"
"`import` statement is not, strictly speaking, an operation on a module "
"object; ``import foo`` does not require a module object named *foo* to "
"exist, rather it requires an (external) *definition* for a module named "
"*foo* somewhere.)"
msgstr ""
"La seule opération spéciale sur un module est l'accès à ses attributs : ``m."
2017-09-21 11:06:21 +00:00
"name``, où *m* est un module et *name* donne accès un nom défini dans la "
"table des symboles de *m*. Il est possible d'assigner un attribut de "
"module. (Notez que l'instruction :keyword:`import` n'est pas strictement "
"une opération sur un objet module. ``import foo`` ne nécessite pas qu'un "
"objet module nommé *foo* existe, il nécessite cependant une *définition* "
"(externe) d'un module nommé *foo* quelque part.)"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5209
2016-10-30 09:46:26 +00:00
msgid ""
"A special attribute of every module is :attr:`~object.__dict__`. This is the "
"dictionary containing the module's symbol table. Modifying this dictionary "
"will actually change the module's symbol table, but direct assignment to "
"the :attr:`~object.__dict__` attribute is not possible (you can write ``m."
"__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but you can't write "
"``m.__dict__ = {}``). Modifying :attr:`~object.__dict__` directly is not "
"recommended."
msgstr ""
2017-05-28 21:45:20 +00:00
"Un attribut spécial à chaque module est :attr:`~object.__dict__`. C'est le "
"dictionnaire contenant la table des symboles du module. Modifier ce "
"dictionnaire change la table des symboles du module, mais assigner "
2017-05-28 21:45:20 +00:00
"directement :attr:`~object.__dict__` n'est pas possible (vous pouvez écrire "
"``m.__dict__['a'] = 1``, qui donne ``1`` comme valeur pour ``m.a``, mais "
"vous ne pouvez pas écrire ``m.__dict__ = {}``). Modifier :attr:`~object."
"__dict__` directement n'est pas recommandé."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5217
2016-10-30 09:46:26 +00:00
msgid ""
"Modules built into the interpreter are written like this: ``<module "
"'sys' (built-in)>``. If loaded from a file, they are written as ``<module "
"'os' from '/usr/local/lib/pythonX.Y/os.pyc'>``."
msgstr ""
"Les modules natifs de l'interpréteur sont affichés comme ``<module "
"'sys' (built-in)>``. S'ils sont chargés depuis un fichier, ils sont "
"affichés sous la forme ``<module 'os' from '/usr/local/lib/pythonX.Y/os."
"pyc'>``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5225
2016-10-30 09:46:26 +00:00
msgid "Classes and Class Instances"
msgstr "Les classes et instances de classes"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5227
2016-10-30 09:46:26 +00:00
msgid "See :ref:`objects` and :ref:`class` for these."
msgstr "Voir :ref:`objects` et :ref:`class`."
#: library/stdtypes.rst:5233
2016-10-30 09:46:26 +00:00
msgid "Functions"
msgstr "Fonctions"
#: library/stdtypes.rst:5235
2016-10-30 09:46:26 +00:00
msgid ""
"Function objects are created by function definitions. The only operation on "
"a function object is to call it: ``func(argument-list)``."
msgstr ""
"Les objets fonctions sont créés par les définitions de fonctions. La seule "
"opération applicable à un objet fonction est de l'appeler : ``func(argument-"
2017-09-21 11:06:21 +00:00
"list)``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5238
2016-10-30 09:46:26 +00:00
msgid ""
"There are really two flavors of function objects: built-in functions and "
"user-defined functions. Both support the same operation (to call the "
"function), but the implementation is different, hence the different object "
"types."
msgstr ""
"Il existe en fait deux catégories d'objets fonctions : les fonctions natives "
"et les fonctions définies par l'utilisateur. Les deux gèrent les mêmes "
2017-09-21 11:06:21 +00:00
"opérations (l'appel à la fonction), mais leur implémentation est différente, "
"d'où les deux types distincts."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5242
2016-10-30 09:46:26 +00:00
msgid "See :ref:`function` for more information."
2017-09-21 11:06:21 +00:00
msgstr "Voir :ref:`function` pour plus d'information."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5248
2016-10-30 09:46:26 +00:00
msgid "Methods"
msgstr "Méthodes"
#: library/stdtypes.rst:5252
2016-10-30 09:46:26 +00:00
msgid ""
"Methods are functions that are called using the attribute notation. There "
"are two flavors: built-in methods (such as :meth:`append` on lists) and "
"class instance methods. Built-in methods are described with the types that "
"support them."
msgstr ""
"Les méthodes sont des fonctions appelées *via* la notation d'attribut. Il en "
"existe deux variantes : les méthodes natives (tel que :meth:`append` sur les "
"listes) et les méthodes d'instances de classes. Les méthodes natives sont "
"décrites avec le type qui les gère."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5257
2016-10-30 09:46:26 +00:00
msgid ""
"If you access a method (a function defined in a class namespace) through an "
"instance, you get a special object: a :dfn:`bound method` (also called :dfn:"
"`instance method`) object. When called, it will add the ``self`` argument to "
"the argument list. Bound methods have two special read-only attributes: ``m."
"__self__`` is the object on which the method operates, and ``m.__func__`` is "
"the function implementing the method. Calling ``m(arg-1, arg-2, ..., arg-"
"n)`` is completely equivalent to calling ``m.__func__(m.__self__, arg-1, "
"arg-2, ..., arg-n)``."
msgstr ""
"Si vous accédez à une méthode (une fonction définie dans l'espace de nommage "
2017-09-21 11:06:21 +00:00
"d'une classe) via une instance, vous obtenez un objet spécial, une :dfn:"
"`bound method` (aussi appelée :dfn:`instance method`). Lorsqu'elle est "
2017-09-21 11:06:21 +00:00
"appelée, elle ajoute l'argument ``self`` à la liste des arguments. Les "
"méthodes liées ont deux attributs spéciaux, en lecture seule : ``m."
2017-09-21 11:06:21 +00:00
"__self__`` est l'objet sur lequel la méthode travaille, et ``m.__func__`` "
"est la fonction implémentant la méthode. Appeler ``m(arg-1, arg-2, …, arg-"
"n)`` est tout à fait équivalent à appeler ``m.__func__(m.__self__, arg-1, "
"arg-2, …, arg-n)``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5266
2016-10-30 09:46:26 +00:00
msgid ""
"Like function objects, bound method objects support getting arbitrary "
"attributes. However, since method attributes are actually stored on the "
"underlying function object (``meth.__func__``), setting method attributes on "
"bound methods is disallowed. Attempting to set an attribute on a method "
"results in an :exc:`AttributeError` being raised. In order to set a method "
"attribute, you need to explicitly set it on the underlying function object::"
msgstr ""
"Comme les objets fonctions, les objets méthodes liées acceptent des "
2017-09-21 11:06:21 +00:00
"attributs arbitraires. Cependant, puisque les attributs de méthodes doivent "
"être stockés dans la fonction sous-jacente (``meth.__func__``), affecter des "
"attributs à des objets méthodes liées est interdit. Toute tentative "
"d'affecter un attribut sur un objet méthode liée lève une :exc:"
"`AttributeError`. Pour affecter l'attribut, vous devez explicitement "
"l'affecter à l'objet fonction sous-jacent ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5317
2016-10-30 09:46:26 +00:00
msgid "See :ref:`types` for more information."
2017-09-21 11:06:21 +00:00
msgstr "Voir :ref:`types` pour plus d'information."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5294
2016-10-30 09:46:26 +00:00
msgid "Code Objects"
msgstr "Objets code"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5300
2016-10-30 09:46:26 +00:00
msgid ""
"Code objects are used by the implementation to represent \"pseudo-compiled\" "
"executable Python code such as a function body. They differ from function "
"objects because they don't contain a reference to their global execution "
"environment. Code objects are returned by the built-in :func:`compile` "
"function and can be extracted from function objects through their :attr:"
"`__code__` attribute. See also the :mod:`code` module."
msgstr ""
2017-09-21 11:06:21 +00:00
"Les objets code sont utilisés par l'implémentation pour représenter du code "
"Python « pseudo-compilé », comme un corps de fonction. Ils sont différents "
2017-09-21 11:06:21 +00:00
"des objets fonction dans le sens où ils ne contiennent pas de référence à "
"leur environnement global d'exécution. Les objets code sont renvoyés par la "
"fonction native :func:`compile` et peuvent être obtenus à partir des objets "
"fonction *via* l' attribut :attr:`__code__`. Voir aussi le module :mod:"
"`code`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5307
msgid ""
"Accessing ``__code__`` raises an :ref:`auditing event <auditing>` ``object."
"__getattr__`` with arguments ``obj`` and ``\"__code__\"``."
msgstr ""
"L'accès à ``__code__`` déclenche un :ref:`événement d'audit <auditing>` "
"``object.__getattr__`` avec les arguments ``obj`` et ``\"__code__\"``."
#: library/stdtypes.rst:5314
2016-10-30 09:46:26 +00:00
msgid ""
"A code object can be executed or evaluated by passing it (instead of a "
"source string) to the :func:`exec` or :func:`eval` built-in functions."
msgstr ""
2017-05-28 21:45:20 +00:00
"Les objets code peuvent être exécutés ou évalués en les passant (au lieu "
"d'une chaîne contenant du code) aux fonction natives :func:`exec` ou :func:"
"`eval`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5323
2016-10-30 09:46:26 +00:00
msgid "Type Objects"
msgstr "Objets type"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5329
2016-10-30 09:46:26 +00:00
msgid ""
"Type objects represent the various object types. An object's type is "
"accessed by the built-in function :func:`type`. There are no special "
"operations on types. The standard module :mod:`types` defines names for all "
"standard built-in types."
msgstr ""
2017-09-21 11:06:21 +00:00
"Les objets types représentent les différents types d'objets. Le type d'un "
"objet est obtenu via la fonction native :func:`type`. Il n'existe aucune "
"opération spéciale sur les types. Le module standard :mod:`types` définit "
"les noms de tous les types natifs."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5334
2016-10-30 09:46:26 +00:00
msgid "Types are written like this: ``<class 'int'>``."
msgstr "Les types sont affichés comme suit : ``<class 'int'>``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5340
2016-10-30 09:46:26 +00:00
msgid "The Null Object"
2017-09-21 11:06:21 +00:00
msgstr "L'objet Null"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5342
2016-10-30 09:46:26 +00:00
msgid ""
"This object is returned by functions that don't explicitly return a value. "
"It supports no special operations. There is exactly one null object, named "
"``None`` (a built-in name). ``type(None)()`` produces the same singleton."
msgstr ""
2017-09-21 11:06:21 +00:00
"Cet objet est renvoyé par les fonctions ne renvoyant pas explicitement une "
"valeur. Il ne gère aucune opération spéciale. Il existe exactement un seul "
"objet *null* nommé ``None`` (c'est un nom natif). ``type(None)()`` produit "
"ce singleton."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5346
2016-10-30 09:46:26 +00:00
msgid "It is written as ``None``."
msgstr "Il s'écrit ``None``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5353
2016-10-30 09:46:26 +00:00
msgid "The Ellipsis Object"
msgstr "L'objet points de suspension (ou ellipse)"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5355
2016-10-30 09:46:26 +00:00
msgid ""
"This object is commonly used by slicing (see :ref:`slicings`). It supports "
"no special operations. There is exactly one ellipsis object, named :const:"
"`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces the :const:"
"`Ellipsis` singleton."
msgstr ""
2017-09-21 11:06:21 +00:00
"Cet objet est utilisé classiquement lors des découpes (voir :ref:"
"`slicings`). Il ne gère aucune opération spéciale. Il n'y a qu'un seul objet "
"*points de suspension*, nommé :const:`Ellipsis` (un nom natif). "
"``type(Ellipsis)()`` produit le *singleton* :const:`Ellipsis`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5360
2016-10-30 09:46:26 +00:00
msgid "It is written as ``Ellipsis`` or ``...``."
msgstr "Il s'écrit ``Ellipsis`` ou ``...``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5366
2016-10-30 09:46:26 +00:00
msgid "The NotImplemented Object"
2017-09-21 11:06:21 +00:00
msgstr "L'objet *NotImplemented*"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5368
2016-10-30 09:46:26 +00:00
msgid ""
"This object is returned from comparisons and binary operations when they are "
"asked to operate on types they don't support. See :ref:`comparisons` for "
"more information. There is exactly one ``NotImplemented`` object. "
"``type(NotImplemented)()`` produces the singleton instance."
msgstr ""
2017-09-21 11:06:21 +00:00
"Cet objet est renvoyé depuis des comparaisons ou des opérations binaires "
"effectuées sur des types qu'elles ne gèrent pas. Voir :ref:`comparisons` "
2017-09-21 11:06:21 +00:00
"pour plus d'informations. Il n'y a qu'un seul objet ``NotImplemented``. "
"``type(NotImplemented)()`` renvoie ce *singleton*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5373
2016-10-30 09:46:26 +00:00
msgid "It is written as ``NotImplemented``."
msgstr "Il s'écrit ``NotImplemented``."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5379
2016-10-30 09:46:26 +00:00
msgid "Boolean Values"
msgstr "Valeurs booléennes"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5381
2016-10-30 09:46:26 +00:00
msgid ""
"Boolean values are the two constant objects ``False`` and ``True``. They "
"are used to represent truth values (although other values can also be "
"considered false or true). In numeric contexts (for example when used as "
"the argument to an arithmetic operator), they behave like the integers 0 and "
"1, respectively. The built-in function :func:`bool` can be used to convert "
"any value to a Boolean, if the value can be interpreted as a truth value "
"(see section :ref:`truth` above)."
msgstr ""
"Les valeurs booléennes sont les deux objets constants ``False`` et ``True``. "
"Ils sont utilisés pour représenter les valeurs de vérité (bien que d'autres "
2017-05-28 21:45:20 +00:00
"valeurs peuvent être considérées vraies ou fausses). Dans des contextes "
"numériques (par exemple en argument d'un opérateur arithmétique), ils se "
"comportent comme les nombres entiers 0 et 1, respectivement. La fonction "
"native :func:`bool` peut être utilisée pour convertir n'importe quelle "
"valeur en booléen tant que la valeur peut être interprétée en une valeur de "
"vérité (voir :ref:`truth` au dessus)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5394
2016-10-30 09:46:26 +00:00
msgid "They are written as ``False`` and ``True``, respectively."
2017-09-21 11:06:21 +00:00
msgstr "Ils s'écrivent ``False`` et ``True``, respectivement."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5400
2016-10-30 09:46:26 +00:00
msgid "Internal Objects"
msgstr "Objets internes"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5402
2016-10-30 09:46:26 +00:00
msgid ""
"See :ref:`types` for this information. It describes stack frame objects, "
"traceback objects, and slice objects."
msgstr ""
"Voir :ref:`types`. Ils décrivent les objets *stack frame*, *traceback* et "
2017-09-21 11:06:21 +00:00
"*slice*."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5409
2016-10-30 09:46:26 +00:00
msgid "Special Attributes"
msgstr "Attributs spéciaux"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5411
2016-10-30 09:46:26 +00:00
msgid ""
"The implementation adds a few special read-only attributes to several object "
"types, where they are relevant. Some of these are not reported by the :func:"
"`dir` built-in function."
msgstr ""
"L'implémentation ajoute quelques attributs spéciaux en lecture seule à "
"certains types, lorsque ça a du sens. Certains ne sont pas listés par la "
2017-09-21 11:06:21 +00:00
"fonction native :func:`dir`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5418
2016-10-30 09:46:26 +00:00
msgid ""
"A dictionary or other mapping object used to store an object's (writable) "
"attributes."
msgstr ""
"Dictionnaire ou autre objet tableau de correspondances utilisé pour stocker "
"les attributs (modifiables) de l'objet."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5424
2016-10-30 09:46:26 +00:00
msgid "The class to which a class instance belongs."
msgstr "Classe de l'instance de classe."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5429
2016-10-30 09:46:26 +00:00
msgid "The tuple of base classes of a class object."
msgstr "*n*-uplet des classes parentes d'un objet classe."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5434
2016-10-30 09:46:26 +00:00
msgid ""
"The name of the class, function, method, descriptor, or generator instance."
msgstr ""
"Nom de la classe, fonction, méthode, descripteur ou instance du générateur."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5440
2016-10-30 09:46:26 +00:00
msgid ""
"The :term:`qualified name` of the class, function, method, descriptor, or "
"generator instance."
msgstr ""
":term:`Nom qualifié <qualified name>` de la classe, fonction, méthode, "
"descripteur ou instance du générateur."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5448
2016-10-30 09:46:26 +00:00
msgid ""
"This attribute is a tuple of classes that are considered when looking for "
"base classes during method resolution."
msgstr ""
"Cet attribut est un *n*-uplet contenant les classes mères prises en compte "
2017-09-21 11:06:21 +00:00
"lors de la résolution de méthode."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5454
2016-10-30 09:46:26 +00:00
msgid ""
"This method can be overridden by a metaclass to customize the method "
"resolution order for its instances. It is called at class instantiation, "
"and its result is stored in :attr:`~class.__mro__`."
msgstr ""
"Cette méthode peut être surchargée par une méta-classe pour personnaliser "
"l'ordre de la recherche de méthode pour ses instances. Elle est appelée à "
"l'initialisation de la classe et son résultat est stocké dans l'attribut :"
"attr:`~class.__mro__`."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5461
2016-10-30 09:46:26 +00:00
msgid ""
"Each class keeps a list of weak references to its immediate subclasses. "
2021-01-27 19:42:04 +00:00
"This method returns a list of all those references still alive. The list is "
"in definition order. Example::"
2016-10-30 09:46:26 +00:00
msgstr ""
2017-09-21 11:06:21 +00:00
"Chaque classe garde une liste de références faibles à ses classes filles "
"immédiates. Cette méthode renvoie la liste de toutes ces références encore "
"valables. La liste est classée par ordre de définition. Par exemple ::"
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5472
msgid "Integer string conversion length limitation"
msgstr "Limitation de longueur de conversion de chaîne vers un entier"
#: library/stdtypes.rst:5474
msgid ""
"CPython has a global limit for converting between :class:`int` and :class:"
"`str` to mitigate denial of service attacks. This limit *only* applies to "
"decimal or other non-power-of-two number bases. Hexadecimal, octal, and "
"binary conversions are unlimited. The limit can be configured."
msgstr ""
"CPython a une limite globale pour la conversion entre :class:`int` et :class:"
"`str` pour atténuer les attaques par déni de service. Cette limite "
"s'applique *uniquement* aux décimaux ou autres bases de nombres qui ne sont "
"pas des puissances de deux. Les conversions hexadécimales, octales et "
"binaires sont illimitées. La limite peut être configurée."
#: library/stdtypes.rst:5479
msgid ""
"The :class:`int` type in CPython is an arbitrary length number stored in "
"binary form (commonly known as a \"bignum\"). There exists no algorithm that "
"can convert a string to a binary integer or a binary integer to a string in "
"linear time, *unless* the base is a power of 2. Even the best known "
"algorithms for base 10 have sub-quadratic complexity. Converting a large "
"value such as ``int('1' * 500_000)`` can take over a second on a fast CPU."
msgstr ""
"Le type :class:`int` dans CPython stocke un nombre de longueur arbitraire "
"sous forme binaire (communément appelé « *bignum* »). Il n'existe aucun "
"algorithme capable de convertir une chaîne en un entier binaire ou un entier "
"binaire en une chaîne en temps linéaire, sauf si la base est une puissance "
"de 2. Même les meilleurs algorithmes connus pour la base 10 ont une "
"complexité sous-quadratique. La conversion d'une grande valeur telle que "
"``int('1' * 500_000)`` peut prendre plus d'une seconde sur un CPU rapide."
#: library/stdtypes.rst:5486
msgid ""
"Limiting conversion size offers a practical way to avoid `CVE-2020-10735 "
"<https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10735>`_."
msgstr ""
"Limiter la taille de la conversion offre un moyen pratique de limiter la "
"vulnérabilité `CVE-2020-10735 <https://cve.mitre.org/cgi-bin/cvename.cgi?"
"name=CVE-2020-10735>`_."
#: library/stdtypes.rst:5489
msgid ""
"The limit is applied to the number of digit characters in the input or "
"output string when a non-linear conversion algorithm would be involved. "
"Underscores and the sign are not counted towards the limit."
msgstr ""
"La limite est appliquée au nombre de caractères numériques dans la chaîne "
"d'entrée ou de sortie lorsqu'un algorithme de conversion non linéaire doit "
"être appliqué. Les traits de soulignement et le signe ne sont pas comptés "
"dans la limite."
#: library/stdtypes.rst:5493
msgid ""
"When an operation would exceed the limit, a :exc:`ValueError` is raised:"
msgstr ""
"Si une opération va dépasser la limite, une :exc:`ValueError` est levée :"
#: library/stdtypes.rst:5515
msgid ""
"The default limit is 4300 digits as provided in :data:`sys.int_info."
"default_max_str_digits <sys.int_info>`. The lowest limit that can be "
"configured is 640 digits as provided in :data:`sys.int_info."
"str_digits_check_threshold <sys.int_info>`."
msgstr ""
"La limite par défaut est de 4 300 chiffres comme indiqué dans :data:`sys."
"int_info.default_max_str_digits <sys.int_info>`. La limite la plus basse "
"pouvant être configurée est de 640 chiffres, comme indiqué dans :data:`sys."
"int_info.str_digits_check_threshold <sys.int_info>`."
#: library/stdtypes.rst:5520
msgid "Verification:"
msgstr "Vérification :"
#: library/stdtypes.rst:5535
msgid "Affected APIs"
msgstr "API concernées"
#: library/stdtypes.rst:5537
msgid ""
"The limitation only applies to potentially slow conversions between :class:"
"`int` and :class:`str` or :class:`bytes`:"
msgstr ""
"La limitation s'applique uniquement aux conversions potentiellement lentes "
"entre :class:`int` et :class:`str` ou :class:`bytes` :"
#: library/stdtypes.rst:5540
msgid "``int(string)`` with default base 10."
msgstr "``int(string)`` en base 10 (par défaut)."
#: library/stdtypes.rst:5541
msgid "``int(string, base)`` for all bases that are not a power of 2."
msgstr ""
"``int(string, base)`` pour toutes les bases qui ne sont pas des puissances "
"de 2."
#: library/stdtypes.rst:5542
msgid "``str(integer)``."
msgstr "``str(integer)``."
#: library/stdtypes.rst:5543
msgid "``repr(integer)``."
msgstr "``repr(integer)``."
#: library/stdtypes.rst:5544
msgid ""
"any other string conversion to base 10, for example ``f\"{integer}\"``, ``"
"\"{}\".format(integer)``, or ``b\"%d\" % integer``."
msgstr ""
"toute autre conversion de chaîne en base 10, par exemple ``f\"{integer}\"``, "
"``\"{}\".format(integer)`` ou ``b\"%d\" % integer``."
#: library/stdtypes.rst:5547
msgid "The limitations do not apply to functions with a linear algorithm:"
msgstr ""
"Les limitations ne s'appliquent pas aux fonctions avec un algorithme "
"linéaire :"
#: library/stdtypes.rst:5549
msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32."
msgstr "``int(chaîne, base)`` en base 2, 4, 8, 16 ou 32."
#: library/stdtypes.rst:5550
msgid ":func:`int.from_bytes` and :func:`int.to_bytes`."
msgstr ":func:`int.from_bytes` et :func:`int.to_bytes`."
#: library/stdtypes.rst:5551
msgid ":func:`hex`, :func:`oct`, :func:`bin`."
msgstr ":func:`hex`, :func:`oct`, :func:`bin`."
#: library/stdtypes.rst:5552
msgid ":ref:`formatspec` for hex, octal, and binary numbers."
msgstr ":ref:`formatspec` pour les nombres hexadécimaux, octaux et binaires."
#: library/stdtypes.rst:5553
msgid ":class:`str` to :class:`float`."
msgstr ":class:`str` vers :class:`float`."
#: library/stdtypes.rst:5554
msgid ":class:`str` to :class:`decimal.Decimal`."
msgstr ":class:`str` vers :class:`decimal.Decimal`."
#: library/stdtypes.rst:5557
msgid "Configuring the limit"
msgstr "Configuration de la limite"
#: library/stdtypes.rst:5559
msgid ""
"Before Python starts up you can use an environment variable or an "
"interpreter command line flag to configure the limit:"
msgstr ""
"Avant le démarrage de Python, vous pouvez utiliser une variable "
"d'environnement ou une option de ligne de commande d'interpréteur pour "
"configurer la limite :"
#: library/stdtypes.rst:5562
msgid ""
":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` "
"to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable "
"the limitation."
msgstr ""
":envvar:`PYTHONINTMAXSTRDIGITS`, par exemple ``PYTHONINTMAXSTRDIGITS=640 "
"python3`` pour fixer la limite à 640 chiffres ou ``PYTHONINTMAXSTRDIGITS=0 "
"python3`` pour désactiver la limitation."
#: library/stdtypes.rst:5565
msgid ""
":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X "
"int_max_str_digits=640``"
msgstr ""
":option:`-X int_max_str_digits <-X>`, par exemple ``python3 -X "
"int_max_str_digits=640``"
#: library/stdtypes.rst:5567
msgid ""
":data:`sys.flags.int_max_str_digits` contains the value of :envvar:"
"`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the "
"env var and the ``-X`` option are set, the ``-X`` option takes precedence. A "
"value of *-1* indicates that both were unset, thus a value of :data:`sys."
"int_info.default_max_str_digits` was used during initialization."
msgstr ""
":data:`sys.flags.int_max_str_digits` contient la valeur de :envvar:"
"`PYTHONINTMAXSTRDIGITS` ou :option:`-X int_max_str_digits <-X>`. Si la "
"variable d'environnement et l'option ``-X`` sont définies toutes les deux, "
"l'option ``-X`` est prioritaire. Une valeur de *-1* indique que les deux "
"n'étaient pas définies, donc qu'une valeur de :data:`sys.int_info."
"default_max_str_digits` a été utilisée lors de l'initialisation."
#: library/stdtypes.rst:5573
msgid ""
"From code, you can inspect the current limit and set a new one using these :"
"mod:`sys` APIs:"
msgstr ""
"Depuis le code, vous pouvez inspecter la limite actuelle et en définir une "
"nouvelle à l'aide de ces API :mod:`sys` :"
#: library/stdtypes.rst:5576
msgid ""
":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` "
"are a getter and setter for the interpreter-wide limit. Subinterpreters have "
"their own limit."
msgstr ""
":func:`sys.get_int_max_str_digits` et :func:`sys.set_int_max_str_digits` "
"sont un accesseur et un mutateur pour la limite relative à l'interpréteur. "
"Les sous-interprètes possèdent leur propre limite."
#: library/stdtypes.rst:5580
msgid ""
"Information about the default and minimum can be found in :attr:`sys."
"int_info`:"
msgstr ""
"Des informations sur la valeur par défaut et le minimum peuvent être "
"trouvées dans :attr:`sys.int_info` :"
#: library/stdtypes.rst:5582
msgid ""
":data:`sys.int_info.default_max_str_digits <sys.int_info>` is the compiled-"
"in default limit."
msgstr ""
":data:`sys.int_info.default_max_str_digits <sys.int_info>` est la limite par "
"défaut pour la compilation."
#: library/stdtypes.rst:5584
msgid ""
":data:`sys.int_info.str_digits_check_threshold <sys.int_info>` is the lowest "
"accepted value for the limit (other than 0 which disables it)."
msgstr ""
":data:`sys.int_info.str_digits_check_threshold <sys.int_info>` est la valeur "
"la plus basse acceptée pour la limite (autre que 0 qui la désactive)."
# suit un :
#: library/stdtypes.rst:5591
msgid ""
"Setting a low limit *can* lead to problems. While rare, code exists that "
"contains integer constants in decimal in their source that exceed the "
"minimum threshold. A consequence of setting the limit is that Python source "
"code containing decimal integer literals longer than the limit will "
"encounter an error during parsing, usually at startup time or import time or "
"even at installation time - anytime an up to date ``.pyc`` does not already "
"exist for the code. A workaround for source that contains such large "
"constants is to convert them to ``0x`` hexadecimal form as it has no limit."
msgstr ""
"fixer une limite basse *peut* entraîner des problèmes. Bien que rare, du "
"code contenant des constantes entières en décimal dans la source qui dépasse "
"le seuil minimum peut exister. Une conséquence de la définition de la limite "
"est que le code source Python contenant des littéraux entiers décimaux plus "
"longs que la limite lèvera une erreur lors de l'analyse, généralement au "
"démarrage ou à l'importation ou même au moment de l'installation dès qu'un "
"``.pyc`` à jour n'existe pas déjà pour le code. Une solution de "
"contournement pour les sources qui contiennent de si grandes constantes "
"consiste à les convertir au format hexadécimal ``0x`` car il n'y a pas de "
"limite."
#: library/stdtypes.rst:5600
msgid ""
"Test your application thoroughly if you use a low limit. Ensure your tests "
"run with the limit set early via the environment or flag so that it applies "
"during startup and even during any installation step that may invoke Python "
"to precompile ``.py`` sources to ``.pyc`` files."
msgstr ""
"Testez soigneusement votre application si vous utilisez une limite basse. "
"Assurez-vous que vos tests s'exécutent avec la limite définie au début *via* "
"l'environnement ou l'option de ligne de commande afin qu'elle s'applique au "
"démarrage et même lors de toute étape d'installation pouvant invoquer Python "
"pour compiler les sources ``.py`` en fichiers ``.pyc``."
#: library/stdtypes.rst:5606
msgid "Recommended configuration"
msgstr "Configuration recommandée"
#: library/stdtypes.rst:5608
msgid ""
"The default :data:`sys.int_info.default_max_str_digits` is expected to be "
"reasonable for most applications. If your application requires a different "
"limit, set it from your main entry point using Python version agnostic code "
"as these APIs were added in security patch releases in versions before 3.11."
msgstr ""
"La valeur par défaut :data:`sys.int_info.default_max_str_digits` devrait "
"être raisonnable pour la plupart des applications. Si votre application "
"nécessite une limite différente, définissez-la à partir de votre point "
"d'entrée principal à l'aide d'un code indépendant de la version Python, car "
"ces API ont été ajoutées dans des correctifs de sécurité des versions "
"antérieures à 3.11."
#: library/stdtypes.rst:5613
msgid "Example::"
msgstr "Par exemple ::"
#: library/stdtypes.rst:5625
msgid "If you need to disable it entirely, set it to ``0``."
msgstr "Pour la désactiver entièrement, réglez-la à ``0``."
#: library/stdtypes.rst:5629
2016-10-30 09:46:26 +00:00
msgid "Footnotes"
msgstr "Notes"
#: library/stdtypes.rst:5630
2016-10-30 09:46:26 +00:00
msgid ""
"Additional information on these special methods may be found in the Python "
"Reference Manual (:ref:`customization`)."
msgstr ""
2017-05-28 21:45:20 +00:00
"Plus d'informations sur ces méthodes spéciales peuvent être trouvées dans le "
2018-03-20 23:16:43 +00:00
"*Python Reference Manual* (:ref:`customization`)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5633
2016-10-30 09:46:26 +00:00
msgid ""
"As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, "
"and similarly for tuples."
msgstr ""
2017-05-28 21:45:20 +00:00
"Par conséquent, la liste ``[1, 2]`` est considérée égale à ``[1.0, 2.0]``. "
"Idem avec des *n*-uplets."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5636
2016-10-30 09:46:26 +00:00
msgid "They must have since the parser can't tell the type of the operands."
msgstr ""
"Nécessairement, puisque l'analyseur ne peut pas discerner le type des "
2017-09-21 11:06:21 +00:00
"opérandes."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5638
2016-10-30 09:46:26 +00:00
msgid ""
"Cased characters are those with general category property being one of \"Lu"
"\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, "
2016-10-30 09:46:26 +00:00
"titlecase)."
msgstr ""
"Les caractères capitalisables sont ceux dont la propriété Unicode *general "
2017-09-21 11:06:21 +00:00
"category* est soit \"Lu\" (pour *Letter*, *uppercase*), soit \"Ll\" (pour "
"*Letter*, *lowercase*), soit \"Lt\" (pour *Letter*, *titlecase*)."
2016-10-30 09:46:26 +00:00
#: library/stdtypes.rst:5641
2016-10-30 09:46:26 +00:00
msgid ""
"To format only a tuple you should therefore provide a singleton tuple whose "
"only element is the tuple to be formatted."
msgstr ""
"Pour insérer un *n*-uplet, vous devez donc donner un *n*-uplet d'un seul "
"élément, contenant le *n*-uplet à insérer."
#~ msgid ""
#~ "By default, the *errors* argument is not checked for best performances, "
#~ "but only used at the first encoding error. Enable the :ref:`Python "
#~ "Development Mode <devmode>`, or use a :ref:`debug build <debug-build>` to "
#~ "check *errors*."
#~ msgstr ""
#~ "Par défaut, l'argument *errors* n'est pas testé, mais seulement utilisé à "
#~ "la première erreur d'encodage. Activez le :ref:`Python Development Mode "
#~ "<devmode>`, ou utilisez le :ref:`mode de débogage <debug-build>` pour "
#~ "vérifier *errors*."
#~ msgid "Support for keyword arguments added."
#~ msgstr "Gestion des arguments par mot-clé."
#~ msgid ""
#~ "By default, the *errors* argument is not checked for best performances, "
#~ "but only used at the first decoding error. Enable the :ref:`Python "
#~ "Development Mode <devmode>`, or use a :ref:`debug build <debug-build>` to "
#~ "check *errors*."
#~ msgstr ""
#~ "Par défaut, pour de meilleures performances, l'argument *errors* n'est "
#~ "pas testé, mais seulement utilisé à la première erreur d'encodage. "
#~ "Activez le :ref:`Python Development Mode <devmode>`, ou utilisez le :ref:"
#~ "`mode de débogage <debug-build>` pour vérifier *errors*."
2022-05-22 21:15:02 +00:00
#~ msgid ""
#~ "For Python 2.x users: In the Python 2.x series, a variety of implicit "
#~ "conversions between 8-bit strings (the closest thing 2.x offers to a "
#~ "built-in binary data type) and Unicode strings were permitted. This was a "
#~ "backwards compatibility workaround to account for the fact that Python "
#~ "originally only supported 8-bit text, and Unicode text was a later "
#~ "addition. In Python 3.x, those implicit conversions are gone - "
#~ "conversions between 8-bit binary data and Unicode text must be explicit, "
#~ "and bytes and string objects will always compare unequal."
#~ msgstr ""
#~ "Pour les utilisateurs de Python 2.x : Dans la série 2.x de Python, une "
#~ "variété de conversions implicites entre les chaînes 8-bit (la chose la "
#~ "plus proche d'un type natif de données binaires offert par Python 2) et "
#~ "des chaînes Unicode étaient permises. C'était une solution de "
#~ "contournement, pour garder la rétro-compatibilité, considérant que Python "
#~ "ne prenait initialement en charge que le texte 8 bits, le texte Unicode "
#~ "est un ajout ultérieur. En Python 3.x, ces conversions implicites ont "
#~ "disparues, les conversions entre les données binaires et texte Unicode "
#~ "doivent être explicites, et les *bytes* sont toujours différents des "
#~ "chaînes."
#~ msgid ""
#~ "Dictionaries can be created by placing a comma-separated list of ``key: "
#~ "value`` pairs within braces, for example: ``{'jack': 4098, 'sjoerd': 4127}"
#~ "`` or ``{4098: 'jack', 4127: 'sjoerd'}``, or by the :class:`dict` "
#~ "constructor."
#~ msgstr ""
#~ "Il est possible de créer des dictionnaires en plaçant entre accolades une "
#~ "liste de paires de ``key: value`` séparés par des virgules, par exemple: "
#~ "``{'jack': 4098, 'sjoerd': 4127}`` ou ``{4098: 'jack', 4127: 'sjoerd'}``, "
#~ "ou en utilisant le constructeur de :class:`dict`."
#~ msgid "``s.pop([i])``"
#~ msgstr "``s.pop([i])``"