Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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 67 commits into from
Jan 24, 2019
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 Jul 21, 2018
9e9156c
Add initial usage of := in grammar.
emilyemorehouse Jul 22, 2018
6eb766d
Update Python.asdl to match the grammar updates. Regenerated Include/…
emilyemorehouse Jul 22, 2018
4f42586
Update AST and compiler files in Python/ast.c and Python/compile.c. B…
emilyemorehouse Jul 22, 2018
e049ffa
Regenerate Lib/symbol.py using `./python Lib/symbol.py`
emilyemorehouse Jul 22, 2018
0b6bd95
Tests - Fix failing tests in test_parser.py due to changes in token n…
emilyemorehouse Jul 22, 2018
24e95fd
Tests - Add simple test for := token
emilyemorehouse Jul 23, 2018
d31135f
Tests - Add simple tests for named expressions using expr and suite
emilyemorehouse Jul 23, 2018
e19a900
Tests - Update number of levels for nested expressions to prevent sta…
emilyemorehouse Jul 23, 2018
aca4858
Update symbol table to handle NamedExpr
emilyemorehouse Aug 10, 2018
2c7b01e
Update Grammar to allow assignment expressions in if statements.
emilyemorehouse Aug 10, 2018
f0dad89
Tests - Add additional tests for named expressions in RoundtripLegalS…
emilyemorehouse Aug 31, 2018
fbea15f
Tests - Add temporary syntax test failure tests in test_parser.py
emilyemorehouse Sep 10, 2018
3cd271b
Add support for allowing assignment expressions as function argument …
emilyemorehouse Sep 10, 2018
7b34033
Tests - Move existing syntax tests out of test_parser.py and into tes…
emilyemorehouse Sep 10, 2018
13671f7
Add TargetScopeError exception to extend SyntaxError
emilyemorehouse Sep 11, 2018
5e4ba89
Tests - Update tests per PEP 572
emilyemorehouse Sep 11, 2018
c1c76ea
Documentation - Small updates to XXX/todo comments
emilyemorehouse Sep 11, 2018
0ebccb4
Fix assert in seq_for_testlist()
emilyemorehouse Sep 11, 2018
5500849
Cleanup - Denote "Not implemented -- No keyword args" on failing test…
emilyemorehouse Sep 11, 2018
38dfaa2
Tests - Wrap all file opens in `with...as` to ensure files are closed
emilyemorehouse Sep 11, 2018
3aaddc4
WIP: handle f(a := 1)
emilyemorehouse Sep 11, 2018
5d525a9
Tests and Cleanup - No longer skips keyword arg test. Keyword arg tes…
emilyemorehouse Sep 11, 2018
32dc443
Tests - Refactor last remaining test case that relied on on external …
emilyemorehouse Sep 11, 2018
d806088
Tests - Add better description of remaning skipped tests. Add test ch…
emilyemorehouse Sep 11, 2018
c1469bf
Tests - Add test for nested comprehension, testing value and scope. F…
emilyemorehouse Sep 11, 2018
e4e63ed
Handle restriction of LHS for named expressions - can only assign to …
emilyemorehouse Sep 12, 2018
db936c7
Tests - Update negative test case for assigning to lambda to match ne…
emilyemorehouse Sep 12, 2018
47e7367
Tests - Reorder test cases to group invalid syntax cases and named as…
emilyemorehouse Sep 12, 2018
787068e
Tests - Update test case for named expression in function argument - …
emilyemorehouse Sep 12, 2018
e21f5c8
Todo - Add todo for TargetScopeError based on Guido's comment (https:…
emilyemorehouse Sep 12, 2018
acd0f74
Tests - Add named expression tests for assignment operator in functio…
emilyemorehouse Sep 12, 2018
d0dd983
Add NamedStore to expr_context. Regenerate related code with `make re…
emilyemorehouse Sep 13, 2018
9b136d9
Add usage of NamedStore to ast_for_named_expr in ast.c. Update occura…
emilyemorehouse Sep 13, 2018
8fc5c99
Add ste_comprehension to _symtable_entry to track if the namespace is…
emilyemorehouse Sep 13, 2018
538dea4
s/symtable_add_def/symtable_add_def_helper. Add symtable_add_def to h…
emilyemorehouse Sep 13, 2018
ab34b0b
Refactor symtable_record_directive to take lineno and col_offset as a…
emilyemorehouse Sep 13, 2018
c04a08d
Handle elevating scope for named expressions in comprehensions.
emilyemorehouse Sep 14, 2018
f0297f8
Handle error for usage of named expression inside a class block
emilyemorehouse Sep 14, 2018
ee6d789
Tests - No longer skip scope tests. Add additional scope tests
emilyemorehouse Sep 14, 2018
c37e3c1
Cleanup - Update error message for named expression within a comprehe…
emilyemorehouse Sep 14, 2018
1db3fa9
Cleanup - Add missing case for NamedStore in expr_context_name. Remov…
emilyemorehouse Sep 14, 2018
0e29038
Refactor - Consolidate set_context and set_namedexpr_context to reduc…
emilyemorehouse Sep 14, 2018
2ff5744
Cleanup - Add additional use cases for ast_for_namedexpr in usage com…
emilyemorehouse Sep 14, 2018
2494008
Tests - Remove unnecessary test case. Renumber test case function names
emilyemorehouse Sep 14, 2018
794a1d1
Remove TargetScopeError for now. Will add back if needed
emilyemorehouse Sep 14, 2018
415d469
Cleanup - Small comment nit for consistency
emilyemorehouse Sep 14, 2018
162c8c4
Handle positional argument check with named expression
emilyemorehouse Sep 14, 2018
68e9e98
Add TargetScopeError exception definition. Add documentation for Targ…
emilyemorehouse Sep 14, 2018
1ad4b30
Increase stack size for parser by 200. This is a minimal change (appr…
emilyemorehouse Sep 14, 2018
1b1d84d
Add TargetScopeError to exception_hierarchy.txt for test_baseexceptio…
emilyemorehouse Sep 14, 2018
b80108b
Tests - Major update for named expression tests, both in test_named_e…
emilyemorehouse Sep 14, 2018
6e15f5f
Cleanup - Remove unnecessary comment
emilyemorehouse Sep 14, 2018
da11136
Cleanup - Comment nitpicks
emilyemorehouse Sep 14, 2018
051ad8c
Explicitly disallow assignment expressions to a name inside parenthes…
emilyemorehouse Sep 15, 2018
f893035
Cleanup - Wrap lines more strictly in test file
emilyemorehouse Sep 25, 2018
16d7137
Revert "Explicitly disallow assignment expressions to a name inside p…
emilyemorehouse Nov 13, 2018
070983b
Add NEWS.d entry
emilyemorehouse Nov 13, 2018
5133800
Tests - Fix error in test_pickle.test_exceptions by adding TargetScop…
emilyemorehouse Nov 13, 2018
bc2fed3
Tests - Update error message tests to reflect improved messaging conv…
emilyemorehouse Nov 20, 2018
f1cabf8
Remove cases that cannot be reached in compile.c. Small linting update.
emilyemorehouse Nov 27, 2018
0e0ca07
Update Grammar/Tokens to add COLONEQUAL. Regenerate all files
emilyemorehouse Jan 22, 2019
1153aae
Update TargetScopeError PRE_INIT and POST_INIT, as this was purposefu…
emilyemorehouse Jan 24, 2019
7775b0d
Add NamedStore back and regenerate files
emilyemorehouse Jan 24, 2019
10a71f8
Pass along line number and end col info for named expression
emilyemorehouse Jan 24, 2019
2b9a7bc
Simplify News entry
emilyemorehouse Jan 24, 2019
a63bf06
Fix compiler warning and explicity mark fallthrough
emilyemorehouse Jan 24, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleanup - Wrap lines more strictly in test file
  • Loading branch information
emilyemorehouse committed Jan 24, 2019
commit f893035b71b51ea3f73817d70f0de6fbafcb45d1
12 changes: 8 additions & 4 deletions 12 Lib/test/test_named_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,22 @@ def test_named_expression_invalid_10(self):
def test_named_expression_invalid_11(self):
code = """spam(a=1, b := 2)"""

with self.assertRaisesRegex(SyntaxError, "positional argument follows keyword argument"):
with self.assertRaisesRegex(SyntaxError,
"positional argument follows keyword argument"):
exec(code, {}, {})

def test_named_expression_invalid_12(self):
code = """spam(a=1, (b := 2))"""

with self.assertRaisesRegex(SyntaxError, "positional argument follows keyword argument"):
with self.assertRaisesRegex(SyntaxError,
"positional argument follows keyword argument"):
exec(code, {}, {})

def test_named_expression_invalid_13(self):
code = """spam(a=1, (b := 2))"""

with self.assertRaisesRegex(SyntaxError, "positional argument follows keyword argument"):
with self.assertRaisesRegex(SyntaxError,
"positional argument follows keyword argument"):
exec(code, {}, {})

def test_named_expression_invalid_14(self):
Expand All @@ -98,7 +101,8 @@ def test_named_expression_invalid_14(self):
def test_named_expression_invalid_15(self):
code = """(lambda: x := 1)"""

with self.assertRaisesRegex(SyntaxError, "can't use named assignment with lambda"):
with self.assertRaisesRegex(SyntaxError,
"can't use named assignment with lambda"):
exec(code, {}, {})

def test_named_expression_invalid_16(self):
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.