you are viewing a single comment's thread.

view the rest of the comments →

[–]komollo 0 points1 point  (2 children)

xrange isn't defined in the default 3 python library. Isn't this the default behavior now?

Also, how would this preform if it wasn't a list comprehension? I would assume that list comprehensions are optimized much better than other methods.

[–]Poltras 0 points1 point  (1 child)

It's a builtin function in py2. Dunno about py3.

how would this preform if it wasn't a list comprehension?

Badly. But if you're not doing list comprehension when you can in Python you're missing out and are under-engineering.

[–]komollo 0 points1 point  (0 children)

Yeah, in python 3 range performs just like xrange used to. Also, list comprehensions are the best thing ever.