mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
teach 2to3 about 'yield from'
This commit is contained in:
parent
4ab92c800a
commit
0654be18b3
3 changed files with 11 additions and 1 deletions
|
@ -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
|
||||||
|
|
|
@ -54,6 +54,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")
|
||||||
|
|
|
@ -168,6 +168,8 @@ Tests
|
||||||
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 #16047: Fix module exception list and __file__ handling in freeze.
|
- Issue #16047: Fix module exception list and __file__ handling in freeze.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue