GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||
GeezerVison is showing github.com — gh-86482: Document assignment expression need for ()s by terryjreedy · Pull Request #23291 · python/cpython Conversation
|
|
This PR probably needs to be updated to reflect the recent changes introduced in #23317 and #23319. Sorry @terryjreedy! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
These are changes I hoped to be able to make ;-). I will add the new in 3.10 item for indexes. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
@terryjreedy are you still interested in landing this? A few older comments were never applied.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I somehow missed finishing this and would like it updated and merged. The doc is needed; someone just posted code to pydev that was missing required ()s. However, I just discovered that I have been recently de-authorized from merging anything. Jelle, you have been doing great with doc patches, so it would be fine with me if you finished this without waiting for that problem to be fixed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Pablo had turned off merges for everyone during the 3.11.0a7 release, but merges are allowed now again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me now. I'll merge it in a few days unless other people on the PR have more feedback.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I'm fine with documenting this more precisely, and the wording here looks fine. However, I don't have the time to review the facts -- I hope that Lysandros and Jelle can make sure that the claim made in the text is true (or as close to true as reasonable without spelling out the entire grammar). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| process(chunk) | ||
|
|
||
| Assignment expressions must be surrounded by parentheses when used | ||
| as sub-expressions in slicing, conditional, lambda, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Unparenthesized assignment expressions in slices were implemented in #23317, so they are allowed since 3.10. Also, assignment expression need to parenthesized in assert and with statements.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Unparenthesized walruses are allowed in index expressions but not slices. This is current 3.12:
>>> x[y:=3]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'x' is not defined
>>> x[y:=3:z:=4]
File "<stdin>", line 1
x[y:=3:z:=4]
^
SyntaxError: invalid syntax
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Correct! I mixed up indexes/slices. Sorry!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @terryjreedy for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-97986 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…-23291) Co-authored-by: Jelle Zijlstra <[email protected]> (cherry picked from commit 2b5f136) Co-authored-by: Terry Jan Reedy <[email protected]>
|
GH-97987 is a backport of this pull request to the 3.10 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…-23291) Co-authored-by: Jelle Zijlstra <[email protected]> (cherry picked from commit 2b5f136) Co-authored-by: Terry Jan Reedy <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]> (cherry picked from commit 2b5f136) Co-authored-by: Terry Jan Reedy <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]> (cherry picked from commit 2b5f136) Co-authored-by: Terry Jan Reedy <[email protected]>
* main: fixes pythongh-96078: os.sched_yield release the GIL while calling sched_yield(2). (pythongh-97965) pythongh-65961: Do not rely solely on `__cached__` (pythonGH-97990) pythongh-97850: Remove the open issues section from the import reference (python#97935) Docs: pin sphinx-lint (pythonGH-97992) pythongh-94590: add signatures to operator itemgetter, attrgetter, methodcaller (python#94591) Add Pynche's move to the What's new in 3.11 (python#97974) pythongh-97781: Apply changes from importlib_metadata 5. (pythonGH-97785) pythongh-86482: Document assignment expression need for ()s (python#23291) pythongh-97943: PyFunction_GetAnnotations should return a borrowed reference. (python#97949) pythongh-94808: Coverage: Test that maximum indentation level is handled (python#95926)
* main: pythonGH-97002: Prevent `_PyInterpreterFrame`s from backing more than one `PyFrameObject` (pythonGH-97996) pythongh-97973: Return all necessary information from the tokenizer (pythonGH-97984) fixes pythongh-96078: os.sched_yield release the GIL while calling sched_yield(2). (pythongh-97965) pythongh-65961: Do not rely solely on `__cached__` (pythonGH-97990) pythongh-97850: Remove the open issues section from the import reference (python#97935) Docs: pin sphinx-lint (pythonGH-97992) pythongh-94590: add signatures to operator itemgetter, attrgetter, methodcaller (python#94591) Add Pynche's move to the What's new in 3.11 (python#97974) pythongh-97781: Apply changes from importlib_metadata 5. (pythonGH-97785) pythongh-86482: Document assignment expression need for ()s (python#23291) pythongh-97943: PyFunction_GetAnnotations should return a borrowed reference. (python#97949)
…3291) Co-authored-by: Jelle Zijlstra <[email protected]>
Co-authored-by: Jelle Zijlstra <[email protected]> (cherry picked from commit 2b5f136) Co-authored-by: Terry Jan Reedy <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.