mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Implement PEP 380 - 'yield from' (closes #11682)
This commit is contained in:
parent
e51757f6de
commit
1f7ce62bd6
33 changed files with 872 additions and 421 deletions
|
@ -50,6 +50,10 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
|
|||
self.check_suite("def f(): (yield 1)*2")
|
||||
self.check_suite("def f(): return; yield 1")
|
||||
self.check_suite("def f(): yield 1; return")
|
||||
self.check_suite("def f(): yield from 1")
|
||||
self.check_suite("def f(): x = yield from 1")
|
||||
self.check_suite("def f(): f((yield from 1))")
|
||||
self.check_suite("def f(): yield 1; return 1")
|
||||
self.check_suite("def f():\n"
|
||||
" for x in range(30):\n"
|
||||
" yield x\n")
|
||||
|
@ -621,7 +625,6 @@ class OtherParserCase(unittest.TestCase):
|
|||
with self.assertRaises(TypeError):
|
||||
parser.expr("a", "b")
|
||||
|
||||
|
||||
def test_main():
|
||||
support.run_unittest(
|
||||
RoundtripLegalSyntaxTestCase,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue