ranges
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
I failed to notice this trick, and I'd rather just use plain range. Overriding builtins is not a very good practice, and the performance drawback of using range instead of xrange in Python2 is negligible for such non-critical piece of software
In [1]: %timeit sum(range(1000)) 100000 loops, best of 3: 7.72 µs per loop In [2]: %timeit sum(xrange(1000)) 100000 loops, best of 3: 6.56 µs per loop