Changes between Version 1 and Version 2 of Ticket #3757, comment 1


Ignore:
Timestamp:
Feb 20, 2019, 3:14:33 AM (18 months ago)
Author:
pmav99
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #3757, comment 1

    v1 v2  
    11Python 2 has both {{{range()}}} and {{{xrange()}}}.
    22In Python 3, {{{range()}}} has been removed and {{{xrange()}}} has been renamed to {{{range()}}}.
     3
    34So 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).
    45