Skip to content

Fix failure test_assign_del() in Lib/test/test_syntax.py - #3879

Merged
youknowone merged 6 commits into
RustPython:mainfrom
key262yek:update-assign-del
Jul 20, 2022
Merged

youknowone merged 6 commits into
RustPython:mainfrom
key262yek:update-assign-del

Conversation

@key262yek

@key262yek key262yek commented Jul 14, 2022 •

Copy link
Copy Markdown
Contributor
  1. SyntaxError msg of del statement is changed from can't delete to cannot delete
  2. del operator now can handle list directly del [x]
  3. raise syntax error for cases (*x) and (**x) before pass them into del statement
  4. change error message to "cannot delete expression" for binary operators and unary operators.

fix #3882
fix #3878

@key262yek

Copy link
Copy Markdown
Contributor Author

Until the commit 532de56, commits are related to pr #3873

@key262yek
key262yek force-pushed the update-assign-del branch from 3cfac0f to f0e87b0 Compare July 14, 2022 03:08
@youknowone youknowone added the z-ca-2022 Tag to track contrubution-academy 2022 label Jul 14, 2022
@key262yek
key262yek force-pushed the update-assign-del branch 2 times, most recently from 7ecbc04 to 745839f Compare July 14, 2022 14:33
@fanninpm

fanninpm commented Jul 14, 2022 •

Copy link
Copy Markdown
Contributor

It seems that bb2aa27 ("Copy Lib/test/test_cmd_line_script.py from CPython v3.10.5") and 3f7fdf4 ("Update Lib/test/test_cmd_line_script.py to be runable") cancel each other out (with the exception of extra blank lines). The next time you rebase this PR, would you be open to dropping those two commits?

EDIT: It seems you beat me to it.

@key262yek
key262yek force-pushed the update-assign-del branch 2 times, most recently from e1dea76 to dfdfc17 Compare July 18, 2022 01:29
@fanninpm

Copy link
Copy Markdown
Contributor

Did you do a cargo build before you committed the change to the LALRPOP file?

@key262yek

Copy link
Copy Markdown
Contributor Author

@fanninpm I missed that point. After this commit, I will upload result of build too.

changes a short name of True, False, None from "keyword" to "True", "False", "None" themselves
@key262yek
key262yek force-pushed the update-assign-del branch 2 times, most recently from 9a34e3d to f541e13 Compare July 20, 2022 04:33
@key262yek
key262yek marked this pull request as ready for review July 20, 2022 05:07
@youknowone
youknowone requested a review from coolreader18 July 20, 2022 08:51

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is looking great! Thank you!

@youknowone

Copy link
Copy Markdown
Member

The commit message from third commit (02f51d4) includes unexisting commit id. Actually it seems not a revert commit. Could you fix the mssage?

@key262yek

Copy link
Copy Markdown
Contributor Author

fix #3878

Now star expression can be a argumnet for del statement.
In CPython, group expression parse single yield and named expression, and handle invalid starred expression at the same time.

I added it such parsing algorithm.

Update python.lalrpop
@key262yek
key262yek force-pushed the update-assign-del branch from f541e13 to c66d22d Compare July 20, 2022 09:10
@key262yek

Copy link
Copy Markdown
Contributor Author

@youknowone I changed the message.

@youknowone
youknowone merged commit a3df216 into RustPython:main Jul 20, 2022
@key262yek
key262yek deleted the update-assign-del branch September 21, 2022 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

z-ca-2022 Tag to track contrubution-academy 2022

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Statement parsing algorithm should be change cannot delete list directly del [x]

3 participants