-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-34712: Fix style in examples in "Input and Output" #9361
Conversation
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.html#format-string-syntax
Do I need to add a NEWS entry for this documentation tweak? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR looks good to me. Thanks.
@benhoyt No news is necessary for this change. Thanks! |
Thanks @benhoyt for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
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 3705b98) Co-authored-by: Ben Hoyt <benhoyt@gmail.com>
GH-9414 is a backport of this pull request to the 3.7 branch. |
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 3705b98) Co-authored-by: Ben Hoyt <benhoyt@gmail.com>
A couple of fixes here to make this more PEP-8:
;
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;
)!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.html#format-string-syntaxhttps://bugs.python.org/issue34712