Aspects


vs


Enumerate

Related to functions or methods that return enumerations or enumerated-types

Xrange

Xrange is a Python function that, unlike the traditional 'range' function, creates an iterator object rather than a list.

Others

Quality Example
Faster

"If you measure properly you ll see there s essentially no difference enumerate is microscopically faster than xrange in this example but well within noise"

from question "Why is Python's enumerate so slow?"

Also more appropriate

"Enumerate is also more appropriate than xrange"

from question "Optimise comparison between two lists, giving indices that differ"

More pythonic

"Enumerate is more pythonic but xrange is fine here too"

from question "Python Code to Create Sum of Neighbors and itself in the original list"

Slower

"Why is enumerate slower than xrange + lst i"

from question "Why is Python's enumerate so slow?"

Back to Home
Data comes from Stack Exchange with CC-BY-SA-3.0