Skip to content

Update python_essentials.md - #93

Open
Honaminto wants to merge 1 commit into
mainfrom
Honaminto-patch-5
Open

Honaminto wants to merge 1 commit into
mainfrom
Honaminto-patch-5

Conversation

@Honaminto

@Honaminto Honaminto commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Review of the French translation of Fondamentaux de Python

Fix

  1. (Line 164). The English says "without brackets" for a tuple, but the French says "crochets" (square brackets). In French, a tuple is written with parentheses, so I changed it to "parenthèses".

    Before: x = 'a', 'b' # Ou sans crochets --- la signification est identique

    After: x = 'a', 'b' # Ou sans parenthèses --- la signification est identique

  2. (Line 337). The file name is wrong here. The code above writes newfile.txt, so the text should refer to that file. The same slip exists in the English source, which I will report separately.

    Before: Nous pouvons également utiliser Python pour lire le contenu de `newline.txt` comme suit

    After: Nous pouvons également utiliser Python pour lire le contenu de `newfile.txt` comme suit

  3. (Line 414). The sentence started with a lowercase letter and read like a fragment. I added the capital, a comma before the relative clause, and French quotation marks around the English term.

    Before: nous pouvons passer au mode `a` qui signifie mode d'ajout (append)

    After: Nous pouvons passer au mode `a`, qui correspond au mode d'ajout (« append »).

  4. (Line 892). The coefficients start at a_0, not a_1, since the polynomial in the equation above has a constant term. The English source has the same mistake, which I will also report.

    Before: Écrivez une fonction `p` telle que `p(x, coeff)` calcule la valeur dans {eq}`polynom0` étant donné un point `x` et une liste de coefficients `coeff` ($a_1, a_2, \cdots a_n$).

    After: Écrivez une fonction `p` telle que `p(x, coeff)` calcule la valeur dans {eq}`polynom0` étant donné un point `x` et une liste de coefficients `coeff` ($a_0, a_1, \cdots a_n$).

  5. (Line 1008). sets is not a Python type, since the type is set. I replaced it with the French term and put the real name in code.

    Before: Bien sûr, si nous utilisons le type de données `sets`, la solution est plus facile

    After: Bien sûr, si nous utilisons le type ensemble (`set`), la solution est plus facile

  6. (Line 489). .title() capitalizes every word, not just the first one, so I reworded "Mettre en majuscule les noms de ville", which was slightly off.

    Before: city = city.title() # Mettre en majuscule les noms de ville

    After: city = city.title() # Mettre une majuscule à chaque mot des noms de ville

7.( Line 495). The f is a prefix placed before the quote, and the f' in the French suggests the quote is part of it. I also replaced "variables" with "valeurs", because an f-string inserts values, and added "de caractères" to match the usual wording.

Before: Ici `f'` est une f-string [utilisée pour insérer des variables dans des chaînes](https://docs.python.org/3/library/string.html#formatspec).

After: Ici, le préfixe `f` indique une f-string, [utilisée pour insérer des valeurs dans des chaînes de caractères](https://docs.python.org/3/library/string.html#formatspec).

  1. (Line 738). Docstrings are documentation, not comments, so "ajouter des commentaires" was misleading. I used "chaînes de documentation" and kept the English term in italics.

    Before: Python dispose d'un système pour ajouter des commentaires aux modules, classes, fonctions, etc. appelé *docstrings*.

    After: Python dispose d'un système permettant d'ajouter de la documentation aux modules, classes, fonctions, etc. à l'aide de chaînes de documentation (*docstrings*).

  2. (Line 650.) The original reads as if the expressions are "equivalent to False" in a list that mixes zero, containers and None. The meaning is that they are treated as False, so I reworded it and fixed the agreement.

    Before: * Les expressions qui s'évaluent à zéro, à des séquences ou conteneurs vides (chaînes, listes, etc.) et `None` sont toutes équivalentes à `False`.

    After: * Les expressions qui s'évaluent à zéro, les séquences ou conteneurs vides (chaînes, listes, etc.) ainsi que `None` sont tous considérés comme `False`.

Terminology and style

  1. (Line 60.) I replaced "suivent" with "manipulent", because programs manipulate data types rather than follow them.

    Before: Les programmes informatiques suivent généralement toute une gamme de types de données.

    After: Les programmes informatiques manipulent généralement toute une gamme de types de données.

  2. (Line 76.) I used "natifs" for "built-in", in line with the project's ruling on Proposal: review each remaining lecture as a fresh draft on its own PR #82. I also removed the repeated "Python".

    Before: Python fournit de nombreux autres types de données Python intégrés, dont certains que nous avons déjà rencontrés

    After: Python fournit de nombreux autres types de données natifs, dont certains que nous avons déjà rencontrés

  3. (Line 324.) I changed "intégrée" to "native" for consistency with Proposal: review each remaining lecture as a fresh draft on its own PR #82, and fixed the awkward "pour écrire dedans".

    Before: * La fonction intégrée `open()` crée un objet fichier pour écrire dedans.

    After: * La fonction native `open()` crée un objet fichier dans lequel écrire.

  4. (Line 795.) I applied the same term here, "fonction native".

    Before: (Pour certains, la fonction intégrée `sum()` s'avère pratique).

    After: (Pour certains, la fonction native `sum()` s'avère pratique).

  5. (Line 139.) These are Python types being named in prose, so I translated them as ordinary words instead of leaving them as code.

    Before: Nous avons déjà vu les types `integer` et `float`.

    After: Nous avons déjà vu les types entier et flottant.

  6. (Line 282.) "Mappées" is a calque, so I used "associées". I also replaced the code-formatted values with the French word in italics.

    Before: Les objets vers lesquels les clés sont mappées (`'Frodo'` et `33`) sont appelés les `values` (valeurs).

    After: Les objets auxquels les clés sont associées (`'Frodo'` et `33`) sont appelés les *valeurs*.

  7. (Line 950.) "Une alternative, solution plus pythonique" read as two nouns stuck together. I changed the order so it reads naturally.

    Before: Une alternative, solution plus pythonique :

    After: Une solution alternative, plus pythonique :

  8. (Line 995.) I made the same fix as in the previous item, with an extra comma before the participle.

    Before: Une alternative, solution plus pythonique utilisant `all()` :

    After: Une solution alternative, plus pythonique, utilisant `all()` :

Docstring translation

Following your comment on #84 and issue #88, I translated the explanatory docstrings and left code identifiers and executable output as they are.

  1. (Line 747.) I translated the docstring of f(x) in the code cell.

    Before: This function squares its argument

    After: Cette fonction élève son argument au carré.

  2. (Lines 765 and 782.) I also translated the output blocks that echo the same docstring, so they match the code cell. I left the labels in those blocks (Type, String Form, File, Definition, Source) in English because they come from IPython. I will raise this edge case on Code comments and docstrings in the French lectures: French or English? #88.

    Before (line 765): Docstring: This function squares its argument

    After (line 765): Docstring: Cette fonction élève son argument au carré.

    Before (line 782): This function squares its argument

    After (line 782): Cette fonction élève son argument au carré.

  3. (Lines 1047 to 1063.) I translated the docstring of linapprox in full. The section headings follow the numpydoc convention, so I changed "Parameters" to "Paramètres" and "Returns" to "Renvoie". I kept the ===== underlines as they were.

    Before:

        Evaluates the piecewise linear interpolant of f at x on the interval
        [a, b], with n evenly spaced grid points.

        Parameters
        ==========
            f : function
                The function to approximate

            x, a, b : scalars (floats or integers)
                Evaluation point and endpoints, with a <= x <= b

            n : integer
                Number of grid points

        Returns
        =======
            A float. The interpolant evaluated at x
After:
        Évalue l'interpolant linéaire par morceaux de f en x sur l'intervalle
        [a, b], avec n points de grille régulièrement espacés.

        Paramètres
        ==========
            f : fonction
                La fonction à approximer

            x, a, b : scalaires (flottants ou entiers)
                Point d'évaluation et bornes, avec a <= x <= b

            n : entier
                Nombre de points de grille

        Renvoie
        =======
            Un flottant. L'interpolant évalué en x

@Honaminto

Copy link
Copy Markdown
Collaborator Author

Hi @mmcky, Three things I'd like your input on:

  1. Following your comment on Update about_py.md #84 and issue Code comments and docstrings in the French lectures: French or English? #88, I translated the explanatory docstrings (the f(x) cell and linapprox). The output blocks that echo the f(x) docstring (lines 765 and 782) are static IPython output. I translated the docstring text there so it matches the code cell, but I left the labels (Type, String Form, File, Definition, Source) in English because they come from IPython. Is that the right call, or would you rather leave those output blocks entirely in English?

  2. Since remaining lectures are now redrafted from the current English, will you keep this lecture as it is, or redraft it too? I opened the PR on the same basis as Update about_py.md #84 and Update getting_started.md #85, so these corrections are not lost either way.

  3. A few problems come from the English source, so I did not treat them as French-only issues: newline.txt instead of newfile.txt (item 2), the coefficient range starting at a_1 instead of a_0 (item 4), and sets instead of set (item 5). I fixed them in the French so it is correct now. I'll report them on the English repo so the source gets corrected as well.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant