-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Implement Py38 named expression (PEP 572) #1934
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
Implement Py38 named expression (PEP 572) #1934
Conversation
…ension, in other cases use regular evaluation order
Be carefull, when testing it in an existing workspace as the bytecode changed. Although, I set the new instruction to the end, such that it should have no interference with already compiled bytecode files, I cannot ensure it. |
thanks for tackling this. codes look quite good |
3ca1fba
to
8bdd69c
Compare
…arinings and cleanup required
8bdd69c
to
3ca1fba
Compare
3ca1fba
to
17008ef
Compare
…invalids are passed. Cleaned up in symboltable
b4cc2d7
to
1968c5d
Compare
Mostly done. Just need to add a few more checks, cleanup and merge. Some scoping issues will remain as they are an already existing RustPython problem. So we can fix that with a separate PR. |
Incrementally adding OpenBSD support (pt. 1)
…with-_io Initialize the vm with imports from _io instead of io
…ension, in other cases use regular evaluation order
…arinings and cleanup required
…invalids are passed. Cleaned up in symboltable
…ey/RustPython into TheAnyKey/p38_named_expr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for working on this!
@windelbouwman could you take a look at the symbol table changes? |
Ahh, nice, the infamous walrus operator! := |
…n from symbol resolution. Added some more comments.
…n from symbol resolution. Added some more comments.
…ey/RustPython into TheAnyKey/p38_named_expr
Python 3.8 instroduced named expressions or assignment expressions with PEP 572. Now it is possible
Most of the CPython tests are already passing. There are some scoping issues with mutli level (e.g., when a comprehension is inside of a comprehension, the asignments from the inner one are not leaked to the scope outside of the outer comrpehension). Further, there are no error messages when (ab)using iterator variables in named expressions. Both are generic topicsin RustPython and require a bit of rework in the symboltable and some other parts. As the functionality is complete besides of the scope limitation I propose to accept this PR.