[issue32486] tail optimization for 'yield from'

2018-01-05 Thread Benjamin Peterson
Benjamin Peterson added the comment: The original yield from implementation did something like this, but we dropped it because it caused debuggability problems. See #14230 -- nosy: +benjamin.peterson resolution: -> rejected stage: -> resolved status: open ->

[issue32486] tail optimization for 'yield from'

2018-01-05 Thread Terry J. Reedy
Terry J. Reedy added the comment: I think this should have been first floated on python-ideas list. One objection is the same as for eliminating tail calls in general: it collapses tracebacks. def g1(): yield from g2() def g2(): yield 1/0 for i in g1(): pass

[issue32486] tail optimization for 'yield from'

2018-01-04 Thread Brett Cannon
Change by Brett Cannon : -- versions: +Python 3.7 -Python 3.6 ___ Python tracker ___ ___

[issue32486] tail optimization for 'yield from'

2018-01-04 Thread Brett Cannon
Change by Brett Cannon : -- type: resource usage -> enhancement ___ Python tracker ___ ___

[issue32486] tail optimization for 'yield from'

2018-01-03 Thread Robert Smart
New submission from Robert Smart : When a generator procedure ends with "yield from" it would be nice if this was handled efficiently (just replace the generator with the new source). Because it is natural to push things back into a generator with def