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
00109c9b
Commit
00109c9b
authored
Apr 10, 2014
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
teach 2to3 about 'yield from'
parent
da952f3f
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 @
00109c9b
...
...
@@ -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 @
00109c9b
...
...
@@ -50,6 +50,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 @
00109c9b
...
...
@@ -266,6 +266,8 @@ Library
Tools
/
Demos
-----------
-
Add
support
for
``
yield
from
``
to
2
to3
.
-
Add
support
for
the
PEP
465
matrix
multiplication
operator
to
2
to3
.
-
Issue
#
19936
:
Added
executable
bits
or
shebang
lines
to
Python
scripts
which
...
...
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