-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Clean up comma usage in Doc/library/functions.rst #27083
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
Conversation
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). Recognized GitHub usernameWe couldn't find a bugs.python.org (b.p.o) account corresponding to the following GitHub usernames: This might be simply due to a missing "GitHub Name" entry in one's b.p.o account settings. This is necessary for legal reasons before we can look at this contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
Doc/library/functions.rst
Outdated
@@ -4,8 +4,8 @@ | |||
Built-in Functions | |||
================== | |||
|
|||
The Python interpreter has a number of functions and types built into it that | |||
are always available. They are listed here in alphabetical order. | |||
The Python interpreter has several functions and types built into it that |
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.
How is "several" more readable than "a number of"?
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.
(also note trailing space)
Doc/library/functions.rst
Outdated
@@ -4,8 +4,8 @@ | |||
Built-in Functions | |||
================== | |||
|
|||
The Python interpreter has a number of functions and types built into it that | |||
are always available. They are listed here in alphabetical order. |
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.
We generally use double spaces after periods between sentences.
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.
That's from formatting, didn't notice.
Doc/library/functions.rst
Outdated
@@ -96,7 +96,7 @@ are always available. They are listed here in alphabetical order. | |||
This calls the :meth:`~object.__anext__` method of *async_iterator*, | |||
returning an :term:`awaitable`. Awaiting this returns the next value of the | |||
iterator. If *default* is given, it is returned if the iterator is exhausted, | |||
otherwise :exc:`StopAsyncIteration` is raised. | |||
otherwise, :exc:`StopAsyncIteration` is raised. |
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.
The usage before was correct. If you insist on using the comma when "otherwise" begins a sentence fragment, you need to change the preceding comma into a semicolon to emphasize the composition of the sentence (it looks too similar to enumeration otherwise). I would just leave those cases alone.
Doc/library/functions.rst
Outdated
@@ -222,7 +222,7 @@ are always available. They are listed here in alphabetical order. | |||
|
|||
Return :const:`True` if the *object* argument appears callable, | |||
:const:`False` if not. If this returns ``True``, it is still possible that a | |||
call fails, but if it is ``False``, calling *object* will never succeed. | |||
call fails, but if it is ``False``, the calling *object* will never succeed. |
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.
"calling" is a verb here, this is invalid.
Doc/library/functions.rst
Outdated
@@ -479,7 +479,7 @@ are always available. They are listed here in alphabetical order. | |||
.. function:: enumerate(iterable, start=0) | |||
|
|||
Return an enumerate object. *iterable* must be a sequence, an | |||
:term:`iterator`, or some other object which supports iteration. | |||
:term:`iterator`, or some other object that supports iteration. |
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.
How is "that" better than "which"?
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.
It's referring to a defining clause
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.
"which" can also refer to defining clauses, see: https://dictionary.cambridge.org/grammar/british-grammar/relative-clauses-defining-and-non-defining
Doc/library/functions.rst
Outdated
iteration protocol (the :meth:`__iter__` method), or it must support the | ||
sequence protocol (the :meth:`__getitem__` method with integer arguments | ||
starting at ``0``). If it does not support either of those protocols, | ||
:exc:`TypeError` is raised. If the second argument, *sentinel*, is given, | ||
then *object* must be a callable object. The iterator created in this case | ||
will call *object* with no arguments for each call to its | ||
:meth:`~iterator.__next__` method; if the value returned is equal to | ||
*sentinel*, :exc:`StopIteration` will be raised, otherwise the value will | ||
*sentinel*, :exc:`StopIteration` will be raised, otherwise, the value will |
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.
Ditto.
Doc/library/functions.rst
Outdated
@@ -928,22 +928,22 @@ are always available. They are listed here in alphabetical order. | |||
|
|||
Return an :term:`iterator` object. The first argument is interpreted very | |||
differently depending on the presence of the second argument. Without a | |||
second argument, *object* must be a collection object which supports the | |||
second argument, *object* must be a collection object that supports the |
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.
Ditto.
Doc/library/functions.rst
Outdated
be returned. | ||
|
||
See also :ref:`typeiter`. | ||
|
||
One useful application of the second form of :func:`iter` is to build a | ||
block-reader. For example, reading fixed-width blocks from a binary | ||
database file until the end of file is reached:: | ||
database file until the end of the file is reached:: |
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.
This makes it arguably less readable, "end of file" is an IT idiom.
Doc/library/functions.rst
Outdated
@@ -1062,13 +1062,13 @@ are always available. They are listed here in alphabetical order. | |||
|
|||
Retrieve the next item from the *iterator* by calling its | |||
:meth:`~iterator.__next__` method. If *default* is given, it is returned | |||
if the iterator is exhausted, otherwise :exc:`StopIteration` is raised. | |||
if the iterator is exhausted, otherwise, :exc:`StopIteration` is raised. |
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.
Ditto.
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.
Hi @ambv
Once resolved, should I fix these and create a new PR or that will be done from your end?
I'm not sure what you mean. You resolve issues by updating your PR. I'll merge it once it's in an acceptable state. |
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.
All done @ambv
@ambv: Please replace |
Thanks! ✨ 🍰 ✨ |
Clean up comma usage in Doc/library/functions.rst (python#27083)
Thanks @Adminixtrator for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10. |
(cherry picked from commit 1e651c6) Co-authored-by: α∂мιηιχтяαтσя <sadiqherritage@gmail.com>
GH-27243 is a backport of this pull request to the 3.10 branch. |
* origin/main: (1146 commits) bpo-42064: Finalise establishing sqlite3 global state (pythonGH-27155) bpo-44678: Separate error message for discontinuous padding in binascii.a2b_base64 strict mode (pythonGH-27249) correct spelling (pythonGH-27076) bpo-44524: Add missed __name__ and __qualname__ to typing module objects (python#27237) bpo-27513: email.utils.getaddresses() now handles Header objects (python#13797) Clean up comma usage in Doc/library/functions.rst (python#27083) bpo-42238: Fix small rst issue in NEWS.d/. (python#27238) bpo-41972: Tweak fastsearch.h string search algorithms (pythonGH-27091) bpo-44340: Add support for building with clang full/thin lto (pythonGH-27231) bpo-44661: Update property_descr_set to use vectorcall if possible. (pythonGH-27206) bpo-44645: Check for interrupts on any potentially backwards edge (pythonGH-27216) bpo-41546: make pprint (like print) not write to stdout when it is None (pythonGH-26810) bpo-44554: refactor pdb targets (and internal tweaks) (pythonGH-26992) bpo-43086: Add handling for out-of-spec data in a2b_base64 (pythonGH-24402) bpo-44561: Update hyperlinks in Doc/distributing/index.rst (python#27032) bpo-42355: symtable.get_namespace() now checks whether there are multiple or any namespaces found (pythonGH-23278) bpo-44654: Do not export the union type related symbols (pythonGH-27223) bpo-44633: Fix parameter substitution of the union type with wrong types. (pythonGH-27218) bpo-44654: Refactor and clean up the union type implementation (pythonGH-27196) bpo-20291: Fix MSVC warnings in getargs.c (pythonGH-27211) ...
"Readability counts."
Excerpt from The Zen of Python by Tim Peters