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
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.
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:
Thank you for your review @vsajip. The build was failed because I forgot to update also |
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. |
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 |
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