-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
bpo-38558: Link to further docs from walrus operator mention in tutorial #16973
Conversation
I don't think an off-hand mention in the tutorial is a good spot for
You don't have to know what C is to broadly understand the problem here, one can just ignore the parts mentioning C and still understand it. I think the comparison to a known language where this bug is common helps clarify the motivation for the existence of the walrus.
An example would be useful but I think some thought needs to be given to what would be useful in this context and not covered by the walrus operator's whatsnew entry (maybe a link to it should be added instead). |
Agreed with everything @ammaraskar mentioned. If anything is to be changed here, I think just a link to the docs for the walrus operator would be plenty. |
@adorilson, please respond to the review comments. |
Hi, people. I concord with some points, but not totally. I'm OK about I think we need put some details about walrus operator in tutorial or at least a reference before datastructures chapter. What's you think about first-steps-towards-programming section? It's look a good place for me. This section cite all the other operators used in conditions. |
I concur with @zware, please keep it simple, it's just a note, and it's just a tutorial. Just link to https://docs.python.org/3/faq/design.html#why-can-t-i-use-an-assignment-in-an-expression which is the only part of the doc where we "document" the walrus (there's /reference/ but again it's a tutorial, it's not nice to send newcomers to read the reference). |
@adorilson, I agree with @zware and @JulienPalard, where just adding a link would be best. The C language was mentioned in the prior version of this section. The change that added
Based on that, I don't think it needs to be covered in detail. I checked the PEP for the discussions that had occurred around teaching this operator and didn't find anything there, but I seemed to recall that this operator was a more advanced concept that wouldn't need to be taught to beginners. I think it's OK to leave it out of the tutorial (except for correcting the original note), except, as others have suggested, adding a link to the note that was already added. Thanks! |
I reverted the previous commits and I done this. |
Co-Authored-By: Cheryl Sabella <cheryl.sabella@gmail.com>
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 And if you don't make the requested changes, you will be put in the comfy chair! |
I have made the requested changes; please review again |
Thanks for making the requested changes! @zware: please review the changes made to this pull request. |
Thanks @adorilson for the PR, and @JulienPalard for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
…ial (pythonGH-16973) (cherry picked from commit 5807efd) Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
GH-18335 is a backport of this pull request to the 3.8 branch. |
Thanks @adorilson for this PR! |
This PR:
https://bugs.python.org/issue38558