histogrammar / histogrammar-docs

Jekyll sources for https://histogrammar.github.io/histogrammar-docs/.
Apache License 2.0
2 stars 2 forks source link

Fixed matplotlib doc issue with xrange(), hg alias was missing. Fixed issue #22 #23

Closed malhotrachetan closed 7 years ago

jpivarski commented 7 years ago

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 to range.

(Quick question: you know about xrange versus range in Pythons 2 and 3, right?)

malhotrachetan commented 7 years ago

Sorry I forgot this was for python 3. My bad. Xrange is missing in Python3 due to loop performance issues.

malhotrachetan commented 7 years ago

So Should I close this?

jpivarski commented 7 years ago

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.

malhotrachetan commented 7 years ago

Ok.