classification
Title: Additional recipes for itertools docs
Type: enhancement Stage: patch review
Components: Documentation Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: asvetlov, docs@python, ezio.melotti, kachayev, python-dev, rhettinger, serhiy.storchaka
Priority: low Keywords: patch

Created on 2012-12-24 20:40 by kachayev, last changed 2014-05-26 05:05 by rhettinger. This issue is now closed.

Files
File name Uploaded Description Edit
itertools.doc.diff kachayev, 2012-12-24 20:40 review
itertools.doc.v2.diff kachayev, 2012-12-25 21:23 Updated review
itertools.doc.v3.diff kachayev, 2013-01-18 15:13 fixed review
Messages (8)
msg178098 - (view) Author: Alexey Kachayev (kachayev) * Date: 2012-12-24 20:40
Additional recipes for itertools documentation (widespread functions in other programming languages):
* drop
* split-at
* split-by
msg178164 - (view) Author: Alexey Kachayev (kachayev) * Date: 2012-12-25 21:23
Added:
* takelast
* droplast
msg180196 - (view) Author: Alexey Kachayev (kachayev) * Date: 2013-01-18 15:13
Updated patch with:
* fix error in islice function name
* made n=None default second argument for consume(iterator, n=None) cause it provides specific behavior when n is None which can be assumed as default for function
msg180212 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2013-01-18 19:14
How are popular the proposed recipes? Not every possible combination of functions is worth to mention in the documentation.
msg180237 - (view) Author: Alexey Kachayev (kachayev) * Date: 2013-01-19 09:31
It's hard to evaluate how popular given recipes, but:
* drop is opposite to take, so it's as popular as take
* the same situation with splitat, splitby - it's one case of partition that's hard to write each time with enumerator (partition is already in documentation)
* takelast, droplast was added cause itertools.islice doesn't support negative indices (which is ok). both functions have not obvious implementation - I'm sure that recipes will be good example for users how to work with iterators even if concrete functions aren't so widely-spreaded
msg184004 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2013-03-12 03:39
I will add drop() to the recipes and possibly take_last() which I would rename add tail().

Sorry, I don't have interest in the others.  I don't find them instructive or very useful.
msg219128 - (view) Author: Roundup Robot (python-dev) Date: 2014-05-26 05:04
New changeset 2781fb146f4a by Raymond Hettinger in branch 'default':
Issue 16774:  Add a new itertools recipe (suggested by Alexey Kachayev).
http://hg.python.org/cpython/rev/2781fb146f4a
msg219129 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2014-05-26 05:05
In the end, I decided to add a variant of take_last().

Thank you for the suggestion.
History
Date User Action Args
2014-05-26 05:05:16rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg219129
2014-05-26 05:04:09python-devsetnosy: + python-dev
messages: + msg219128
2014-05-26 05:02:11rhettingersetversions: + Python 3.5, - Python 2.7, Python 3.2, Python 3.3, Python 3.4
2013-03-12 03:39:13rhettingersetpriority: normal -> low

messages: + msg184004
2013-01-19 09:31:10kachayevsetmessages: + msg180237
2013-01-18 19:14:41serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg180212
2013-01-18 15:13:25kachayevsetfiles: + itertools.doc.v3.diff

messages: + msg180196
2012-12-25 21:23:31kachayevsetfiles: + itertools.doc.v2.diff

messages: + msg178164
2012-12-24 20:41:36ezio.melottisetversions: + Python 2.7, Python 3.2, Python 3.3
nosy: + rhettinger, ezio.melotti

assignee: docs@python -> rhettinger
type: enhancement
stage: patch review
2012-12-24 20:40:15kachayevcreate