Skip to content

Review of the French translation of Names and Namespaces - #80

Merged
mmcky merged 4 commits into
QuantEcon:mainfrom
Honaminto:main
Sep 23, 2026
Merged

mmcky merged 4 commits into
QuantEcon:mainfrom
Honaminto:main

Conversation

@Honaminto

@Honaminto Honaminto commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

Review of the French translation of Names and Namespaces

  1. __builtins__ section, line 344 – wrong module name for Python 3
  • Before: Ces définitions sont stockées dans un module appelé \builtin`.`
  • After: Ces définitions sont fournies par le module \builtins`.`

__builtin__ (no s, double underscore) was the Python 2 name. Python 3 calls it builtins. This isn't really a translation choice, the English source has the same mistake and probably deserves a note upstream too.

  1. Garbage collector, line 98 – left untranslated, then translated differently three lines later
  • Before: Cela déclenche le ramassage de \'foo'` par le garbage collector.`
  • After: 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.

  1. Garbage collection, line 102
  • Before: Le ramassage des ordures (garbage collection) est en réalité un domaine de recherche actif en informatique.
  • After: 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.

  1. Garbage collection link text, line 104
  • Before: Vous pouvez en lire davantage sur le garbage collection si cela vous intéresse.
  • After: Vous pouvez en lire davantage sur le fonctionnement des ramasse-miettes si cela vous intéresse.
  1. Untranslated print strings, lines 555 and 559
  • Before: print(f'the identity of local x is {id(x)}') / print(f'the identity of global x is {id(x)}')
  • After: 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

  1. Namespace terminology, throughout the file, notably the title (line 34), the frontmatter headings (lines 11, 15, 16, 18, 19, 20), and the definition (line 124), plus roughly 50 other occurrences across every section
  • Before: espace de noms / espaces de noms
  • After: espace de nommage / espaces de nommage

The 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.

  1. Namespace definition, line 124
  • Before: Un espace de nommage est une table de symboles qui associe des noms à des objets en mémoire.
  • After: 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.

  1. "Sous le capot", line 65
  • Before: Sous le capot, ce processus de liaison des noms aux objets est implémenté sous la forme d'un dictionnaire
  • After: En interne, ce processus de liaison des noms aux objets est implémenté sous la forme d'un dictionnaire

Not wrong, just more informal than the rest of the chapter.

  1. "Rappelons de la discussion précédente", line 111
  • Before: Rappelons de la discussion précédente que l'instruction
  • After: Rappelons que l'instruction

The original was a slightly awkward calque of "recall from the preceding discussion that".

  1. Fonctions intégrées, line 340
  • Before: Nous avons utilisé diverses fonctions intégrées, telles que \max(), dir(), str(), list(), len(), range(), type()`, etc.`
  • After: 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.

  1. Docstring, line 210
  • Before: \doc` est la docstring du module`
  • After: \doc` est la chaîne de documentation du module`

The Python glossary spells this out as chaîne de documentation (docstring).

  1. run vs %run, line 238
  • Before: Lorsque nous exécutons un script à l'aide de la commande \run` d'IPython`
  • After: Lorsque nous exécutons un script à l'aide de la commande \%run` d'IPython`

The actual magic command used two lines later is %run, not run.

  1. "Une fois la fonction terminée", line 314
  • Before: Une fois la fonction terminée, l'espace de noms est libéré et perdu.
  • After: 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.

  1. Scope sentence, line 386
  • Before: 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.
  • After: 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.

  1. Builtin namespace, lines 396, 402, and 424
  • Before: L'espace de noms builtin
  • After: l'espace de nommage des primitives

Leaving "builtin" untranslated in the middle of a French sentence was awkward.

  1. LEGB, line 428
  • Before: C'est ce qu'on appelle la règle LEGB (local, englobant, global, builtin).
  • After: 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.

  1. Heading capitalization, frontmatter line 22 and body line 489
  • Before: Paramètres Mutables versus Immuables
  • After: Paramètres mutables et immuables

Every other heading in the file uses French sentence case, and "versus" was an unnecessary English borrowing.

  1. "Objets mutables versus immuables", line 491
  • Before: C'est le bon moment pour en dire un peu plus sur les objets mutables versus immuables.
  • After: C'est le bon moment pour en dire un peu plus sur les objets mutables et immuables.
  1. Retourner vs renvoyer, lines 481, 510, and 565
  • Before: Cette valeur est retournée / Retourne la liste \[2]``
  • After: Cette valeur est renvoyée / Renvoie la liste \[2]``

French Python docs consistently use renvoyer for what a function returns.

  1. "La même chose", line 525
  • Before: Cela affiche \[2]` comme valeur de `f(x)` et la même chose pour `x`.`
  • After: 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.

  1. Viewing Namespaces heading, frontmatter line 16 and body line 189
  • Before: Visualiser les espaces de nommage
  • After: Consulter les espaces de nommage

@mmcky

mmcky commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Thanks Emile — the failed preview build here wasn't caused by your edits. This PR's branch is your fork's main, which was 17 commits behind this repository, and in the meantime the test_pwt.csv dataset read by pandas.md and polars.md moved to QuantEcon/data-lectures (#35). The old URL on your branch now returns a 404, so those two lectures failed to execute in CI.

I've updated your branch from main (GitHub's "Update branch" merge). Your names.md changes are untouched and the PR diff is unchanged, so the preview should now build cleanly.

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 main. We're reviewing the changes themselves now and will follow up here.

@mmcky

mmcky commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

@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 mmcky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 »?

@mmcky
mmcky merged commit ba9b4e5 into QuantEcon:main Sep 23, 2026
2 checks passed
mmcky added a commit that referenced this pull request Sep 23, 2026
…, 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>
mmcky added a commit that referenced this pull request Sep 23, 2026
…, 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>
@Honaminto

Copy link
Copy Markdown
Collaborator Author

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:
https://docs.python.org/fr/3.12/library/functions.html

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:

  • built-in function → fonction native
  • built-in functions → fonctions natives
  • built-in type → type natif
  • built-in namespace → espace de nommage contenant les primitives

I think it makes sense to apply these consistently across the chapters.

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.

2 participants