Skip to content
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-35224: Additional documentation for Assignment Expressions #15935

Merged
merged 8 commits into from Sep 11, 2019

Conversation

@emilyemorehouse
Copy link
Member

commented Sep 11, 2019

Add or update assignment expression documentation for:

  • FAQ - Design
  • Reference - Expressions
  • Reference - Lexical Analysis

https://bugs.python.org/issue35224

Automerge-Triggered-By: @matrixise

@@ -151,66 +151,10 @@ to tell Python which namespace to use.
Why can't I use an assignment in an expression?
-----------------------------------------------

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

This comment has been minimized.

Copy link
@matrixise

matrixise Sep 11, 2019

Member

@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)

This comment has been minimized.

Copy link
@emilyemorehouse

emilyemorehouse Sep 11, 2019

Author Member

Thanks! I used your example and added something similar.

@matrixise
Copy link
Member

left a comment

Thank you

@miss-islington

This comment has been minimized.

Copy link

commented Sep 11, 2019

@emilyemorehouse: Status check is done, and it's a success .

@miss-islington miss-islington merged commit 6357c95 into python:master Sep 11, 2019

4 checks passed

Azure Pipelines PR #20190911.146 succeeded
Details
bedevere/issue-number Issue number 35224 found
Details
bedevere/news "skip news" label found
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@miss-islington

This comment has been minimized.

Copy link

commented Sep 11, 2019

Thanks @emilyemorehouse for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒🤖

miss-islington added a commit to miss-islington/cpython that referenced this pull request Sep 11, 2019
bpo-35224: Additional documentation for Assignment Expressions (pytho…
…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>
@bedevere-bot

This comment has been minimized.

Copy link

commented Sep 11, 2019

GH-15967 is a backport of this pull request to the 3.8 branch.

matrixise added a commit that referenced this pull request Sep 11, 2019
bpo-35224: Additional documentation for Assignment Expressions (GH-15935
) (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>
vrpolakatcisco added a commit to vrpolakatcisco/cpython that referenced this pull request Sep 12, 2019
bpo-35224: Additional documentation for Assignment Expressions (pytho…
…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
DinoV added a commit to DinoV/cpython that referenced this pull request Sep 12, 2019
bpo-35224: Additional documentation for Assignment Expressions (pytho…
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.