]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-34712: Fix style in examples in "Input and Output" (GH-9361)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 19 Sep 2018 20:30:40 +0000 (13:30 -0700)
committerGitHub <noreply@github.com>
Wed, 19 Sep 2018 20:30:40 +0000 (13:30 -0700)
commitd9c89111bd82979ce8716f7ca68c69cf0f46e679
treecbe4605bad8f2c727fa949d0a1989d5979c0707f
parent95cc3ee00cfa079751ae2bb9a8d3387053b50489
bpo-34712: Fix style in examples in "Input and Output" (GH-9361)

A couple of fixes here to make this more PEP-8:

* Avoid multiple statements on one line with `;` statement separator -- this is very rare in Python and is "generally discouraged" in PEP 8 (and if used, per PEP 8 there shouldn't be a space before the `;`)
* Add output for the first "Formatted String Literals" example. (Side note: are the doctests for this being run? If so, why didn't it fail?)
* Avoid space before `!r`. I have generally not seen spaces before the `!`, and this also matches the style used in the docs here: https://docs.python.org/3/library/string.htmlGH-format-string-syntax

https://bugs.python.org/issue34712
(cherry picked from commit 3705b9862025705ea60041a9e310f99a164db722)

Co-authored-by: Ben Hoyt <benhoyt@gmail.com>
Doc/tutorial/inputoutput.rst