Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0654be18
Commit
0654be18
authored
Apr 10, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
teach 2to3 about 'yield from'
parent
4ab92c80
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
Lib/lib2to3/Grammar.txt
Lib/lib2to3/Grammar.txt
+2
-1
Lib/lib2to3/tests/test_parser.py
Lib/lib2to3/tests/test_parser.py
+7
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/lib2to3/Grammar.txt
View file @
0654be18
...
...
@@ -155,4 +155,5 @@ testlist1: test (',' test)*
# not used in grammar, but may appear in "node" passed from Parser to Compiler
encoding_decl: NAME
yield_expr: 'yield' [testlist]
yield_expr: 'yield' [yield_arg]
yield_arg: 'from' test | testlist
Lib/lib2to3/tests/test_parser.py
View file @
0654be18
...
...
@@ -54,6 +54,13 @@ class TestMatrixMultiplication(GrammarTest):
self
.
validate
(
"a @= b"
)
class
TestYieldFrom
(
GrammarTest
):
def
test_matrix_multiplication_operator
(
self
):
self
.
validate
(
"yield from x"
)
self
.
validate
(
"(yield from x) + y"
)
self
.
invalid_syntax
(
"yield from"
)
class
TestRaiseChanges
(
GrammarTest
):
def
test_2x_style_1
(
self
):
self
.
validate
(
"raise"
)
...
...
Misc/NEWS
View file @
0654be18
...
...
@@ -168,6 +168,8 @@ Tests
Tools/Demos
-----------
- Add support for ``yield from`` to 2to3.
- Add support for the PEP 465 matrix multiplication operator to 2to3.
- Issue #16047: Fix module exception list and __file__ handling in freeze.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment