Author rhettinger
Recipients bbrazil, cool-RR, docs@python, ezio.melotti, mark.dickinson, rhettinger, serhiy.storchaka, ysj.ray
Date 2012-12-02.17:18:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
ysj:  The "equivalent" means "roughly equivalent" not "precisely equivalent".  The purpose of the code in the docs is to help communicate what islice() is all about.  Practicality beats purity in this regard.  I know of no one who has ever been mislead by the islice() docs.

I don't really like the proposed patch -- it improves a bit on technical accuracy but forgoes readability and still falls short on what stop=None does and on which arguments are required.  

That said, I don't really like the current version of the "roughly equivalent code either".  It should probably be rewritten completely (no longer using slice() and it should show the actual looping logic.  For clarity, it may be helpful to split it into two code-equivalents, one for the finite case (where stop is specified) and one for the infinite case (where stop is None).  

As it stands, the examples are beating the code equivalent when it comes to communicating what islice() does.  I don't want to lengthen the code fragment unless it becomes *both* more communicative and more accurate.
Date User Action Args
2012-12-02 17:18:40rhettingersetrecipients: + rhettinger, mark.dickinson, ezio.melotti, cool-RR, ysj.ray, docs@python, bbrazil, serhiy.storchaka
2012-12-02 17:18:40rhettingersetmessageid: <>
2012-12-02 17:18:40rhettingerlinkissue11908 messages
2012-12-02 17:18:40rhettingercreate