Skip to content

Correct some "-operator" mentions #10341

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 3 commits into from
Mar 27, 2019
Merged

Correct some "-operator" mentions #10341

merged 3 commits into from
Mar 27, 2019

Conversation

andresdelfino
Copy link
Contributor

No description provided.

@serhiy-storchaka
Copy link
Member

What is wrong with the current wording?

@andresdelfino
Copy link
Contributor Author

What is wrong with the current wording?

"X operator" is not a compound term to be written as "X-operator".

@serhiy-storchaka
Copy link
Member

What is wrong in double-star-operator? And what about ``*``\ -operator?

@andresdelfino
Copy link
Contributor Author

What is wrong in double-star-operator? And what about *\ -operator ?

My previous reply applies to both cases: "X-operator" is not a compound term to be written as such.

Regarding "double-star": it isn't referred with that name in any other place in the documentation, while "**" is, even where the "double-star-operator" reference point to.

@serhiy-storchaka
Copy link
Member

Sorry, I'm not competent to review this PR.

@andresdelfino
Copy link
Contributor Author

andresdelfino commented Nov 7, 2018

Sorry, I'm not competent to review this PR.

It's alright :) Neither of us is a native English speaker. We are just doing our best.

Copy link
Contributor

@scotchka scotchka left a comment

Choose a reason for hiding this comment

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

I think the changes are reasonable. The meaning is clear without the dash, which is visually cluttering. And "**" is more explicit than "double star".

@andresdelfino
Copy link
Contributor Author

@merwok perhaps we can merge this?

@merwok merwok merged commit dfd775a into python:master Mar 27, 2019
@miss-islington
Copy link
Contributor

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

@bedevere-bot
Copy link

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

@miss-islington
Copy link
Contributor

Sorry, @andresdelfino and @merwok, I could not cleanly backport this to 2.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker dfd775a0b1aee51d842b20cdebd97cc52c0b32e7 2.7

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 27, 2019
Change "star-operator" to "* operator".
(cherry picked from commit dfd775a)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
miss-islington added a commit that referenced this pull request Mar 27, 2019
Change "star-operator" to "* operator".
(cherry picked from commit dfd775a)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
@rhettinger
Copy link
Contributor

IMO, this should not have been committed. The prior wording made it clear that the double-star for dictionary unpacking was distinct from the ** operator used to call __pow__.

Please place preference on the intent of the original writer of the docs.

@andresdelfino andresdelfino deleted the patch-7 branch March 27, 2019 17:29
@andresdelfino
Copy link
Contributor Author

Hi, @rhettinger ! While I agree that making it clear that ** does not refer to the operator implemented by pow is great, I don't see how the previous wording made that explicit. Also, note that we are saying "*" instead of "star" while talking about tuple/list unpacking in the previous paragraph, which would cause the same confusion.

I think we could improve the wording by explicitly saying that "**" does not refer to the operator implemented by the special method "pow", likewise for "*". What do you think? If you agree, I'll make the PR.

@scotchka
Copy link
Contributor

scotchka commented Mar 27, 2019

There is an example immediately below the change in collections.rst that should make it clear in context that ** is not exponentiation:

>>> d = {'x': 11, 'y': 22}
>>> Point(**d)
Point(x=11, y=22)

A clarifying remark (e.g. "not to be confused with exponentiation") could be helpful, but I don't have a sense of how likely that confusion is.

rhettinger added a commit that referenced this pull request Mar 28, 2019
rhettinger added a commit that referenced this pull request Mar 28, 2019
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.

8 participants