[issue33555] No SyntaxError raised for `return` with argument inside generator

2018-05-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also What’s New In Python 3.3: https://docs.python.org/3/whatsnew/3.3.html#pep-380-syntax-for-delegating-to-a-subgenerator And PEP 380 itself. -- ___ Python tracker

[issue33555] No SyntaxError raised for `return` with argument inside generator

2018-05-17 Thread FHTMitchell
FHTMitchell added the comment: Whoops I understand. Reclosed. -- resolution: -> not a bug status: open -> closed ___ Python tracker

[issue33555] No SyntaxError raised for `return` with argument inside generator

2018-05-17 Thread FHTMitchell
FHTMitchell added the comment: Apologies if I wasn't clear. I understand that def f(): yield 1 return is valid python. What I'm saying, if you follow the link, is that def f(): yield 1 return 2 # not the argument should not be considered valid python

[issue33555] No SyntaxError raised for `return` with argument inside generator

2018-05-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is not silently ignored. It is used as an argument to construct StopIteration. See The Python Language Reference: https://docs.python.org/3/reference/simple_stmts.html#the-return-statement -- nosy: +serhiy.storchaka

[issue33555] No SyntaxError raised for `return` with argument inside generator

2018-05-17 Thread FHTMitchell
New submission from FHTMitchell : In python 2.7 if you run the following code you get an error (as you would expect) Python 2.7.14 | packaged by conda-forge | (default, Dec 25 2017, 01:17:32) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or