Kaydet (Commit) 00109c9b authored tarafından Benjamin Peterson's avatar Benjamin Peterson

teach 2to3 about 'yield from'

üst da952f3f
...@@ -155,4 +155,5 @@ testlist1: test (',' test)* ...@@ -155,4 +155,5 @@ testlist1: test (',' test)*
# not used in grammar, but may appear in "node" passed from Parser to Compiler # not used in grammar, but may appear in "node" passed from Parser to Compiler
encoding_decl: NAME encoding_decl: NAME
yield_expr: 'yield' [testlist] yield_expr: 'yield' [yield_arg]
yield_arg: 'from' test | testlist
...@@ -50,6 +50,13 @@ class TestMatrixMultiplication(GrammarTest): ...@@ -50,6 +50,13 @@ class TestMatrixMultiplication(GrammarTest):
self.validate("a @= b") 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): class TestRaiseChanges(GrammarTest):
def test_2x_style_1(self): def test_2x_style_1(self):
self.validate("raise") self.validate("raise")
......
...@@ -266,6 +266,8 @@ Library ...@@ -266,6 +266,8 @@ Library
Tools/Demos Tools/Demos
----------- -----------
- Add support for ``yield from`` to 2to3.
- Add support for the PEP 465 matrix multiplication operator to 2to3. - Add support for the PEP 465 matrix multiplication operator to 2to3.
- Issue #19936: Added executable bits or shebang lines to Python scripts which - Issue #19936: Added executable bits or shebang lines to Python scripts which
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment