You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Code comments and docstrings in the French lectures: French or English? #88
Open. Code comments and docstrings in the French lectures: translated or kept in English? Matt settles this with Emile, the edition's editor of record, as for other house-style questions; it sets the --localize value for the fresh drafts and whether a consistency pass is needed.
#82 settled on fresh drafts on 2026-10-06, so the ruling is needed before the first one; corrections in progress carry on and are aligned with it afterwards.
Emile, the edition's editor, asked on #84 (2026-10-02):
Hey Matt, I have a quick question on convention. I've noticed the chapters aren't fully consistent about whether comments and docstrings inside code cells get translated into French. about_py.md already has French comments like # Charger la bibliothèque, but some other chapters leave comments and docstrings in English. Should we translate explanatory comments and docstrings consistently going forward, while leaving code identifiers, API names, and executable output strings as-is? Want to make sure I'm applying the same rule across chapters rather than deciding it one by one.
How the edition got here
The first translation of each lecture (the 2026-07-15 seed, and the sync that added polars) translated the # comments in most lectures, as in about_py.md's # Charger la bibliothèque, but not in all: the comments in python_oop.md are almost all in English, and pandas.md mixes the two.
Docstrings stayed in English in all but one lecture (numpy.md has eight, for example; the one in autodiff.md is in French), because the translation engine's code-comments rule covers # comments only.
A new draft follows the engine's --localize setting, chosen when the draft is made. Its default translates # comments and figure labels; --localize none translates neither.
Options
A. Translate the explanatory text in code.# comments and docstrings in French; code identifiers, API names and the strings a program prints stay as they are. This is the rule the question proposes, and most lectures already follow it for comments.
B. Keep code cells as in the English. Comments and docstrings in English throughout; only the prose is translated.
What the ruling sets
The --localize value for any fresh draft (Proposal: review each remaining lecture as a fresh draft on its own PR #82). Under A, # comments stay translated, and translating docstrings as well needs the engine's code-comments rule extended to cover them. Under B, the value is figure-labels or none.
Whether a consistency pass is needed, and how large it is. Under A, the English comments and docstrings that remain: python_oop.md, part of pandas.md, and the docstrings in about eight lectures. Under B, the French comments in most lectures.
Open. Code comments and docstrings in the French lectures: translated or kept in English? Matt settles this with Emile, the edition's editor of record, as for other house-style questions; it sets the
--localizevalue for the fresh drafts and whether a consistency pass is needed.#82 settled on fresh drafts on 2026-10-06, so the ruling is needed before the first one; corrections in progress carry on and are aligned with it afterwards.
Emile, the edition's editor, asked on #84 (2026-10-02):
How the edition got here
#comments in most lectures, as inabout_py.md's# Charger la bibliothèque, but not in all: the comments inpython_oop.mdare almost all in English, andpandas.mdmixes the two.numpy.mdhas eight, for example; the one inautodiff.mdis in French), because the translation engine'scode-commentsrule covers#comments only.--localizesetting, chosen when the draft is made. Its default translates#comments and figure labels;--localize nonetranslates neither.Options
#comments and docstrings in French; code identifiers, API names and the strings a program prints stay as they are. This is the rule the question proposes, and most lectures already follow it for comments.What the ruling sets
--localizevalue for any fresh draft (Proposal: review each remaining lecture as a fresh draft on its own PR #82). Under A,#comments stay translated, and translating docstrings as well needs the engine'scode-commentsrule extended to cover them. Under B, the value isfigure-labelsornone.python_oop.md, part ofpandas.md, and the docstrings in about eight lectures. Under B, the French comments in most lectures.Done when
--localizevalue for any fresh draft and, if docstrings are to be translated, the engine rule that covers them