Eli Bendersky <eli...@gmail.com> added the comment:
Is it really *interesting* to trace separate parts of list comprehensions
like this? What would one want to do that? The only idea I have in mind of
perhaps for comprehensions containing 'if's, to know how many times the
comprehension was actually executed.
In any case, this indeed depends quite a lot on the internal representation
of comprehensions.
----------
Added file: http://bugs.python.org/file18888/unnamed
_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9315>
_______________________________________
<div dir="ltr"><br><div class="gmail_quote"><blockquote class="gmail_quote"
style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;"><div class="im">
> It looks like 3.1 with computed gotos produces the yet another different
tracing of list comprehensions:<br>
><br>
><br>
> Â Â 2: l = [i for<br>
> Â Â 10: Â Â Â i in<br>
> Â Â 1: Â Â Â range(10)]<br>
<br>
</div>Well, this kind of thing is going to depend on the exact bytecode, the<br>
way the evaluation loop is written, etc. That's why I would suggest<br>
checking that the number of traced iterations is between, e.g. 10 (since<br>
it's the number of loop iterations) and 15 (to account for any<br>
additional "iterations" due to various inner jumps in the
bytecode.<br>
<div><div></div><br></div></blockquote></div><br>Is it really *interesting* to
trace separate parts of list comprehensions like this? What would one want to
do that? The only idea I have in mind of perhaps for comprehensions containing
'if's, to know how many times the comprehension was actually
executed.<br>
<br>In any case, this indeed depends quite a lot on the internal representation
of comprehensions.<br></div>
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com