Review of the French translation of Names and Namespaces - #80
Conversation
|
Thanks Emile — the failed preview build here wasn't caused by your edits. This PR's branch is your fork's I've updated your branch from A tip for future reviews: click Sync fork on your fork before starting a new chapter, or start each chapter on a fresh branch from an up-to-date |
|
@Honaminto — we've sent you write access to this repository. GitHub has issued an invitation, which you can accept here: https://github.com/QuantEcon/lecture-python-programming.fr/invitations (it expires on 30 September if not accepted). Two earlier invitations, sent through the QuantEcon organisation's French translation team, expired before they reached you, so this one is a direct invitation to this repository. Once you accept, you can create branches here directly rather than working from your fork, and as the edition's editor of record you'll be able to approve and merge pull requests. |
names.md carried U+00A0 before `?` and `:` on eight lines (61, 85, 228, 308, 342, 417, 450, 504); the edit replaced every one with a plain space. Restored with action-translation's `scripts/typography/apply.mjs --lang fr`, which changes exactly these eight lines and nothing else. No wording changes. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mmcky
left a comment
There was a problem hiding this comment.
Thank you Emile — this was a big one, and the namespace change was well worth making. The official French tutorial uses « espace de nommage » throughout, and fresh translations from the tool still produce « espace de noms » every time, so once this merges we'll add it to the French glossary and bring the four remaining « espace de noms » in other chapters into line.
Your builtins and %run corrections fix errors in the English source too, so we'll get those corrected upstream — otherwise a future sync could undo them here.
I've pushed one fix-up commit to your branch (c5d5185): the edit replaced the eight non-breaking spaces before ? and : in this file with ordinary spaces (probably the find-and-replace), so I've restored them. No wording changes. With that in, this is ready — merging now. Thank you again for such a careful review.
One question: this chapter now uses « fonctions natives », « l'espace de nommage des primitives » and « natif », while functions and oop_intro keep « fonction intégrée ». Would you like native / natif everywhere for Python's built-ins, including the Functions heading? And for the built-in namespace, « des primitives » or « natif »?
…, plus two hand-ports Brings the rest of the edition into line with the editor's round-2 rulings (#77, #78, #80), following the #26 pattern: - « espace de noms » -> « espace de nommage » (#80, per the official French Python docs): oop_intro.md:398, scipy.md:88, python_oop.md:262/296. The adjective at oop_intro.md:398 stays « intégré » pending the editor's built-in ruling. - « retourner » -> « renvoyer » for returned values (#80): pandas_panel.md:466/475/479/517/523, polars.md:546. - functions.md:348: the English "standard normals" are draws, so « variables normales centrées réduites », not « lois ». Hand-ports: - numpy.md:1296: `discreteRV` -> `DiscreteRV`, the QuantEcon/lecture-python-programming#604 edit that never arrived (the numpy.md sync fails structural parity until the source's duplicated {index} is removed). - sympy.md: repair the garbled seed anchor `(sympy=` and drop the duplicate `(sympy)=` added before the title, matching the source pre-title. No typography changes (apply.mjs --dry-run: 0/27). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…, plus two hand-ports (#81) * Round-2 consistency pass: namespace and renvoyer rulings edition-wide, plus two hand-ports Brings the rest of the edition into line with the editor's round-2 rulings (#77, #78, #80), following the #26 pattern: - « espace de noms » -> « espace de nommage » (#80, per the official French Python docs): oop_intro.md:398, scipy.md:88, python_oop.md:262/296. The adjective at oop_intro.md:398 stays « intégré » pending the editor's built-in ruling. - « retourner » -> « renvoyer » for returned values (#80): pandas_panel.md:466/475/479/517/523, polars.md:546. - functions.md:348: the English "standard normals" are draws, so « variables normales centrées réduites », not « lois ». Hand-ports: - numpy.md:1296: `discreteRV` -> `DiscreteRV`, the QuantEcon/lecture-python-programming#604 edit that never arrived (the numpy.md sync fails structural parity until the source's duplicated {index} is removed). - sympy.md: repair the garbled seed anchor `(sympy=` and drop the duplicate `(sympy)=` added before the title, matching the source pre-title. No typography changes (apply.mjs --dry-run: 0/27). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * python_oop.md: `__init_` -> `__init__` A one-character typo carried over from the English source (QuantEcon/lecture-python-programming python_oop.md:243, listed in QuantEcon/lecture-python-programming#633). Raised by Copilot review. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
For this one, I think we should standardize on “fonction(s) native(s) ” for Python’s built-ins. This is the terminology used in the official French Python documentation, so I’d prefer it over “fonction intégrée” for consistency. Official French Python documentation: The page is titled “Fonctions natives” and also refers to “fonctions et types natifs.” For the built-in namespace, I’d use “l’espace de nommage contenant les primitives”, which is also the wording used in the official French Python tutorial: https://docs.python.org/fr/3/tutorial/classes.html#python-scopes-and-namespaces So I’d go with:
I think it makes sense to apply these consistently across the chapters. |
Review of the French translation of Names and Namespaces
__builtins__section, line 344 – wrong module name for Python 3Ces définitions sont stockées dans un module appelé \builtin`.`Ces définitions sont fournies par le module \builtins`.`__builtin__(no s, double underscore) was the Python 2 name. Python 3 calls itbuiltins. This isn't really a translation choice, the English source has the same mistake and probably deserves a note upstream too.Cela déclenche le ramassage de \'foo'` par le garbage collector.`Cela entraîne la récupération de \'foo'` par le ramasse-miettes.`The French term used by the official docs is ramasse-miettes. Leaving it in English here, then calling it ramassage des ordures two paragraphs down, made it read like two different concepts.
Le ramassage des ordures (garbage collection) est en réalité un domaine de recherche actif en informatique.Le fonctionnement des ramasse-miettes est encore un domaine de recherche actif en informatique.Ramassage des ordures is a literal calque of "garbage collection" and isn't the term French Python docs actually use.
Vous pouvez en lire davantage sur le garbage collection si cela vous intéresse.Vous pouvez en lire davantage sur le fonctionnement des ramasse-miettes si cela vous intéresse.print(f'the identity of local x is {id(x)}')/print(f'the identity of global x is {id(x)}')print(f"l'identité de x local est {id(x)}")/print(f"l'identité de x global est {id(x)}")These are explanatory output strings, not identifiers. The rest of the lesson is in French so the printed messages should be too.
Terminology and style
espace de noms/espaces de nomsespace de nommage/espaces de nommageThe official French Python documentation ("Portées et espaces de nommage en Python") settles on espace de nommage, not espace de noms, and defines it the same way this chapter does. This is the change that matters most here since it runs through nearly the whole chapter. Given the volume, I did this as a project-wide find-and-replace rather than editing each line by hand, then checked the frontmatter headings separately since a search on the body text alone wouldn't catch those.
Un espace de nommage est une table de symboles qui associe des noms à des objets en mémoire.Un espace de nommage est une table de correspondance entre des noms et des objets en mémoire.Matches the exact phrasing the official Python tutorial uses for this definition.
Sous le capot, ce processus de liaison des noms aux objets est implémenté sous la forme d'un dictionnaireEn interne, ce processus de liaison des noms aux objets est implémenté sous la forme d'un dictionnaireNot wrong, just more informal than the rest of the chapter.
Rappelons de la discussion précédente que l'instructionRappelons que l'instructionThe original was a slightly awkward calque of "recall from the preceding discussion that".
Nous avons utilisé diverses fonctions intégrées, telles que \max(), dir(), str(), list(), len(), range(), type()`, etc.`Nous avons utilisé diverses fonctions natives, telles que \max(), dir(), str(), list(), len(), range(), type()`, etc.`The French docs page for built-in functions is titled Fonctions natives.
\doc` est la docstring du module`\doc` est la chaîne de documentation du module`The Python glossary spells this out as chaîne de documentation (docstring).
runvs%run, line 238Lorsque nous exécutons un script à l'aide de la commande \run` d'IPython`Lorsque nous exécutons un script à l'aide de la commande \%run` d'IPython`The actual magic command used two lines later is
%run, notrun.Une fois la fonction terminée, l'espace de noms est libéré et perdu.Lorsque l'exécution de la fonction se termine, son espace de nommage local est oublié.Follows the official Python tutorial almost word for word, which says a function's local namespace is created when it's called and then "effacé... en fait, « oublié » serait une meilleure façon de décrire ce qui se passe réellement." Avoids overstating a specific memory-management mechanism the docs deliberately hedge on.
Comprendre le flux d'exécution nous aidera à vérifier quelles variables sont dans la portée et comment opérer sur elles lors de l'écriture et du débogage des programmes.Comprendre le flux d'exécution nous aidera à déterminer quelles variables sont accessibles dans une portée donnée et comment les utiliser lors de l'écriture et du débogage des programmes."Opérer sur elles" is a literal rendering of "operate on them" and didn't read naturally.
L'espace de noms builtinl'espace de nommage des primitivesLeaving "builtin" untranslated in the middle of a French sentence was awkward.
C'est ce qu'on appelle la règle LEGB (local, englobant, global, builtin).C'est ce qu'on appelle la règle LEGB (Local, Enclosing, Global, Built-in, c'est-à-dire local, englobant, global et natif).If the words are fully translated, the letters no longer match the acronym, so it's clearer to keep the English expansion and gloss it in French right after.
Paramètres Mutables versus ImmuablesParamètres mutables et immuablesEvery other heading in the file uses French sentence case, and "versus" was an unnecessary English borrowing.
C'est le bon moment pour en dire un peu plus sur les objets mutables versus immuables.C'est le bon moment pour en dire un peu plus sur les objets mutables et immuables.Cette valeur est retournée/Retourne la liste \[2]``Cette valeur est renvoyée/Renvoie la liste \[2]``French Python docs consistently use renvoyer for what a function returns.
Cela affiche \[2]` comme valeur de `f(x)` et la même chose pour `x`.`Cela affiche \[2]` comme valeur de `f(x)` et également `[2]` comme valeur de `x`.`Spelling out the value instead of "la même chose" removes any ambiguity for a reader working through the example.
Visualiser les espaces de nommageConsulter les espaces de nommage