Closed malhotrachetan closed 7 years ago
Sorry I forgot this was for python 3. My bad. Xrange is missing in Python3 due to loop performance issues.
So Should I close this?
Not sure what you mean by that, but Python 2's xrange
is Python 3's range
. If you just put range
, then it will work in both but be slower in Python 2. For small things in documentation, performance differences like that don't matter, but clarity does.
If you want me to merge this, just change it to range
. (And then it will take me some time to propagate it to the actual website, but at least the git copy will be right.
Ok.
hg.xrange
was not intended to be part of the public API; it's a definition that allows Histogrammar to be Pythons 2 and 3 compliant. It's okay for users to notice that it's in there (Python isn't paranoid about users seeing private data), but we shouldn't encourage its use in documentation.Since performance doesn't matter in documentation, you can just change
xrange
torange
.(Quick question: you know about
xrange
versusrange
in Pythons 2 and 3, right?)