Why the xrange function in the library code still works?

71 views Asked by At

I'm running python code on the Google Colab with Python3 kernel. I found that in the scipy.spatial.distance.cdist source code (using ??), it uses xrange somewhere as

        for i in xrange(0, mA):
            for j in xrange(0, mB):
                dm[i, j] = metric(XA[i], XB[j], **kwargs)

And I try to mimic the code in the colab notebook myself, however it says there is no xrange function. After some search, I realize that xrange function is no more supported in python3.

So my question is, why the scipy.spatial.distance.cdist still works while the xrange is already abandoned in python3? Doesn't it need a update?

0

There are 0 answers