Skip to content
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

Merged
merged 1 commit into from
Sep 19, 2018

Conversation

benhoyt
Copy link
Contributor

@benhoyt benhoyt commented Sep 17, 2018

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

https://bugs.python.org/issue34712

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
@benhoyt
Copy link
Contributor Author

benhoyt commented Sep 17, 2018

Do I need to add a NEWS entry for this documentation tweak?

Copy link
Contributor

@willingc willingc left a 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.

@willingc
Copy link
Contributor

@benhoyt No news is necessary for this change. Thanks!

@methane methane changed the title bpo-34712: Fix style in examples in "Input and Output" tutorial section bpo-34712: Fix style in examples in "Input and Output" Sep 19, 2018
@miss-islington miss-islington merged commit 3705b98 into python:master Sep 19, 2018
@miss-islington
Copy link
Contributor

Thanks @benhoyt for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Sep 19, 2018
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>
@bedevere-bot
Copy link

GH-9414 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this pull request Sep 19, 2018
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants