Armin Rigo added the comment: (B4) if you have a stack of generators where each is in 'yield from' from the next one, and you call '.next()' on the outermost, then it enters and leaves all intermediate frames. This is costly but may be required to get the sys.settrace()/setprofile() hooks called. However, if you call '.throw()' or '.close()' instead, then it uses a much more efficient way to go from the outermost to the innermost frame---as a result, the enter/leave of the intermediate frames is not invoked. This can confuse coverage tools and profilers. For example, in a stack ``f1()->f2()->f3()``, vmprof would show f3() as usually called via f2() from f1() but occasionally called directly from f1().
---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28884> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com