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

fix dangling keyfunc examples in documentation of heapq and sorted #1432

Merged
merged 4 commits into from
Oct 15, 2018

Conversation

wm75
Copy link

@wm75 wm75 commented May 3, 2017

used the same wording as in the description of list.sort

@mention-bot
Copy link

@wm75, thanks for your PR! By analyzing the history of the files in this pull request, we identified @birkenfeld, @rhettinger and @benjaminp to be potential reviewers.

used to extract a comparison key from each element in the iterable:
``key=str.lower`` Equivalent to: ``sorted(iterable, key=key,
used to extract a comparison key from each element in the iterable (for example,
``key=str.lower``). Equivalent to: ``sorted(iterable, key=key,
reverse=True)[:n]``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't a period missed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean at the very end. Not sure about this because that last part is not a complete sentence, but then I'm not a native speaker 🤷‍♂️

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I would probably use a full stop at the end (and again for nsmallest). The last part still functions as a sentence, it comes after other sentences (now) using full stops, and another full stop would identify the end of the paragraph.

If the code was written on a separate line, I probably wouldn’t use a full stop.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds convincing, plus the docs have many other examples of incomplete sentences like this that all have a period.

@wm75
Copy link
Author

wm75 commented Apr 7, 2018

Jut realized that the documentation for sorted() has the identical problem. Fixed it there, too.

@wm75 wm75 changed the title fix dangling mention of key=str.lower in heapq doc fix dangling keyfunc examples in documentation of heapq and sorted Apr 7, 2018
used to extract a comparison key from each element in the iterable:
``key=str.lower`` Equivalent to: ``sorted(iterable, key=key,
reverse=True)[:n]``
used to extract a comparison key from each element in the iterable (for example,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be more clear for this and the following reference to be *iterable* like you did in the Doc/library/functions.rst part of this change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed and fixed.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@wm75
Copy link
Author

wm75 commented Oct 15, 2018

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@briancurtin: please review the changes made to this pull request.

@bedevere-bot
Copy link

@briancurtin: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

Thanks @wm75 for the PR, and @briancurtin for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 15, 2018
…ythonGH-1432)

* fix dangling mention of key=str.lower in heapq doc

* Fix dangling mention of keyfunc example for sorted()
(cherry picked from commit 6bdb6f7)

Co-authored-by: Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de>
@bedevere-bot
Copy link

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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Oct 15, 2018
…ythonGH-1432)

* fix dangling mention of key=str.lower in heapq doc

* Fix dangling mention of keyfunc example for sorted()
(cherry picked from commit 6bdb6f7)

Co-authored-by: Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de>
@bedevere-bot
Copy link

GH-9894 is a backport of this pull request to the 3.6 branch.

briancurtin pushed a commit that referenced this pull request Oct 15, 2018
…H-1432)

* fix dangling mention of key=str.lower in heapq doc

* Fix dangling mention of keyfunc example for sorted()
(cherry picked from commit 6bdb6f7)

Co-authored-by: Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de>
briancurtin pushed a commit that referenced this pull request Oct 15, 2018
…H-1432)

* fix dangling mention of key=str.lower in heapq doc

* Fix dangling mention of keyfunc example for sorted()
(cherry picked from commit 6bdb6f7)

Co-authored-by: Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de>
vstinner added a commit that referenced this pull request Oct 16, 2018
CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request Oct 18, 2018
* master: (621 commits)
  Update opcode.h header comment to mention the source data file (pythonGH-9935)
  bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (pythonGH-9760)
  Updated documentation on logging.debug(). (pythonGH-9946)
  bpo-34765: Update the install-sh file (pythonGH-9592)
  bpo-35008: Fix possible leaks in Element.__setstate__(). (pythonGH-9924)
  bpo-35011: Restore use of pyexpatns.h in libexpat (pythonGH-9939)
  bpo-24658: Fix read/write greater than 2 GiB on macOS (pythonGH-1705)
  Add missing comma to wsgiref doc (pythonGH-9932)
  bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (pythonGH-9925)
  Doc: Fix is_prime (pythonGH-9909)
  In email docs, correct spelling of foregoing (python#9856)
  In email.parser in message_from_bytes, update `strict` to `policy` (python#9854)
  bpo-34997: Fix test_logging.ConfigDictTest.test_out_of_order (pythonGH-9913)
  Added CLI starter example to logging cookbook. (pythonGH-9910)
  bpo-34783: Fix test_nonexisting_script() (pythonGH-9896)
  bpo-23554: Change echo server example class name from EchoServerClientProtocol to EchoServerProtocol (pythonGH-9859)
  bpo-34989: python-gdb.py: fix current_line_num() (pythonGH-9889)
  Stop using deprecated logging API in Sphinx suspicious checker (pythonGH-9875)
  fix dangling keyfunc examples in documentation of heapq and sorted (python#1432)
  bpo-34844: logging.Formatter enhancement - Ensure style and format string matches in logging.Formatter  (pythonGH-9703)
  ...
CuriousLearner added a commit to CuriousLearner/cpython that referenced this pull request Oct 18, 2018
* master: (1787 commits)
  Update opcode.h header comment to mention the source data file (pythonGH-9935)
  bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (pythonGH-9760)
  Updated documentation on logging.debug(). (pythonGH-9946)
  bpo-34765: Update the install-sh file (pythonGH-9592)
  bpo-35008: Fix possible leaks in Element.__setstate__(). (pythonGH-9924)
  bpo-35011: Restore use of pyexpatns.h in libexpat (pythonGH-9939)
  bpo-24658: Fix read/write greater than 2 GiB on macOS (pythonGH-1705)
  Add missing comma to wsgiref doc (pythonGH-9932)
  bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (pythonGH-9925)
  Doc: Fix is_prime (pythonGH-9909)
  In email docs, correct spelling of foregoing (python#9856)
  In email.parser in message_from_bytes, update `strict` to `policy` (python#9854)
  bpo-34997: Fix test_logging.ConfigDictTest.test_out_of_order (pythonGH-9913)
  Added CLI starter example to logging cookbook. (pythonGH-9910)
  bpo-34783: Fix test_nonexisting_script() (pythonGH-9896)
  bpo-23554: Change echo server example class name from EchoServerClientProtocol to EchoServerProtocol (pythonGH-9859)
  bpo-34989: python-gdb.py: fix current_line_num() (pythonGH-9889)
  Stop using deprecated logging API in Sphinx suspicious checker (pythonGH-9875)
  fix dangling keyfunc examples in documentation of heapq and sorted (python#1432)
  bpo-34844: logging.Formatter enhancement - Ensure style and format string matches in logging.Formatter  (pythonGH-9703)
  ...
@wm75 wm75 deleted the wm75-heapq-doc-patch branch July 20, 2022 18:47
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 issue skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.