bpo-38738: Fix formatting of True and False.#17083
Conversation
* "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
left a comment
There was a problem hiding this 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.
There was a problem hiding this 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:
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Thank you for your review, @aeros, but I disagree with all of your suggestions.
|
Thank you for your review @vsajip. The build was failed because I forgot to update also |
There was a problem hiding this 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:
- Fix the default issue. (See my response on the unittest.mock discussion that included 'vedran'.)
- Maybe fix about 9 'Returns' and possibly other verbs.
|
When you're done making the requested changes, leave the comment: And if you don't make the requested changes, you will be put in the comfy chair! |
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. |
|
I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @vsajip, @terryjreedy: please review the changes made to this pull request. |
aeros
left a comment
There was a problem hiding this 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.
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
|
Thank you @aeros! Added missed conversions. |
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
|
Sorry, @serhiy-storchaka, I could not cleanly backport this to |
|
Sorry @serhiy-storchaka, I had trouble checking out the |
|
GH-17125 is a backport of this pull request to the 3.8 branch. |
* "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>
* "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)
|
GH-17128 is a backport of this pull request to the 3.7 branch. |
* "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>
* "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)
* "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>".
* "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>".
``True``/``False``"if the function actually returns a bool.
https://bugs.python.org/issue38738