-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
Corrected link targets in collections.rst #1052
Corrected link targets in collections.rst #1052
Conversation
@MSeifert04, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rhettinger, @Yhg1s and @birkenfeld to be potential reviewers. |
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.
Mostly looks good, but I have some comments.
Doc/library/collections.rst
Outdated
@@ -357,21 +357,22 @@ or subtracting from an empty counter. | |||
restrictions on its keys and values. The values are intended to be numbers | |||
representing counts, but you *could* store anything in the value field. | |||
|
|||
* The :meth:`most_common` method requires only that the values be orderable. | |||
* The :meth:`~Counter.most_common` method requires only that the values be |
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.
Change also :func:'most_common'
above to :meth:'most_common'
.
Doc/library/collections.rst
Outdated
the :meth:`rotate` method to position elements to be popped:: | ||
The :meth:`~deque.rotate` method provides a way to implement :class:`deque` slicing | ||
and deletion. For example, a pure Python implementation of ``del d[n]`` relies on | ||
the :meth:`~deque.rotate` method to position elements to be popped:: |
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.
Avoid using the same link multiple times in one paragraph. ``rotate()``
would look better.
Doc/library/collections.rst
Outdated
passed to the :class:`OrderedDict` constructor and its :meth:`update` | ||
method. | ||
passed to the :class:`OrderedDict` constructor and its | ||
:meth:`update` method. |
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.
What is changed here?
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.
Nothing.
I originally changed it to dict.update
but then I wasn't sure if that was what was intended and reverted it again. Just forgot to revert all of the change.
Doc/library/collections.rst
Outdated
@@ -1175,6 +1176,11 @@ attribute. | |||
subclass) or an arbitrary sequence which can be converted into a string using | |||
the built-in :func:`str` function. | |||
|
|||
.. attribute:: data |
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.
Shouldn't be added the paragraph "In addition to supporting ..." as for UserDict and UserList?
Doc/library/collections.rst
Outdated
@@ -1175,6 +1176,11 @@ attribute. | |||
subclass) or an arbitrary sequence which can be converted into a string using |
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 phrase is outdated (remained from Python 2). Virtually any object (not just sequences) can be converted into a string using str(). However bytes is bad example, it emits a warning or an exception when converted to str.
Doc/library/collections.rst
Outdated
be an instance of :class:`bytes`, :class:`str`, :class:`UserString` (or a | ||
subclass) or an arbitrary sequence which can be converted into a string using | ||
the built-in :func:`str` function. | ||
contents are initially set to a copy of *seq*. The *seq* can |
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 *seq*
” is missing a noun. I would either write “*Seq*
can . . .” or “The *seq*
argument can . . .”. Changing the parameter name makes this problem worse.
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.
LGTM.
@rhettinger could you please make a look as the |
I think this looks good, I just wonder if we need a ticket in b.p.o for this? |
Please hold off on this for while. I won't have a chance to go through every change in detail for a while. Some of the changes like func->meth or meth->attr look fine; however, a number of the meth entries were intentionally not made into link target (i.e. I mention rotate() several times in a row, I don't want them to all be links -- this just garbages the appearance without making the docs better. The double colon was left-off of the combination_with_replacement example on purpose because it includes sample output which isn't real code. That said, I think it looks better with the double colon, so I think I'll put a # comment on the line or somesuch. When proposing extensive edits, please don't rewrap the lines unless there is a major increase to line length, the rewrapping makes it harder to review. |
I haven't realized that this was an "extensive edit". If it would help I can seperate the different changes into seperate PRs (with accompanying issues on the tracker). There are basically 4 changes here:
|
How should I proceed with this PR? |
Anything I can or should do? It's a relatively small PR and it has been stalling for months now. |
@rhettinger Is it worth fixing the conflicts? I don't want to invest more time into this PR if you don't like it. |
@serhiy-storchaka Thanks for fixing the conflicts :) I still wonder if it's worth keeping it open. There seems to be no interest in merging it, or is just that @rhettinger has no time to review it? |
All @rhettinger's comments looks addressed to me. |
There is one comment that I haven't addressed (I think) because I don't know which ones were meant:
|
It was addressed before it was written. There are no more than one links to the same target in one paragraph. If |
okay - so what is holding up the PR? |
@rhettinger Do you have time to review the PR? |
Thanks @MSeifert04 for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
(cherry picked from commit e105294) Co-authored-by: Michael Seifert <michaelseifert04@yahoo.de>
GH-6257 is a backport of this pull request to the 3.7 branch. |
Sorry, @MSeifert04 and @serhiy-storchaka, I could not cleanly backport this to |
(cherry picked from commit e105294) Co-authored-by: Michael Seifert <michaelseifert04@yahoo.de>
Fixes several link targets in
library.collections.rst
.There are 3 remaining "invalid" links:
list.append
, because there is no "target" for that method. There is something documented intutorial/datastructures
but these are not valid link targets.defaultdict.get
, because it's not explicitly documented. Should it link todict.get
?OrderedDict.update
, because it's not explicitly documented. Should it link todict.update
?