bpo-35224: Additional documentation for Assignment Expressions#15935
Merged
miss-islington merged 8 commits intopython:masterfrom Sep 11, 2019
Merged
bpo-35224: Additional documentation for Assignment Expressions#15935miss-islington merged 8 commits intopython:masterfrom
miss-islington merged 8 commits intopython:masterfrom
Conversation
matrixise
reviewed
Sep 11, 2019
Doc/faq/design.rst
Outdated
| ----------------------------------------------- | ||
|
|
||
| Many people used to C or Perl complain that they want to use this C idiom: | ||
| Starting in Python 3.8, you can! There is a new syntax, `:=`, that assigns a |
Member
There was a problem hiding this comment.
@emilyemorehouse
Maybe with this sentence?
Starting in Python 3.8, you can use the walrus operator `:=` that assigns a variable in an expression::
while chunk := fp.read(200):
print(chunk)
Member
Author
There was a problem hiding this comment.
Thanks! I used your example and added something similar.
Contributor
|
@emilyemorehouse: Status check is done, and it's a success ✅ . |
Contributor
|
Thanks @emilyemorehouse for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Sep 11, 2019
…nGH-15935) Add or update assignment expression documentation for: - FAQ - Design - Reference - Expressions - Reference - Lexical Analysis https://bugs.python.org/issue35224 Automerge-Triggered-By: @matrixise (cherry picked from commit 6357c95) Co-authored-by: Emily Morehouse <emily@cuttlesoft.com>
|
GH-15967 is a backport of this pull request to the 3.8 branch. |
matrixise
pushed a commit
that referenced
this pull request
Sep 11, 2019
) (GH-15967) Add or update assignment expression documentation for: - FAQ - Design - Reference - Expressions - Reference - Lexical Analysis https://bugs.python.org/issue35224 Automerge-Triggered-By: @matrixise (cherry picked from commit 6357c95) Co-authored-by: Emily Morehouse <emily@cuttlesoft.com>
DinoV
pushed a commit
to DinoV/cpython
that referenced
this pull request
Sep 12, 2019
…nGH-15935) Add or update assignment expression documentation for: - FAQ - Design - Reference - Expressions - Reference - Lexical Analysis https://bugs.python.org/issue35224 Automerge-Triggered-By: @matrixise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add or update assignment expression documentation for:
https://bugs.python.org/issue35224
Automerge-Triggered-By: @matrixise