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

@emilyemorehouse emilyemorehouse 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
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! I used your example and added something similar.

Copy link
Member

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

@miss-islington
Copy link
Contributor

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

@miss-islington miss-islington merged commit 6357c95 into python:master Sep 11, 2019
@miss-islington
Copy link
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 <[email protected]>
@bedevere-bot
Copy link

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 <[email protected]>
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
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 news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants