Python Forum
difference between range in py3 and xrange in py2
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
difference between range in py3 and xrange in py2
#7
I don't know how Python 3 is promoted but there is no programming language out there that has full compatibility between major versions.
Both xrange and python's 3 range are their own classes. Both have same functionality but their methods differs. I think this is advantage not inconvenience. This is evolving. It's not normal to keep all the old behaviour and methods. If it was the opposite a language package will be several gigabytes. And inventing new classes and functions name that are descriptive and not in conflict with the old ones will become something impossible.
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply


Messages In This Thread
RE: difference between range in py3 and xrange in py2 - by wavic - Apr-20-2018, 04:48 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  matplotlib x axis range goes over the set range Pedroski55 5 3,370 Nov-21-2021, 08:40 AM
Last Post: paul18fr
  Define a range, return all numbers of range that are NOT in csv data KiNeMs 18 7,351 Jan-24-2020, 06:19 AM
Last Post: KiNeMs
  Python2.7 xrange for loops - repeating though values already considered? nick5990 3 3,086 Mar-17-2018, 12:42 AM
Last Post: Larz60+
  range and xrange amrita 9 6,314 Jun-08-2017, 04:12 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020