-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-35224: PEP 572 Implementation #10497
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
11e9898
Add tokenization of :=
emilyemorehouse 9e9156c
Add initial usage of := in grammar.
emilyemorehouse 6eb766d
Update Python.asdl to match the grammar updates. Regenerated Include/…
emilyemorehouse 4f42586
Update AST and compiler files in Python/ast.c and Python/compile.c. B…
emilyemorehouse e049ffa
Regenerate Lib/symbol.py using `./python Lib/symbol.py`
emilyemorehouse 0b6bd95
Tests - Fix failing tests in test_parser.py due to changes in token n…
emilyemorehouse 24e95fd
Tests - Add simple test for := token
emilyemorehouse d31135f
Tests - Add simple tests for named expressions using expr and suite
emilyemorehouse e19a900
Tests - Update number of levels for nested expressions to prevent sta…
emilyemorehouse aca4858
Update symbol table to handle NamedExpr
emilyemorehouse 2c7b01e
Update Grammar to allow assignment expressions in if statements.
emilyemorehouse f0dad89
Tests - Add additional tests for named expressions in RoundtripLegalS…
emilyemorehouse fbea15f
Tests - Add temporary syntax test failure tests in test_parser.py
emilyemorehouse 3cd271b
Add support for allowing assignment expressions as function argument …
emilyemorehouse 7b34033
Tests - Move existing syntax tests out of test_parser.py and into tes…
emilyemorehouse 13671f7
Add TargetScopeError exception to extend SyntaxError
emilyemorehouse 5e4ba89
Tests - Update tests per PEP 572
emilyemorehouse c1c76ea
Documentation - Small updates to XXX/todo comments
emilyemorehouse 0ebccb4
Fix assert in seq_for_testlist()
emilyemorehouse 5500849
Cleanup - Denote "Not implemented -- No keyword args" on failing test…
emilyemorehouse 38dfaa2
Tests - Wrap all file opens in `with...as` to ensure files are closed
emilyemorehouse 3aaddc4
WIP: handle f(a := 1)
emilyemorehouse 5d525a9
Tests and Cleanup - No longer skips keyword arg test. Keyword arg tes…
emilyemorehouse 32dc443
Tests - Refactor last remaining test case that relied on on external …
emilyemorehouse d806088
Tests - Add better description of remaning skipped tests. Add test ch…
emilyemorehouse c1469bf
Tests - Add test for nested comprehension, testing value and scope. F…
emilyemorehouse e4e63ed
Handle restriction of LHS for named expressions - can only assign to …
emilyemorehouse db936c7
Tests - Update negative test case for assigning to lambda to match ne…
emilyemorehouse 47e7367
Tests - Reorder test cases to group invalid syntax cases and named as…
emilyemorehouse 787068e
Tests - Update test case for named expression in function argument - …
emilyemorehouse e21f5c8
Todo - Add todo for TargetScopeError based on Guido's comment (https:…
emilyemorehouse acd0f74
Tests - Add named expression tests for assignment operator in functio…
emilyemorehouse d0dd983
Add NamedStore to expr_context. Regenerate related code with `make re…
emilyemorehouse 9b136d9
Add usage of NamedStore to ast_for_named_expr in ast.c. Update occura…
emilyemorehouse 8fc5c99
Add ste_comprehension to _symtable_entry to track if the namespace is…
emilyemorehouse 538dea4
s/symtable_add_def/symtable_add_def_helper. Add symtable_add_def to h…
emilyemorehouse ab34b0b
Refactor symtable_record_directive to take lineno and col_offset as a…
emilyemorehouse c04a08d
Handle elevating scope for named expressions in comprehensions.
emilyemorehouse f0297f8
Handle error for usage of named expression inside a class block
emilyemorehouse ee6d789
Tests - No longer skip scope tests. Add additional scope tests
emilyemorehouse c37e3c1
Cleanup - Update error message for named expression within a comprehe…
emilyemorehouse 1db3fa9
Cleanup - Add missing case for NamedStore in expr_context_name. Remov…
emilyemorehouse 0e29038
Refactor - Consolidate set_context and set_namedexpr_context to reduc…
emilyemorehouse 2ff5744
Cleanup - Add additional use cases for ast_for_namedexpr in usage com…
emilyemorehouse 2494008
Tests - Remove unnecessary test case. Renumber test case function names
emilyemorehouse 794a1d1
Remove TargetScopeError for now. Will add back if needed
emilyemorehouse 415d469
Cleanup - Small comment nit for consistency
emilyemorehouse 162c8c4
Handle positional argument check with named expression
emilyemorehouse 68e9e98
Add TargetScopeError exception definition. Add documentation for Targ…
emilyemorehouse 1ad4b30
Increase stack size for parser by 200. This is a minimal change (appr…
emilyemorehouse 1b1d84d
Add TargetScopeError to exception_hierarchy.txt for test_baseexceptio…
emilyemorehouse b80108b
Tests - Major update for named expression tests, both in test_named_e…
emilyemorehouse 6e15f5f
Cleanup - Remove unnecessary comment
emilyemorehouse da11136
Cleanup - Comment nitpicks
emilyemorehouse 051ad8c
Explicitly disallow assignment expressions to a name inside parenthes…
emilyemorehouse f893035
Cleanup - Wrap lines more strictly in test file
emilyemorehouse 16d7137
Revert "Explicitly disallow assignment expressions to a name inside p…
emilyemorehouse 070983b
Add NEWS.d entry
emilyemorehouse 5133800
Tests - Fix error in test_pickle.test_exceptions by adding TargetScop…
emilyemorehouse bc2fed3
Tests - Update error message tests to reflect improved messaging conv…
emilyemorehouse f1cabf8
Remove cases that cannot be reached in compile.c. Small linting update.
emilyemorehouse 0e0ca07
Update Grammar/Tokens to add COLONEQUAL. Regenerate all files
emilyemorehouse 1153aae
Update TargetScopeError PRE_INIT and POST_INIT, as this was purposefu…
emilyemorehouse 7775b0d
Add NamedStore back and regenerate files
emilyemorehouse 10a71f8
Pass along line number and end col info for named expression
emilyemorehouse 2b9a7bc
Simplify News entry
emilyemorehouse a63bf06
Fix compiler warning and explicity mark fallthrough
emilyemorehouse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Explicitly disallow assignment expressions to a name inside parenthes…
…es, e.g.: ((x) := 0) - Add check for LHS types to detect a parenthesis then a name (see note) - Add test for this scenario - Update tests for changed error message for named assignment to a tuple (also, see note) Note: This caused issues with the previous error handling for named assignment to a LHS that contained an expression, such as a tuple. Thus, the check for the LHS of a named expression must be changed to be more specific if we wish to maintain the previous error messages
- Loading branch information
commit 051ad8c998ed48d25d0b246181801a02d60e843d
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.