removing list comprehensions in Python 3.0

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steven Bethard

    #31
    Re: removing list comprehensions in Python 3.0

    Edvard Majakari wrote:[color=blue]
    > Steven Bethard <steven.bethard @gmail.com> writes:
    >[color=green]
    >>$ python -m timeit "for x in (i for i in xrange(10)): y = x"
    >>100000 loops, best of 3: 4.75 usec per loop[/color]
    >
    > Yowza! One of the features I really liked in Perl has shored Python island
    > somewhere in the 2.4'ies, it seems[1]. Thanks for the tip![/color]
    [snip][color=blue]
    > But using -m makes it much more convenient.[/color]

    Yup, it showed up in Python 2.4. Great, isn't it?

    STeVe

    Comment

    Working...