Message282530
(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(). |
|
| Date |
User |
Action |
Args |
| 2016-12-06 11:56:16 | arigo | set | recipients:
+ arigo |
| 2016-12-06 11:56:16 | arigo | set | messageid: <1481025376.08.0.891565434717.issue28884@psf.upfronthosting.co.za> |
| 2016-12-06 11:56:16 | arigo | link | issue28884 messages |
| 2016-12-06 11:56:15 | arigo | create | |
|