This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients amaury.forgeotdarc, belopolsky, eli.bendersky, ezio.melotti, georg.brandl, pitrou, terry.reedy
Date 2010-09-13.18:00:13
SpamBayes Score 8.19628e-06
Marked as misclassified No
Message-id <1284400820.83.0.846942419259.issue9315@psf.upfronthosting.co.za>
In-reply-to
Content
Eli, while porting your tests to py3k, I had to change expected output for list comprehension testing.  This is not really surprising because 3.x comprehensions differ from 2.x (they don't leak the loop variable anymore).

The difference between versions is most pronounced if a comprehension is spread in several lines:


l = [i for
     i in
     range(10)]

The coverage of the above code in 2.x is

    1: l = [i for
            i in
   11:      range(10)]

but in 3.x, I get

   12: l = [i for
   10:      i in
    1:      range(10)]

Not surprisingly, 3.x coverage output for generators is the same as for comprehensions:

   12: l = list(i for
   10:          i in
    1:          range(10))

but in 2.x,

   12: l = list(i for
                i in
    1:          range(10))

In any case, I think the counts from the second and third line (10 and 1) are probably correct in 3.x, but I cannot explain 12 in the first line.
History
Date User Action Args
2010-09-13 18:00:20belopolskysetrecipients: + belopolsky, georg.brandl, terry.reedy, amaury.forgeotdarc, pitrou, ezio.melotti, eli.bendersky
2010-09-13 18:00:20belopolskysetmessageid: <1284400820.83.0.846942419259.issue9315@psf.upfronthosting.co.za>
2010-09-13 18:00:13belopolskylinkissue9315 messages
2010-09-13 18:00:13belopolskycreate