Changes between Version 1 and Version 2 of Ticket #3757, comment 1
- Timestamp:
- 02/20/19 03:14:33 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #3757, comment 1
v1 v2 1 1 Python 2 has both {{{range()}}} and {{{xrange()}}}. 2 2 In Python 3, {{{range()}}} has been removed and {{{xrange()}}} has been renamed to {{{range()}}}. 3 3 4 So any code using {{{xrange()}}} is not Python 3 compatible, so the answer is yes {{{xrange()}}} needs to be replaced by {{{range()}}}. This does lead to bigger RAM usage ({{{range()}}} creates a list while {{{xrange()}}} creates an iterator, although in the vast majority of the cases the impact is negligible (and when it isn't you should probably rethink your algorithms). 4 5