test-env builds a scalar cell with nodes.paragraph(text=cell) (test_env.py:220), and docutils' TextElement.__init__ adds the text only if text: (docutils/nodes.py:1517), so every FALSY value renders as an EMPTY cell, and a non-string is rendered through str(). Measured at e13ce72f with a tox-envreport-style file holding one environment of scalar values:
| JSON value |
rendered Data cell |
3, 1.5, 2.0, 1e16 |
3, 1.5, 2.0, 1e+16 |
true |
True |
false |
(empty) |
null |
(empty) |
"" |
(empty) |
0, 0.0 (by the same rule; not run) |
(empty) |
A false flag and a null are the values a reader most wants to see, and they are indistinguishable from a missing one; True is Python's spelling, not the file's.
Proposal. Spell scalars as JSON (json.dumps(cell) for everything that is not a str): true / false / null / 0, and pass a str through verbatim — the same rule the list/dict branch already follows with json.dumps(indent=4).
ubCode's port spells scalars as JSON (useblocks/ubcode#3924).
test-envbuilds a scalar cell withnodes.paragraph(text=cell)(test_env.py:220), and docutils'TextElement.__init__adds the text onlyif text:(docutils/nodes.py:1517), so every FALSY value renders as an EMPTY cell, and a non-string is rendered throughstr(). Measured ate13ce72fwith a tox-envreport-style file holding one environment of scalar values:Datacell3,1.5,2.0,1e163,1.5,2.0,1e+16trueTruefalsenull""0,0.0(by the same rule; not run)A
falseflag and anullare the values a reader most wants to see, and they are indistinguishable from a missing one;Trueis Python's spelling, not the file's.Proposal. Spell scalars as JSON (
json.dumps(cell)for everything that is not astr):true/false/null/0, and pass astrthrough verbatim — the same rule the list/dict branch already follows withjson.dumps(indent=4).ubCode's port spells scalars as JSON (useblocks/ubcode#3924).