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-38738: Fix formatting of True and False. #17083

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Nov 7, 2019

  • "Return true/false" is replaced with "Return ``True``/``False``"
    if the function actually returns a bool.
  • Fixed formatting of some True and False literals (now in monospace).
  • Replaced "True/False" with "true/false" if it can be not only bool.
  • Replaced some 1/0 with True/False if it corresponds the code.

https://bugs.python.org/issue38738

* "Return true/false" is replaced with "Return ``True``/``False``"
  if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
vsajip
vsajip approved these changes Nov 7, 2019
Copy link
Member

@vsajip vsajip left a comment

I approve only the changes relating to the logging and venv packages, which I have commented on. I haven't reviewed the other changes.

Doc/library/logging.rst Outdated Show resolved Hide resolved
Doc/library/logging.handlers.rst Outdated Show resolved Hide resolved
Doc/library/logging.rst Outdated Show resolved Hide resolved
Doc/library/venv.rst Show resolved Hide resolved
Doc/library/venv.rst Show resolved Hide resolved
Copy link
Member

@aeros aeros left a comment

Thanks for the PR @serhiy-storchaka, it covers a very large portion of the docs. Looks good for the most part, other than a few changes:

Doc/library/dialog.rst Show resolved Hide resolved
Doc/library/sys.rst Show resolved Hide resolved
Doc/library/unittest.mock.rst Outdated Show resolved Hide resolved
Doc/library/unittest.mock.rst Show resolved Hide resolved
Doc/whatsnew/3.8.rst Show resolved Hide resolved
Doc/whatsnew/3.8.rst Show resolved Hide resolved
Copy link
Member Author

@serhiy-storchaka serhiy-storchaka left a comment

Thank you for your review, @aeros, but I disagree with all of your suggestions.

Doc/library/dialog.rst Show resolved Hide resolved
Doc/library/sys.rst Show resolved Hide resolved
Doc/library/unittest.mock.rst Outdated Show resolved Hide resolved
Doc/library/unittest.mock.rst Show resolved Hide resolved
Doc/whatsnew/3.8.rst Show resolved Hide resolved
Doc/whatsnew/3.8.rst Show resolved Hide resolved
@serhiy-storchaka
Copy link
Member Author

serhiy-storchaka commented Nov 8, 2019

Thank you for your review @vsajip.

The build was failed because I forgot to update also susp-ignored.csv to match changes in the documentation.

Copy link
Member

@terryjreedy terryjreedy left a comment

Stdlib functions nearly always accept any true or false value for arguments used in a boolean context and specifically return True or False as specific boolean objects. I consider this a feature and approve of making the docs being worded accordingly. I looked at all the diffs and only have a couple of minor suggestions:

  1. Fix the default issue. (See my response on the unittest.mock discussion that included 'vedran'.)
  2. Maybe fix about 9 'Returns' and possibly other verbs.

Doc/library/ipaddress.rst Outdated Show resolved Hide resolved
Doc/library/logging.rst Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

bedevere-bot commented Nov 9, 2019

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

And if you don't make the requested changes, you will be put in the comfy chair!

@aeros
Copy link
Member

aeros commented Nov 9, 2019

@serhiy-storchaka

Thank you for your review, @aeros, but I disagree with all of your suggestions.

That's okay. Thanks for looking over the suggestions, I think the discussion provides some value either way.

I agree with the suggestions made by @terryjreedy, regarding the usage of consistently using imperative verbs to describe behavior.

@serhiy-storchaka
Copy link
Member Author

serhiy-storchaka commented Nov 9, 2019

I have made the requested changes; please review again.

@bedevere-bot
Copy link

bedevere-bot commented Nov 9, 2019

Thanks for making the requested changes!

@vsajip, @terryjreedy: please review the changes made to this pull request.

aeros
aeros approved these changes Nov 10, 2019
Copy link
Member

@aeros aeros left a comment

It looks like the are still some "Returns" that could be converted to "Return" (such as 389 of dataclasses.rst and 112 of fileinput.rst), but I approve of all of the changes made in the PR.

Thanks for the clarifications @serhiy-storchaka and @terryjreedy.

Doc/library/dataclasses.rst Outdated Show resolved Hide resolved
Doc/library/fileinput.rst Outdated Show resolved Hide resolved
Doc/library/fileinput.rst Outdated Show resolved Hide resolved
Doc/library/fileinput.rst Outdated Show resolved Hide resolved
Doc/library/fileinput.rst Outdated Show resolved Hide resolved
Doc/library/gc.rst Outdated Show resolved Hide resolved
Doc/library/dataclasses.rst Outdated Show resolved Hide resolved
serhiy-storchaka and others added 2 commits Nov 10, 2019
@serhiy-storchaka
Copy link
Member Author

serhiy-storchaka commented Nov 10, 2019

Thank you @aeros! Added missed conversions.

Doc/library/dialog.rst Outdated Show resolved Hide resolved
@serhiy-storchaka serhiy-storchaka merged commit 138ccbb into python:master Nov 12, 2019
@serhiy-storchaka serhiy-storchaka deleted the docs-format-return-bool branch Nov 12, 2019
@miss-islington
Copy link
Contributor

miss-islington commented Nov 12, 2019

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒🤖 I'm not a witch! I'm not a witch!

@miss-islington
Copy link
Contributor

miss-islington commented Nov 12, 2019

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.8 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 138ccbb02216ca086047c3139857fb44f3dab1f9 3.8

@miss-islington
Copy link
Contributor

miss-islington commented Nov 12, 2019

Sorry @serhiy-storchaka, I had trouble checking out the 3.7 backport branch.
Please backport using cherry_picker on command line.
cherry_picker 138ccbb02216ca086047c3139857fb44f3dab1f9 3.7

@bedevere-bot
Copy link

bedevere-bot commented Nov 12, 2019

GH-17125 is a backport of this pull request to the 3.8 branch.

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Nov 12, 2019
* "Return true/false" is replaced with "Return ``True``/``False``"
  if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
* "Returns <bool>" is replaced with "Return <bool>"..
(cherry picked from commit 138ccbb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Nov 12, 2019
* "Return true/false" is replaced with "Return ``True``/``False``"
  if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
* "Returns <bool>" is replaced with "Return <bool>".
(cherry picked from commit 138ccbb)
@bedevere-bot
Copy link

bedevere-bot commented Nov 12, 2019

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

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Nov 12, 2019
* "Return true/false" is replaced with "Return ``True``/``False``"
  if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
* "Returns <bool>" is replaced with "Return <bool>"..
(cherry picked from commit 138ccbb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Nov 12, 2019
* "Return true/false" is replaced with "Return ``True``/``False``"
  if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
* "Returns <bool>" is replaced with "Return <bool>".
(cherry picked from commit 138ccbb)
jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request Dec 5, 2019
* "Return true/false" is replaced with "Return ``True``/``False``"
  if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
* "Returns <bool>" is replaced with "Return <bool>".
shihai1991 pushed a commit to shihai1991/cpython that referenced this pull request Jan 31, 2020
* "Return true/false" is replaced with "Return ``True``/``False``"
  if the function actually returns a bool.
* Fixed formatting of some True and False literals (now in monospace).
* Replaced "True/False" with "true/false" if it can be not only bool.
* Replaced some 1/0 with True/False if it corresponds the code.
* "Returns <bool>" is replaced with "Return <bool>".
@serhiy-storchaka serhiy-storchaka removed their assignment Dec 29, 2020
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.

None yet

8 participants