Skip to content

bpo-22702: Improves documentation for str.join method #156

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

Merged
merged 5 commits into from
May 27, 2017

Conversation

CuriousLearner
Copy link
Member

@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow these steps to rectify the issue:

  1. Sign the PSF contributor agreement
  2. Wait at least one US business day and then check "Your Details" on bugs.python.org to see if your account has been marked as having signed the CLA (the delay is due to a person having to manually check your signed CLA)
  3. Reply here saying you have completed the above steps

Thanks again to your contribution and we look forward to looking at it!

@serhiy-storchaka serhiy-storchaka added the docs Documentation in the Doc dir label Feb 18, 2017
@DimitrisJim
Copy link
Contributor

Hi @CuriousLearner! The original text seems fine to me, why do you think this change is warranted?

@CuriousLearner
Copy link
Member Author

Hi @DimitrisJim !

As in the issue Raymond & others mentioned that at least the usage of repeated iterable word should be removed. Moreover, in general to make the docstring less verbose, this change is suggested.

Is there something else wanted in this PR?

@DimitrisJim
Copy link
Contributor

DimitrisJim commented Feb 18, 2017

Yes the double use of iterable is odd here, my view is that that is the only thing needing change.

My main issue is that the sentence "separated by the string str provided in this method" seems more confusing than the original sentence.

@CuriousLearner
Copy link
Member Author

Sure, I've done the changes as suggested.

@CuriousLearner
Copy link
Member Author

CLA is signed and now visible in my account.

cc @ncoghlan

:term:`iterable` *iterable*. A :exc:`TypeError` will be raised if there are
any non-string values in *iterable*, including :class:`bytes` objects. The
separator between elements is the string providing this method.
:term:`iterable`. A :exc:`TypeError` will be raised if there are
Copy link
Member

Choose a reason for hiding this comment

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

IMHO *iterable* should be left, referring the parameter.

@wm75
Copy link

wm75 commented Mar 1, 2017

I don't think anything should be changed here. The double iterable is much less disturbing when formatted as html.

Copy link
Contributor

@marco-buttu marco-buttu left a comment

Choose a reason for hiding this comment

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

IMO it should be just "in iterable " and not "in the :term:iterable, as it is in the rest of the file when referring to the parameter iterable. Furthermore, you should apply the same modification to the bytearray.join() description, and add a second whitespace after the dot, before "A :exc:TypeError.

@ncoghlan
Copy link
Contributor

ncoghlan commented Apr 9, 2017

@CuriousLearner Sorry for the delayed review, but I'm inclined to agree with @marco-buttu here - the iterable to drop is the term reference, rather than the parameter name.

See http://bugs.python.org/issue22702#msg291366 for further discussion.

@CuriousLearner
Copy link
Member Author

Hi @marco-buttu & @ncoghlan !

I've made the changes according to earlier review. Please review :)

Copy link
Contributor

@marco-buttu marco-buttu left a comment

Choose a reason for hiding this comment

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

Just a minor change. The rest LGTM.

separator between elements is the string providing this method.
Return a string which is the concatenation of the strings in *iterable*.
A :exc:`TypeError` will be raised if there are any non-string values in
*iterable*, including :class:`bytes` objects. The separator between
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add an extra whitespace after the period? I mean, two whitespaces between objects. and The separator.

@CuriousLearner
Copy link
Member Author

Hi @marco-buttu ! I've updated the patch. Can you please take a look?

Copy link
Contributor

@marco-buttu marco-buttu left a comment

Choose a reason for hiding this comment

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

Thank you, ok to me :-)

that are not :term:`bytes-like objects <bytes-like object>`, including
:class:`str` objects. The separator between elements is the contents
of the bytes or bytearray object providing this method.
binary data sequences in the *iterable*. A :exc:`TypeError` will be
Copy link
Member

Choose a reason for hiding this comment

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

You dropped "the" before *iterable* in str.join() documentation, but kept it here. Is there a reason to keep it here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@berkerpeksag I don't remember any specific reason for that. Should I include the in str.join() documentation?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not a native speaker so I'll defer the decision to @ncoghlan :)

Copy link
Contributor

Choose a reason for hiding this comment

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

We want to drop it - "iterable" refers specifically to the method parameter rather than the general term, so it doesn't need "the" in front of it.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ncoghlan @berkerpeksag I've fixed it.

Is there something else needed for this PR?

@ncoghlan
Copy link
Contributor

Added the sprint label, as this PR was submitted at the PyCon Pune 2017 core development sprint.

Mariatta pushed a commit to Mariatta/cpython that referenced this pull request Jun 1, 2017
…onGH-156)

The "iterable iterable" phrasing created confusion between the term
reference and the parameter name.

This simplifies the phrasing to just use the parameter name
without linking directly to the term definition.
(cherry picked from commit 08e2f35)
Mariatta pushed a commit to Mariatta/cpython that referenced this pull request Jun 1, 2017
…onGH-156)

The "iterable iterable" phrasing created confusion between the term
reference and the parameter name.

This simplifies the phrasing to just use the parameter name
without linking directly to the term definition.
(cherry picked from commit 08e2f35)
Mariatta pushed a commit to Mariatta/cpython that referenced this pull request Jun 1, 2017
…onGH-156)

The "iterable iterable" phrasing created confusion between the term
reference and the parameter name.

This simplifies the phrasing to just use the parameter name
without linking directly to the term definition..
(cherry picked from commit 08e2f35)
Mariatta added a commit that referenced this pull request Jun 1, 2017
…H-1896)

The "iterable iterable" phrasing created confusion between the term
reference and the parameter name.

This simplifies the phrasing to just use the parameter name
without linking directly to the term definition.
(cherry picked from commit 08e2f35)
Mariatta added a commit that referenced this pull request Jun 1, 2017
…H-1897)

The "iterable iterable" phrasing created confusion between the term
reference and the parameter name.

This simplifies the phrasing to just use the parameter name
without linking directly to the term definition.
(cherry picked from commit 08e2f35)
Mariatta added a commit that referenced this pull request Jun 1, 2017
…H-1898)

The "iterable iterable" phrasing created confusion between the term
reference and the parameter name.

This simplifies the phrasing to just use the parameter name
without linking directly to the term definition..
(cherry picked from commit 08e2f35)
akruis pushed a commit to akruis/cpython that referenced this pull request Aug 16, 2018
…arning

Since merging commit c1c47c1, the Stackless test case
test_shutdown.TestShutdown.test_kill_modifies_slp_cstack_chain emits the
warning: "gc:0: ResourceWarning: gc: 1 uncollectable objects at
shutdown; use gc.set_debug(gc.DEBUG_UNCOLLECTABLE) to list them".
This commit disables GC for this test.
jaraco pushed a commit that referenced this pull request Dec 2, 2022
Use pre-existing info instead of making another API call.

python/miss-islington#153
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 sprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants