Why is there no xrange function in Python3?

后端 未结 6 1109
广开言路
广开言路 2020-11-28 00:46

Recently I started using Python3 and it\'s lack of xrange hurts.

Simple example:

1) Python2:

from time import time as t
def          


        
6条回答
  •  执笔经年
    2020-11-28 01:13

    xrange from Python 2 is a generator and implements iterator while range is just a function. In Python3 I don't know why was dropped off the xrange.

提交回复
热议问题