| | | | @ -5,7 +5,7 @@ msgid "" |
| | | | msgstr "" |
| | | | "Project-Id-Version: Python 3\n" |
| | | | "Report-Msgid-Bugs-To: \n" |
| | | | "POT-Creation-Date: 2021-05-19 22:36+0200\n" |
| | | | "POT-Creation-Date: 2021-09-23 16:16+0200\n" |
| | | | "PO-Revision-Date: 2021-09-04 02:09+0200\n" |
| | | | "Last-Translator: Jean Abou Samra <jean@abou-samra.fr>\n" |
| | | | "Language-Team: FRENCH <traductions@lists.afpy.org>\n" |
| | | | @ -54,11 +54,18 @@ msgstr "" |
| | | | "par ailleurs équivalente aux instructions ``switch`` ou ``case`` disponibles " |
| | | | "dans d'autres langages." |
| | | | |
| | | | #: tutorial/controlflow.rst:43 |
| | | | #: tutorial/controlflow.rst:39 |
| | | | msgid "" |
| | | | "If you're comparing the same value to several constants, or checking for " |
| | | | "specific types or attributes, you may also find the :keyword:`!match` " |
| | | | "statement useful. For more details see :ref:`tut-match`." |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:46 |
| | | | msgid ":keyword:`!for` Statements" |
| | | | msgstr "L'instruction :keyword:`!for`" |
| | | | |
| | | | #: tutorial/controlflow.rst:48 |
| | | | #: tutorial/controlflow.rst:51 |
| | | | msgid "" |
| | | | "The :keyword:`for` statement in Python differs a bit from what you may be " |
| | | | "used to in C or Pascal. Rather than always iterating over an arithmetic " |
| | | | @ -77,7 +84,7 @@ msgstr "" |
| | | | "caractères…), dans l'ordre dans lequel ils apparaissent dans la séquence. " |
| | | | "Par exemple :" |
| | | | |
| | | | #: tutorial/controlflow.rst:69 |
| | | | #: tutorial/controlflow.rst:72 |
| | | | msgid "" |
| | | | "Code that modifies a collection while iterating over that same collection " |
| | | | "can be tricky to get right. Instead, it is usually more straight-forward to " |
| | | | @ -87,11 +94,11 @@ msgstr "" |
| | | | "s'avérer délicat. Il est généralement plus simple de boucler sur une copie " |
| | | | "de la collection ou de créer une nouvelle collection ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:88 |
| | | | #: tutorial/controlflow.rst:94 |
| | | | msgid "The :func:`range` Function" |
| | | | msgstr "La fonction :func:`range`" |
| | | | |
| | | | #: tutorial/controlflow.rst:90 |
| | | | #: tutorial/controlflow.rst:96 |
| | | | msgid "" |
| | | | "If you do need to iterate over a sequence of numbers, the built-in function :" |
| | | | "func:`range` comes in handy. It generates arithmetic progressions::" |
| | | | @ -99,7 +106,7 @@ msgstr "" |
| | | | "Si vous devez itérer sur une suite de nombres, la fonction native :func:" |
| | | | "`range` est faite pour cela. Elle génère des suites arithmétiques ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:102 |
| | | | #: tutorial/controlflow.rst:108 |
| | | | msgid "" |
| | | | "The given end point is never part of the generated sequence; ``range(10)`` " |
| | | | "generates 10 values, the legal indices for items of a sequence of length " |
| | | | @ -112,7 +119,7 @@ msgstr "" |
| | | | "valeur d'incrément différentes (y compris négative pour cette dernière, que " |
| | | | "l'on appelle également parfois le « pas ») ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:116 |
| | | | #: tutorial/controlflow.rst:122 |
| | | | msgid "" |
| | | | "To iterate over the indices of a sequence, you can combine :func:`range` " |
| | | | "and :func:`len` as follows::" |
| | | | @ -120,7 +127,7 @@ msgstr "" |
| | | | "Pour itérer sur les indices d'une séquence, on peut combiner les fonctions :" |
| | | | "func:`range` et :func:`len` ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:129 |
| | | | #: tutorial/controlflow.rst:135 |
| | | | msgid "" |
| | | | "In most such cases, however, it is convenient to use the :func:`enumerate` " |
| | | | "function, see :ref:`tut-loopidioms`." |
| | | | @ -128,11 +135,11 @@ msgstr "" |
| | | | "Cependant, dans la plupart des cas, il est plus pratique d'utiliser la " |
| | | | "fonction :func:`enumerate`. Voyez pour cela :ref:`tut-loopidioms`." |
| | | | |
| | | | #: tutorial/controlflow.rst:132 |
| | | | #: tutorial/controlflow.rst:138 |
| | | | msgid "A strange thing happens if you just print a range::" |
| | | | msgstr "Une chose étrange se produit lorsqu'on affiche un *range* ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:137 |
| | | | #: tutorial/controlflow.rst:143 |
| | | | msgid "" |
| | | | "In many ways the object returned by :func:`range` behaves as if it is a " |
| | | | "list, but in fact it isn't. It is an object which returns the successive " |
| | | | @ -144,7 +151,7 @@ msgstr "" |
| | | | "à mesure de l'itération, sans réellement produire la liste en tant que " |
| | | | "telle, économisant ainsi de l'espace." |
| | | | |
| | | | #: tutorial/controlflow.rst:142 |
| | | | #: tutorial/controlflow.rst:148 |
| | | | msgid "" |
| | | | "We say such an object is :term:`iterable`, that is, suitable as a target for " |
| | | | "functions and constructs that expect something from which they can obtain " |
| | | | @ -159,24 +166,17 @@ msgstr "" |
| | | | "de ces constructions, et un exemple de fonction qui prend un itérable en " |
| | | | "paramètre est :func:`sum` ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:151 |
| | | | #: tutorial/controlflow.rst:157 |
| | | | #, fuzzy |
| | | | msgid "" |
| | | | "Later we will see more functions that return iterables and take iterables as " |
| | | | "arguments. Lastly, maybe you are curious about how to get a list from a " |
| | | | "range. Here is the solution::" |
| | | | "arguments. In chapter :ref:`tut-structures`, we will discuss in more detail " |
| | | | "about :func:`list`." |
| | | | msgstr "" |
| | | | "Plus loin nous voyons d'autres fonctions qui donnent des itérables ou en " |
| | | | "prennent en paramètre. Si vous vous demandez comment obtenir une liste à " |
| | | | "partir d'un *range*, voici la solution ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:158 |
| | | | msgid "" |
| | | | "In chapter :ref:`tut-structures`, we will discuss in more detail about :func:" |
| | | | "`list`." |
| | | | msgstr "" |
| | | | "Dans le chapitre :ref:`tut-structures`, nous discuterons plus en détail sur :" |
| | | | "func:`list`." |
| | | | |
| | | | #: tutorial/controlflow.rst:164 |
| | | | msgid "" |
| | | | ":keyword:`!break` and :keyword:`!continue` Statements, and :keyword:`!else` " |
| | | | @ -273,11 +273,153 @@ msgstr "" |
| | | | "permettant ainsi de construire votre code à un niveau plus abstrait. " |
| | | | "L'instruction :keyword:`!pass` est alors ignorée silencieusement ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:250 |
| | | | #: tutorial/controlflow.rst:251 |
| | | | #, fuzzy |
| | | | msgid ":keyword:`!match` Statements" |
| | | | msgstr "L'instruction :keyword:`!pass`" |
| | | | |
| | | | #: tutorial/controlflow.rst:253 |
| | | | msgid "" |
| | | | "A match statement takes an expression and compares its value to successive " |
| | | | "patterns given as one or more case blocks. This is superficially similar to " |
| | | | "a switch statement in C, Java or JavaScript (and many other languages), but " |
| | | | "it can also extract components (sequence elements or object attributes) from " |
| | | | "the value into variables." |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:259 |
| | | | msgid "" |
| | | | "The simplest form compares a subject value against one or more literals::" |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:272 |
| | | | msgid "" |
| | | | "Note the last block: the \"variable name\" ``_`` acts as a *wildcard* and " |
| | | | "never fails to match. If no case matches, none of the branches is executed." |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:275 |
| | | | msgid "" |
| | | | "You can combine several literals in a single pattern using ``|`` (\"or\")::" |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:280 |
| | | | msgid "" |
| | | | "Patterns can look like unpacking assignments, and can be used to bind " |
| | | | "variables::" |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:296 |
| | | | msgid "" |
| | | | "Study that one carefully! The first pattern has two literals, and can be " |
| | | | "thought of as an extension of the literal pattern shown above. But the next " |
| | | | "two patterns combine a literal and a variable, and the variable *binds* a " |
| | | | "value from the subject (``point``). The fourth pattern captures two values, " |
| | | | "which makes it conceptually similar to the unpacking assignment ``(x, y) = " |
| | | | "point``." |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:303 |
| | | | msgid "" |
| | | | "If you are using classes to structure your data you can use the class name " |
| | | | "followed by an argument list resembling a constructor, but with the ability " |
| | | | "to capture attributes into variables::" |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:324 |
| | | | msgid "" |
| | | | "You can use positional parameters with some builtin classes that provide an " |
| | | | "ordering for their attributes (e.g. dataclasses). You can also define a " |
| | | | "specific position for attributes in patterns by setting the " |
| | | | "``__match_args__`` special attribute in your classes. If it's set to (\"x\", " |
| | | | "\"y\"), the following patterns are all equivalent (and all bind the ``y`` " |
| | | | "attribute to the ``var`` variable)::" |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:335 |
| | | | msgid "" |
| | | | "A recommended way to read patterns is to look at them as an extended form of " |
| | | | "what you would put on the left of an assignment, to understand which " |
| | | | "variables would be set to what. Only the standalone names (like ``var`` " |
| | | | "above) are assigned to by a match statement. Dotted names (like ``foo." |
| | | | "bar``), attribute names (the ``x=`` and ``y=`` above) or class names " |
| | | | "(recognized by the \"(...)\" next to them like ``Point`` above) are never " |
| | | | "assigned to." |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:342 |
| | | | msgid "" |
| | | | "Patterns can be arbitrarily nested. For example, if we have a short list of " |
| | | | "points, we could match it like this::" |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:357 |
| | | | msgid "" |
| | | | "We can add an ``if`` clause to a pattern, known as a \"guard\". If the " |
| | | | "guard is false, ``match`` goes on to try the next case block. Note that " |
| | | | "value capture happens before the guard is evaluated::" |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:367 |
| | | | msgid "Several other key features of this statement:" |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:369 |
| | | | msgid "" |
| | | | "Like unpacking assignments, tuple and list patterns have exactly the same " |
| | | | "meaning and actually match arbitrary sequences. An important exception is " |
| | | | "that they don't match iterators or strings." |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:373 |
| | | | msgid "" |
| | | | "Sequence patterns support extended unpacking: ``[x, y, *rest]`` and ``(x, y, " |
| | | | "*rest)`` work similar to unpacking assignments. The name after ``*`` may " |
| | | | "also be ``_``, so ``(x, y, *_)`` matches a sequence of at least two items " |
| | | | "without binding the remaining items." |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:378 |
| | | | msgid "" |
| | | | "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the ``" |
| | | | "\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " |
| | | | "sequence patterns, extra keys are ignored. An unpacking like ``**rest`` is " |
| | | | "also supported. (But ``**_`` would be redundant, so it not allowed.)" |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:383 |
| | | | msgid "Subpatterns may be captured using the ``as`` keyword::" |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:387 |
| | | | msgid "" |
| | | | "will capture the second element of the input as ``p2`` (as long as the input " |
| | | | "is a sequence of two points)" |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:390 |
| | | | msgid "" |
| | | | "Most literals are compared by equality, however the singletons ``True``, " |
| | | | "``False`` and ``None`` are compared by identity." |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:393 |
| | | | msgid "" |
| | | | "Patterns may use named constants. These must be dotted names to prevent " |
| | | | "them from being interpreted as capture variable::" |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:410 |
| | | | msgid "" |
| | | | "For a more detailed explanation and additional examples, you can look into :" |
| | | | "pep:`636` which is written in a tutorial format." |
| | | | msgstr "" |
| | | | |
| | | | #: tutorial/controlflow.rst:416 |
| | | | msgid "Defining Functions" |
| | | | msgstr "Définir des fonctions" |
| | | | |
| | | | #: tutorial/controlflow.rst:252 |
| | | | #: tutorial/controlflow.rst:418 |
| | | | msgid "" |
| | | | "We can create a function that writes the Fibonacci series to an arbitrary " |
| | | | "boundary::" |
| | | | @ -285,7 +427,7 @@ msgstr "" |
| | | | "On peut créer une fonction qui écrit la suite de Fibonacci jusqu'à une " |
| | | | "limite imposée ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:272 |
| | | | #: tutorial/controlflow.rst:438 |
| | | | msgid "" |
| | | | "The keyword :keyword:`def` introduces a function *definition*. It must be " |
| | | | "followed by the function name and the parenthesized list of formal " |
| | | | @ -297,7 +439,7 @@ msgstr "" |
| | | | "paramètres. L'instruction qui constitue le corps de la fonction débute à la " |
| | | | "ligne suivante et doit être indentée." |
| | | | |
| | | | #: tutorial/controlflow.rst:277 |
| | | | #: tutorial/controlflow.rst:443 |
| | | | msgid "" |
| | | | "The first statement of the function body can optionally be a string literal; " |
| | | | "this string literal is the function's documentation string, or :dfn:" |
| | | | @ -316,7 +458,7 @@ msgstr "" |
| | | | "naviguer de façon interactive dans le code ; prenez-en l'habitude, c'est une " |
| | | | "bonne pratique que de documenter le code que vous écrivez." |
| | | | |
| | | | #: tutorial/controlflow.rst:284 |
| | | | #: tutorial/controlflow.rst:450 |
| | | | msgid "" |
| | | | "The *execution* of a function introduces a new symbol table used for the " |
| | | | "local variables of the function. More precisely, all variable assignments " |
| | | | @ -342,7 +484,7 @@ msgstr "" |
| | | | "instruction :keyword:`global` et, pour les variables des fonctions " |
| | | | "englobantes, désignées dans une instruction :keyword:`nonlocal`)." |
| | | | |
| | | | #: tutorial/controlflow.rst:295 |
| | | | #: tutorial/controlflow.rst:461 |
| | | | msgid "" |
| | | | "The actual parameters (arguments) to a function call are introduced in the " |
| | | | "local symbol table of the called function when it is called; thus, arguments " |
| | | | @ -359,7 +501,7 @@ msgstr "" |
| | | | "s'appelle elle-même par récursion, une nouvelle table de symboles locaux est " |
| | | | "créée pour cet appel." |
| | | | |
| | | | #: tutorial/controlflow.rst:302 |
| | | | #: tutorial/controlflow.rst:468 |
| | | | msgid "" |
| | | | "A function definition associates the function name with the function object " |
| | | | "in the current symbol table. The interpreter recognizes the object pointed " |
| | | | @ -372,7 +514,7 @@ msgstr "" |
| | | | "référence à une même fonction, ils peuvent alors tous être utilisés pour " |
| | | | "appeler la fonction ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:313 |
| | | | #: tutorial/controlflow.rst:479 |
| | | | msgid "" |
| | | | "Coming from other languages, you might object that ``fib`` is not a function " |
| | | | "but a procedure since it doesn't return a value. In fact, even functions " |
| | | | @ -391,7 +533,7 @@ msgstr "" |
| | | | "Vous pouvez le constater, si vous y tenez vraiment, en utilisant :func:" |
| | | | "`print` ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:324 |
| | | | #: tutorial/controlflow.rst:490 |
| | | | msgid "" |
| | | | "It is simple to write a function that returns a list of the numbers of the " |
| | | | "Fibonacci series, instead of printing it::" |
| | | | @ -399,14 +541,14 @@ msgstr "" |
| | | | "Il est facile d'écrire une fonction qui renvoie une liste de la série de " |
| | | | "Fibonacci au lieu de l'afficher ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:340 |
| | | | #: tutorial/controlflow.rst:506 |
| | | | msgid "This example, as usual, demonstrates some new Python features:" |
| | | | msgstr "" |
| | | | "Cet exemple, comme d'habitude, illustre de nouvelles fonctionnalités de " |
| | | | "Python :" |
| | | | |
| | | | # énumération --> pas de majuscule et point-virgule en fin de proposition. |
| | | | #: tutorial/controlflow.rst:342 |
| | | | #: tutorial/controlflow.rst:508 |
| | | | msgid "" |
| | | | "The :keyword:`return` statement returns with a value from a function. :" |
| | | | "keyword:`!return` without an expression argument returns ``None``. Falling " |
| | | | @ -418,7 +560,7 @@ msgstr "" |
| | | | "``None`` ;" |
| | | | |
| | | | # fin d'énumération --> pas de majuscule et point final. |
| | | | #: tutorial/controlflow.rst:346 |
| | | | #: tutorial/controlflow.rst:512 |
| | | | msgid "" |
| | | | "The statement ``result.append(a)`` calls a *method* of the list object " |
| | | | "``result``. A method is a function that 'belongs' to an object and is named " |
| | | | @ -444,11 +586,11 @@ msgstr "" |
| | | | "liste. Dans cet exemple, elle est l'équivalent de ``result = result + [a]``, " |
| | | | "en plus efficace." |
| | | | |
| | | | #: tutorial/controlflow.rst:361 |
| | | | #: tutorial/controlflow.rst:527 |
| | | | msgid "More on Defining Functions" |
| | | | msgstr "Davantage sur la définition des fonctions" |
| | | | |
| | | | #: tutorial/controlflow.rst:363 |
| | | | #: tutorial/controlflow.rst:529 |
| | | | msgid "" |
| | | | "It is also possible to define functions with a variable number of arguments. " |
| | | | "There are three forms, which can be combined." |
| | | | @ -456,11 +598,11 @@ msgstr "" |
| | | | "Il est également possible de définir des fonctions avec un nombre variable " |
| | | | "d'arguments. Trois syntaxes peuvent être utilisées, éventuellement combinées." |
| | | | |
| | | | #: tutorial/controlflow.rst:370 |
| | | | #: tutorial/controlflow.rst:536 |
| | | | msgid "Default Argument Values" |
| | | | msgstr "Valeur par défaut des arguments" |
| | | | |
| | | | #: tutorial/controlflow.rst:372 |
| | | | #: tutorial/controlflow.rst:538 |
| | | | msgid "" |
| | | | "The most useful form is to specify a default value for one or more " |
| | | | "arguments. This creates a function that can be called with fewer arguments " |
| | | | @ -470,12 +612,12 @@ msgstr "" |
| | | | "certains arguments. Ceci crée une fonction qui peut être appelée avec moins " |
| | | | "d'arguments que ceux présents dans sa définition. Par exemple ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:388 |
| | | | #: tutorial/controlflow.rst:554 |
| | | | msgid "This function can be called in several ways:" |
| | | | msgstr "Cette fonction peut être appelée de plusieurs façons :" |
| | | | |
| | | | # énumération --> pas de majuscule |
| | | | #: tutorial/controlflow.rst:390 |
| | | | #: tutorial/controlflow.rst:556 |
| | | | msgid "" |
| | | | "giving only the mandatory argument: ``ask_ok('Do you really want to quit?')``" |
| | | | msgstr "" |
| | | | @ -483,7 +625,7 @@ msgstr "" |
| | | | "want to quit?')`` ;" |
| | | | |
| | | | # énumération --> pas de majuscule et point-virgule en fin de proposition. |
| | | | #: tutorial/controlflow.rst:392 |
| | | | #: tutorial/controlflow.rst:558 |
| | | | msgid "" |
| | | | "giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', " |
| | | | "2)``" |
| | | | @ -492,7 +634,7 @@ msgstr "" |
| | | | "overwrite the file?', 2)`` ;" |
| | | | |
| | | | # fin d'énumération --> pas de majuscule et point final. |
| | | | #: tutorial/controlflow.rst:394 |
| | | | #: tutorial/controlflow.rst:560 |
| | | | msgid "" |
| | | | "or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come " |
| | | | "on, only yes or no!')``" |
| | | | @ -500,7 +642,7 @@ msgstr "" |
| | | | "en fournissant tous les arguments : ``ask_ok('OK to overwrite the file?', 2, " |
| | | | "'Come on, only yes or no!')``." |
| | | | |
| | | | #: tutorial/controlflow.rst:397 |
| | | | #: tutorial/controlflow.rst:563 |
| | | | msgid "" |
| | | | "This example also introduces the :keyword:`in` keyword. This tests whether " |
| | | | "or not a sequence contains a certain value." |
| | | | @ -508,7 +650,7 @@ msgstr "" |
| | | | "Cet exemple présente également le mot-clé :keyword:`in`. Celui-ci permet de " |
| | | | "tester si une séquence contient une certaine valeur." |
| | | | |
| | | | #: tutorial/controlflow.rst:400 |
| | | | #: tutorial/controlflow.rst:566 |
| | | | msgid "" |
| | | | "The default values are evaluated at the point of function definition in the " |
| | | | "*defining* scope, so that ::" |
| | | | @ -516,11 +658,11 @@ msgstr "" |
| | | | "Les valeurs par défaut sont évaluées lors de la définition de la fonction " |
| | | | "dans la portée de la *définition*, de telle sorte que ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:411 |
| | | | #: tutorial/controlflow.rst:577 |
| | | | msgid "will print ``5``." |
| | | | msgstr "affiche ``5``." |
| | | | |
| | | | #: tutorial/controlflow.rst:413 |
| | | | #: tutorial/controlflow.rst:579 |
| | | | msgid "" |
| | | | "**Important warning:** The default value is evaluated only once. This makes " |
| | | | "a difference when the default is a mutable object such as a list, " |
| | | | @ -534,11 +676,11 @@ msgstr "" |
| | | | "arguments qui lui sont passés au fil des appels successifs ::" |
| | | | |
| | | | # pas de majuscule : ok |
| | | | #: tutorial/controlflow.rst:426 |
| | | | #: tutorial/controlflow.rst:592 |
| | | | msgid "This will print ::" |
| | | | msgstr "affiche ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:432 |
| | | | #: tutorial/controlflow.rst:598 |
| | | | msgid "" |
| | | | "If you don't want the default to be shared between subsequent calls, you can " |
| | | | "write the function like this instead::" |
| | | | @ -546,11 +688,11 @@ msgstr "" |
| | | | "Si vous ne voulez pas que cette valeur par défaut soit partagée entre des " |
| | | | "appels successifs, vous pouvez écrire la fonction de cette façon ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:445 |
| | | | #: tutorial/controlflow.rst:611 |
| | | | msgid "Keyword Arguments" |
| | | | msgstr "Les arguments nommés" |
| | | | |
| | | | #: tutorial/controlflow.rst:447 |
| | | | #: tutorial/controlflow.rst:613 |
| | | | msgid "" |
| | | | "Functions can also be called using :term:`keyword arguments <keyword " |
| | | | "argument>` of the form ``kwarg=value``. For instance, the following " |
| | | | @ -560,7 +702,7 @@ msgstr "" |
| | | | "`arguments nommés <keyword argument>` sous la forme ``kwarg=value``. Par " |
| | | | "exemple, la fonction suivante ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:456 |
| | | | #: tutorial/controlflow.rst:622 |
| | | | msgid "" |
| | | | "accepts one required argument (``voltage``) and three optional arguments " |
| | | | "(``state``, ``action``, and ``type``). This function can be called in any " |
| | | | @ -570,11 +712,11 @@ msgstr "" |
| | | | "(``state``, ``action`` et ``type``). Cette fonction peut être appelée de " |
| | | | "n'importe laquelle des façons suivantes ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:467 |
| | | | #: tutorial/controlflow.rst:633 |
| | | | msgid "but all the following calls would be invalid::" |
| | | | msgstr "mais tous les appels qui suivent sont incorrects ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:474 |
| | | | #: tutorial/controlflow.rst:640 |
| | | | msgid "" |
| | | | "In a function call, keyword arguments must follow positional arguments. All " |
| | | | "the keyword arguments passed must match one of the arguments accepted by the " |
| | | | @ -593,7 +735,7 @@ msgstr "" |
| | | | "recevoir une valeur plus d'une fois, comme l'illustre cet exemple incorrect " |
| | | | "du fait de cette restriction ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:490 |
| | | | #: tutorial/controlflow.rst:656 |
| | | | msgid "" |
| | | | "When a final formal parameter of the form ``**name`` is present, it receives " |
| | | | "a dictionary (see :ref:`typesmapping`) containing all keyword arguments " |
| | | | @ -612,15 +754,15 @@ msgstr "" |
| | | | "formels (``*name`` doit être présent avant ``**name``). Par exemple, si vous " |
| | | | "définissez une fonction comme ceci ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:507 |
| | | | #: tutorial/controlflow.rst:673 |
| | | | msgid "It could be called like this::" |
| | | | msgstr "Elle pourrait être appelée comme ceci ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:515 |
| | | | #: tutorial/controlflow.rst:681 |
| | | | msgid "and of course it would print:" |
| | | | msgstr "et, bien sûr, elle affiche :" |
| | | | |
| | | | #: tutorial/controlflow.rst:528 |
| | | | #: tutorial/controlflow.rst:694 |
| | | | msgid "" |
| | | | "Note that the order in which the keyword arguments are printed is guaranteed " |
| | | | "to match the order in which they were provided in the function call." |
| | | | @ -628,11 +770,11 @@ msgstr "" |
| | | | "Notez que Python garantit que l'ordre d'affichage des arguments est le même " |
| | | | "que l'ordre dans lesquels ils sont fournis lors de l'appel à la fonction." |
| | | | |
| | | | #: tutorial/controlflow.rst:532 |
| | | | #: tutorial/controlflow.rst:698 |
| | | | msgid "Special parameters" |
| | | | msgstr "Paramètres spéciaux" |
| | | | |
| | | | #: tutorial/controlflow.rst:534 |
| | | | #: tutorial/controlflow.rst:700 |
| | | | msgid "" |
| | | | "By default, arguments may be passed to a Python function either by position " |
| | | | "or explicitly by keyword. For readability and performance, it makes sense to " |
| | | | @ -647,11 +789,11 @@ msgstr "" |
| | | | "définition de la fonction pour déterminer si les éléments sont transmis par " |
| | | | "position seule, par position ou nommé, ou seulement nommé." |
| | | | |
| | | | #: tutorial/controlflow.rst:540 |
| | | | #: tutorial/controlflow.rst:706 |
| | | | msgid "A function definition may look like:" |
| | | | msgstr "Voici à quoi ressemble une définition de fonction :" |
| | | | |
| | | | #: tutorial/controlflow.rst:551 |
| | | | #: tutorial/controlflow.rst:717 |
| | | | msgid "" |
| | | | "where ``/`` and ``*`` are optional. If used, these symbols indicate the kind " |
| | | | "of parameter by how the arguments may be passed to the function: positional-" |
| | | | @ -663,11 +805,11 @@ msgstr "" |
| | | | "fonction : position seule, position ou nommé, et seulement nommé. Les " |
| | | | "paramètres par mot-clé sont aussi appelés paramètres nommés." |
| | | | |
| | | | #: tutorial/controlflow.rst:558 |
| | | | #: tutorial/controlflow.rst:724 |
| | | | msgid "Positional-or-Keyword Arguments" |
| | | | msgstr "Les arguments positionnels-ou-nommés" |
| | | | |
| | | | #: tutorial/controlflow.rst:560 |
| | | | #: tutorial/controlflow.rst:726 |
| | | | msgid "" |
| | | | "If ``/`` and ``*`` are not present in the function definition, arguments may " |
| | | | "be passed to a function by position or by keyword." |
| | | | @ -675,11 +817,11 @@ msgstr "" |
| | | | "Si ``/`` et ``*`` ne sont pas présents dans la définition de fonction, les " |
| | | | "arguments peuvent être passés à une fonction par position ou par nommés." |
| | | | |
| | | | #: tutorial/controlflow.rst:565 |
| | | | #: tutorial/controlflow.rst:731 |
| | | | msgid "Positional-Only Parameters" |
| | | | msgstr "Paramètres positionnels uniquement" |
| | | | |
| | | | #: tutorial/controlflow.rst:567 |
| | | | #: tutorial/controlflow.rst:733 |
| | | | msgid "" |
| | | | "Looking at this in a bit more detail, it is possible to mark certain " |
| | | | "parameters as *positional-only*. If *positional-only*, the parameters' order " |
| | | | @ -698,7 +840,7 @@ msgstr "" |
| | | | "des paramètres. S'il n'y a pas de ``/`` dans la définition de fonction, il " |
| | | | "n'y a pas de paramètres « positionnels uniquement »." |
| | | | |
| | | | #: tutorial/controlflow.rst:575 |
| | | | #: tutorial/controlflow.rst:741 |
| | | | msgid "" |
| | | | "Parameters following the ``/`` may be *positional-or-keyword* or *keyword-" |
| | | | "only*." |
| | | | @ -706,11 +848,11 @@ msgstr "" |
| | | | "Les paramètres qui suivent le ``/`` peuvent être *positionnels-ou-nommés* ou " |
| | | | "*nommés-uniquement*." |
| | | | |
| | | | #: tutorial/controlflow.rst:579 |
| | | | #: tutorial/controlflow.rst:745 |
| | | | msgid "Keyword-Only Arguments" |
| | | | msgstr "Arguments nommés uniquement" |
| | | | |
| | | | #: tutorial/controlflow.rst:581 |
| | | | #: tutorial/controlflow.rst:747 |
| | | | msgid "" |
| | | | "To mark parameters as *keyword-only*, indicating the parameters must be " |
| | | | "passed by keyword argument, place an ``*`` in the arguments list just before " |
| | | | @ -721,11 +863,11 @@ msgstr "" |
| | | | "``*`` dans la liste des arguments juste avant le premier paramètre " |
| | | | "*uniquement nommé*." |
| | | | |
| | | | #: tutorial/controlflow.rst:587 |
| | | | #: tutorial/controlflow.rst:753 |
| | | | msgid "Function Examples" |
| | | | msgstr "Exemples de fonctions" |
| | | | |
| | | | #: tutorial/controlflow.rst:589 |
| | | | #: tutorial/controlflow.rst:755 |
| | | | msgid "" |
| | | | "Consider the following example function definitions paying close attention " |
| | | | "to the markers ``/`` and ``*``::" |
| | | | @ -733,7 +875,7 @@ msgstr "" |
| | | | "Considérons l'exemple suivant de définitions de fonctions en portant une " |
| | | | "attention particulière aux marqueurs ``/`` et ``*`` ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:605 |
| | | | #: tutorial/controlflow.rst:771 |
| | | | msgid "" |
| | | | "The first function definition, ``standard_arg``, the most familiar form, " |
| | | | "places no restrictions on the calling convention and arguments may be passed " |
| | | | @ -743,7 +885,7 @@ msgstr "" |
| | | | "familière, n'impose aucune restriction sur la convention d'appel et les " |
| | | | "arguments peuvent être passés par position ou nommés ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:615 |
| | | | #: tutorial/controlflow.rst:781 |
| | | | msgid "" |
| | | | "The second function ``pos_only_arg`` is restricted to only use positional " |
| | | | "parameters as there is a ``/`` in the function definition::" |
| | | | @ -751,7 +893,7 @@ msgstr "" |
| | | | "La deuxième fonction ``pos_only_arg`` restreint le passage aux seuls " |
| | | | "arguments par position car il y a un ``/`` dans la définition de fonction ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:626 |
| | | | #: tutorial/controlflow.rst:792 |
| | | | msgid "" |
| | | | "The third function ``kwd_only_args`` only allows keyword arguments as " |
| | | | "indicated by a ``*`` in the function definition::" |
| | | | @ -759,7 +901,7 @@ msgstr "" |
| | | | "La troisième fonction ``kwd_only_args`` n'autorise que les arguments nommés " |
| | | | "comme l'indique le ``*`` dans la définition de fonction ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:637 |
| | | | #: tutorial/controlflow.rst:803 |
| | | | msgid "" |
| | | | "And the last uses all three calling conventions in the same function " |
| | | | "definition::" |
| | | | @ -767,7 +909,7 @@ msgstr "" |
| | | | "Et la dernière utilise les trois conventions d'appel dans la même définition " |
| | | | "de fonction ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:657 |
| | | | #: tutorial/controlflow.rst:823 |
| | | | msgid "" |
| | | | "Finally, consider this function definition which has a potential collision " |
| | | | "between the positional argument ``name`` and ``**kwds`` which has ``name`` " |
| | | | @ -777,7 +919,7 @@ msgstr "" |
| | | | "potentielle entre l'argument positionnel ``name`` et ``**kwds`` qui a " |
| | | | "``name`` comme mot-clé ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:662 |
| | | | #: tutorial/controlflow.rst:828 |
| | | | msgid "" |
| | | | "There is no possible call that will make it return ``True`` as the keyword " |
| | | | "``'name'`` will always bind to the first parameter. For example::" |
| | | | @ -785,7 +927,7 @@ msgstr "" |
| | | | "Il n'y a pas d'appel possible qui renvoie ``True`` car le mot-clé ``'name'`` " |
| | | | "est toujours lié au premier paramètre. Par exemple ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:671 |
| | | | #: tutorial/controlflow.rst:837 |
| | | | msgid "" |
| | | | "But using ``/`` (positional only arguments), it is possible since it allows " |
| | | | "``name`` as a positional argument and ``'name'`` as a key in the keyword " |
| | | | @ -795,7 +937,7 @@ msgstr "" |
| | | | "puisqu'il permet d'utiliser ``name`` comme argument positionnel et " |
| | | | "``'name'`` comme mot-clé dans les arguments nommés ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:678 |
| | | | #: tutorial/controlflow.rst:844 |
| | | | msgid "" |
| | | | "In other words, the names of positional-only parameters can be used in " |
| | | | "``**kwds`` without ambiguity." |
| | | | @ -803,11 +945,11 @@ msgstr "" |
| | | | "En d'autres termes, les noms des paramètres seulement positionnels peuvent " |
| | | | "être utilisés sans ambiguïté dans ``**kwds``." |
| | | | |
| | | | #: tutorial/controlflow.rst:683 |
| | | | #: tutorial/controlflow.rst:849 |
| | | | msgid "Recap" |
| | | | msgstr "Récapitulatif" |
| | | | |
| | | | #: tutorial/controlflow.rst:685 |
| | | | #: tutorial/controlflow.rst:851 |
| | | | msgid "" |
| | | | "The use case will determine which parameters to use in the function " |
| | | | "definition::" |
| | | | @ -815,12 +957,12 @@ msgstr "" |
| | | | "Le cas d'utilisation détermine les paramètres à utiliser dans la définition " |
| | | | "de fonction ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:689 |
| | | | #: tutorial/controlflow.rst:855 |
| | | | msgid "As guidance:" |
| | | | msgstr "Quelques conseils :" |
| | | | |
| | | | # énumération --> pas de majuscule et point-virgule en fin de proposition. |
| | | | #: tutorial/controlflow.rst:691 |
| | | | #: tutorial/controlflow.rst:857 |
| | | | msgid "" |
| | | | "Use positional-only if you want the name of the parameters to not be " |
| | | | "available to the user. This is useful when parameter names have no real " |
| | | | @ -835,7 +977,7 @@ msgstr "" |
| | | | "de prendre certains paramètres positionnels et mots-clés arbitraires ;" |
| | | | |
| | | | # énumération --> pas de majuscule et point-virgule en fin de proposition. |
| | | | #: tutorial/controlflow.rst:696 |
| | | | #: tutorial/controlflow.rst:862 |
| | | | msgid "" |
| | | | "Use keyword-only when names have meaning and the function definition is more " |
| | | | "understandable by being explicit with names or you want to prevent users " |
| | | | @ -847,7 +989,7 @@ msgstr "" |
| | | | "l'argument qui est passé ;" |
| | | | |
| | | | # fin d'énumération |
| | | | #: tutorial/controlflow.rst:699 |
| | | | #: tutorial/controlflow.rst:865 |
| | | | msgid "" |
| | | | "For an API, use positional-only to prevent breaking API changes if the " |
| | | | "parameter's name is modified in the future." |
| | | | @ -855,11 +997,11 @@ msgstr "" |
| | | | "dans le cas d'une API, utilisez les paramètres seulement positionnels pour " |
| | | | "éviter de casser l'API si le nom du paramètre est modifié dans l'avenir." |
| | | | |
| | | | #: tutorial/controlflow.rst:705 |
| | | | #: tutorial/controlflow.rst:871 |
| | | | msgid "Arbitrary Argument Lists" |
| | | | msgstr "Listes d'arguments arbitraires" |
| | | | |
| | | | #: tutorial/controlflow.rst:710 |
| | | | #: tutorial/controlflow.rst:876 |
| | | | msgid "" |
| | | | "Finally, the least frequently used option is to specify that a function can " |
| | | | "be called with an arbitrary number of arguments. These arguments will be " |
| | | | @ -872,7 +1014,7 @@ msgstr "" |
| | | | "nombre variable d'arguments, zéro ou plus arguments normaux peuvent " |
| | | | "apparaître ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:719 |
| | | | #: tutorial/controlflow.rst:885 |
| | | | msgid "" |
| | | | "Normally, these ``variadic`` arguments will be last in the list of formal " |
| | | | "parameters, because they scoop up all remaining input arguments that are " |
| | | | @ -884,11 +1026,11 @@ msgstr "" |
| | | | "parce qu'ils agrègent toutes les valeurs suivantes. Tout paramètre placé " |
| | | | "après le paramètre ``*arg`` ne pourra être utilisé que par son nom ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:736 |
| | | | #: tutorial/controlflow.rst:902 |
| | | | msgid "Unpacking Argument Lists" |
| | | | msgstr "Séparation des listes d'arguments" |
| | | | |
| | | | #: tutorial/controlflow.rst:738 |
| | | | #: tutorial/controlflow.rst:904 |
| | | | msgid "" |
| | | | "The reverse situation occurs when the arguments are already in a list or " |
| | | | "tuple but need to be unpacked for a function call requiring separate " |
| | | | @ -905,7 +1047,7 @@ msgstr "" |
| | | | "l'opérateur ``*`` pour séparer les arguments présents dans une liste ou un " |
| | | | "*n*-uplet ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:754 |
| | | | #: tutorial/controlflow.rst:920 |
| | | | msgid "" |
| | | | "In the same fashion, dictionaries can deliver keyword arguments with the " |
| | | | "``**``\\ -operator::" |
| | | | @ -913,11 +1055,11 @@ msgstr "" |
| | | | "De la même façon, les dictionnaires peuvent fournir des arguments nommés en " |
| | | | "utilisant l'opérateur ``**`` ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:770 |
| | | | #: tutorial/controlflow.rst:936 |
| | | | msgid "Lambda Expressions" |
| | | | msgstr "Fonctions anonymes" |
| | | | |
| | | | #: tutorial/controlflow.rst:772 |
| | | | #: tutorial/controlflow.rst:938 |
| | | | msgid "" |
| | | | "Small anonymous functions can be created with the :keyword:`lambda` keyword. " |
| | | | "This function returns the sum of its two arguments: ``lambda a, b: a+b``. " |
| | | | @ -935,7 +1077,7 @@ msgstr "" |
| | | | "définition de fonction normale. Comme les fonctions imbriquées, les " |
| | | | "fonctions lambda peuvent référencer des variables de la portée englobante ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:789 |
| | | | #: tutorial/controlflow.rst:955 |
| | | | msgid "" |
| | | | "The above example uses a lambda expression to return a function. Another " |
| | | | "use is to pass a small function as an argument::" |
| | | | @ -944,11 +1086,11 @@ msgstr "" |
| | | | "Une autre utilisation classique est de donner une fonction minimaliste " |
| | | | "directement en tant que paramètre ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:801 |
| | | | #: tutorial/controlflow.rst:967 |
| | | | msgid "Documentation Strings" |
| | | | msgstr "Chaînes de documentation" |
| | | | |
| | | | #: tutorial/controlflow.rst:808 |
| | | | #: tutorial/controlflow.rst:974 |
| | | | msgid "" |
| | | | "Here are some conventions about the content and formatting of documentation " |
| | | | "strings." |
| | | | @ -956,7 +1098,7 @@ msgstr "" |
| | | | "Voici quelques conventions concernant le contenu et le format des chaînes de " |
| | | | "documentation." |
| | | | |
| | | | #: tutorial/controlflow.rst:811 |
| | | | #: tutorial/controlflow.rst:977 |
| | | | msgid "" |
| | | | "The first line should always be a short, concise summary of the object's " |
| | | | "purpose. For brevity, it should not explicitly state the object's name or " |
| | | | @ -970,7 +1112,7 @@ msgstr "" |
| | | | "si le nom est un verbe qui décrit une opération). La convention veut que la " |
| | | | "ligne commence par une majuscule et se termine par un point." |
| | | | |
| | | | #: tutorial/controlflow.rst:817 |
| | | | #: tutorial/controlflow.rst:983 |
| | | | msgid "" |
| | | | "If there are more lines in the documentation string, the second line should " |
| | | | "be blank, visually separating the summary from the rest of the description. " |
| | | | @ -982,7 +1124,7 @@ msgstr "" |
| | | | "Les autres lignes peuvent alors constituer un ou plusieurs paragraphes " |
| | | | "décrivant le mode d'utilisation de l'objet, ses effets de bord, etc." |
| | | | |
| | | | #: tutorial/controlflow.rst:822 |
| | | | #: tutorial/controlflow.rst:988 |
| | | | msgid "" |
| | | | "The Python parser does not strip indentation from multi-line string literals " |
| | | | "in Python, so tools that process documentation have to strip indentation if " |
| | | | @ -1010,15 +1152,15 @@ msgstr "" |
| | | | "début de ligne doivent être supprimées. L'équivalent des espaces doit être " |
| | | | "testé après expansion des tabulations (normalement remplacées par 8 espaces)." |
| | | | |
| | | | #: tutorial/controlflow.rst:834 |
| | | | #: tutorial/controlflow.rst:1000 |
| | | | msgid "Here is an example of a multi-line docstring::" |
| | | | msgstr "Voici un exemple de chaîne de documentation multi-lignes ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:852 |
| | | | #: tutorial/controlflow.rst:1018 |
| | | | msgid "Function Annotations" |
| | | | msgstr "Annotations de fonctions" |
| | | | |
| | | | #: tutorial/controlflow.rst:860 |
| | | | #: tutorial/controlflow.rst:1026 |
| | | | msgid "" |
| | | | ":ref:`Function annotations <function>` are completely optional metadata " |
| | | | "information about the types used by user-defined functions (see :pep:`3107` " |
| | | | @ -1028,7 +1170,7 @@ msgstr "" |
| | | | "optionnelles décrivant les types utilisés par une fonction définie par " |
| | | | "l'utilisateur (voir les :pep:`3107` et :pep:`484` pour plus d'informations)." |
| | | | |
| | | | #: tutorial/controlflow.rst:864 |
| | | | #: tutorial/controlflow.rst:1030 |
| | | | msgid "" |
| | | | ":term:`Annotations <function annotation>` are stored in the :attr:" |
| | | | "`__annotations__` attribute of the function as a dictionary and have no " |
| | | | @ -1048,11 +1190,11 @@ msgstr "" |
| | | | "points de fin de l'instruction :keyword:`def`. L'exemple suivant a un " |
| | | | "paramètre requis, un paramètre optionnel et la valeur de retour annotés ::" |
| | | | |
| | | | #: tutorial/controlflow.rst:886 |
| | | | #: tutorial/controlflow.rst:1052 |
| | | | msgid "Intermezzo: Coding Style" |
| | | | msgstr "Aparté : le style de codage" |
| | | | |
| | | | #: tutorial/controlflow.rst:891 |
| | | | #: tutorial/controlflow.rst:1057 |
| | | | msgid "" |
| | | | "Now that you are about to write longer, more complex pieces of Python, it is " |
| | | | "a good time to talk about *coding style*. Most languages can be written (or " |
| | | | @ -1067,7 +1209,7 @@ msgstr "" |
| | | | "votre code plus facile aux autres est toujours une bonne idée et adopter un " |
| | | | "bon style de codage peut énormément vous y aider." |
| | | | |
| | | | #: tutorial/controlflow.rst:897 |
| | | | #: tutorial/controlflow.rst:1063 |
| | | | msgid "" |
| | | | "For Python, :pep:`8` has emerged as the style guide that most projects " |
| | | | "adhere to; it promotes a very readable and eye-pleasing coding style. Every " |
| | | | @ -1079,11 +1221,11 @@ msgstr "" |
| | | | "Chaque développeur Python se doit donc de la lire et de s'en inspirer autant " |
| | | | "que possible ; voici ses principaux points notables :" |
| | | | |
| | | | #: tutorial/controlflow.rst:902 |
| | | | #: tutorial/controlflow.rst:1068 |
| | | | msgid "Use 4-space indentation, and no tabs." |
| | | | msgstr "Utilisez des indentations de 4 espaces et pas de tabulation." |
| | | | |
| | | | #: tutorial/controlflow.rst:904 |
| | | | #: tutorial/controlflow.rst:1070 |
| | | | msgid "" |
| | | | "4 spaces are a good compromise between small indentation (allows greater " |
| | | | "nesting depth) and large indentation (easier to read). Tabs introduce " |
| | | | @ -1094,13 +1236,13 @@ msgstr "" |
| | | | "le code plus facile à lire). Les tabulations introduisent de la confusion et " |
| | | | "doivent être proscrites autant que possible." |
| | | | |
| | | | #: tutorial/controlflow.rst:908 |
| | | | #: tutorial/controlflow.rst:1074 |
| | | | msgid "Wrap lines so that they don't exceed 79 characters." |
| | | | msgstr "" |
| | | | "Faites en sorte que les lignes ne dépassent pas 79 caractères, au besoin en " |
| | | | "insérant des retours à la ligne." |
| | | | |
| | | | #: tutorial/controlflow.rst:910 |
| | | | #: tutorial/controlflow.rst:1076 |
| | | | msgid "" |
| | | | "This helps users with small displays and makes it possible to have several " |
| | | | "code files side-by-side on larger displays." |
| | | | @ -1109,7 +1251,7 @@ msgstr "" |
| | | | "écran et, pour les autres, cela leur permet de visualiser plusieurs fichiers " |
| | | | "côte à côte." |
| | | | |
| | | | #: tutorial/controlflow.rst:913 |
| | | | #: tutorial/controlflow.rst:1079 |
| | | | msgid "" |
| | | | "Use blank lines to separate functions and classes, and larger blocks of code " |
| | | | "inside functions." |
| | | | @ -1117,16 +1259,16 @@ msgstr "" |
| | | | "Utilisez des lignes vides pour séparer les fonctions et les classes, ou pour " |
| | | | "scinder de gros blocs de code à l'intérieur de fonctions." |
| | | | |
| | | | #: tutorial/controlflow.rst:916 |
| | | | #: tutorial/controlflow.rst:1082 |
| | | | msgid "When possible, put comments on a line of their own." |
| | | | msgstr "" |
| | | | "Lorsque c'est possible, placez les commentaires sur leurs propres lignes." |
| | | | |
| | | | #: tutorial/controlflow.rst:918 |
| | | | #: tutorial/controlflow.rst:1084 |
| | | | msgid "Use docstrings." |
| | | | msgstr "Utilisez les chaînes de documentation." |
| | | | |
| | | | #: tutorial/controlflow.rst:920 |
| | | | #: tutorial/controlflow.rst:1086 |
| | | | msgid "" |
| | | | "Use spaces around operators and after commas, but not directly inside " |
| | | | "bracketing constructs: ``a = f(1, 2) + g(3, 4)``." |
| | | | @ -1134,7 +1276,7 @@ msgstr "" |
| | | | "Utilisez des espaces autour des opérateurs et après les virgules, mais pas " |
| | | | "juste à l'intérieur des parenthèses : ``a = f(1, 2) + g(3, 4)``." |
| | | | |
| | | | #: tutorial/controlflow.rst:923 |
| | | | #: tutorial/controlflow.rst:1089 |
| | | | msgid "" |
| | | | "Name your classes and functions consistently; the convention is to use " |
| | | | "``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for " |
| | | | @ -1147,7 +1289,7 @@ msgstr "" |
| | | | "toujours ``self`` comme nom du premier argument des méthodes (voyez :ref:" |
| | | | "`tut-firstclasses` pour en savoir plus sur les classes et les méthodes)." |
| | | | |
| | | | #: tutorial/controlflow.rst:928 |
| | | | #: tutorial/controlflow.rst:1094 |
| | | | msgid "" |
| | | | "Don't use fancy encodings if your code is meant to be used in international " |
| | | | "environments. Python's default, UTF-8, or even plain ASCII work best in any " |
| | | | @ -1157,7 +1299,7 @@ msgstr "" |
| | | | "utilisé dans des environnements internationaux. Par défaut, Python travaille " |
| | | | "en UTF-8. Pour couvrir tous les cas, préférez le simple ASCII." |
| | | | |
| | | | #: tutorial/controlflow.rst:932 |
| | | | #: tutorial/controlflow.rst:1098 |
| | | | msgid "" |
| | | | "Likewise, don't use non-ASCII characters in identifiers if there is only the " |
| | | | "slightest chance people speaking a different language will read or maintain " |
| | | | @ -1167,11 +1309,11 @@ msgstr "" |
| | | | "variables s'il est envisageable qu'une personne parlant une autre langue " |
| | | | "lise ou doive modifier votre code." |
| | | | |
| | | | #: tutorial/controlflow.rst:938 |
| | | | #: tutorial/controlflow.rst:1104 |
| | | | msgid "Footnotes" |
| | | | msgstr "Notes" |
| | | | |
| | | | #: tutorial/controlflow.rst:939 |
| | | | #: tutorial/controlflow.rst:1105 |
| | | | msgid "" |
| | | | "Actually, *call by object reference* would be a better description, since if " |
| | | | "a mutable object is passed, the caller will see any changes the callee makes " |
| | | | @ -1181,3 +1323,10 @@ msgstr "" |
| | | | "plus juste dans la mesure où, si un objet muable est passé en argument, " |
| | | | "l'appelant verra toutes les modifications qui lui auront été apportées par " |
| | | | "l'appelé (insertion d'éléments dans une liste…)." |
| | | | |
| | | | #~ msgid "" |
| | | | #~ "In chapter :ref:`tut-structures`, we will discuss in more detail about :" |
| | | | #~ "func:`list`." |
| | | | #~ msgstr "" |
| | | | #~ "Dans le chapitre :ref:`tut-structures`, nous discuterons plus en détail " |
| | | | #~ "sur :func:`list`." |
| | | |
|