Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional recipes for itertools docs #60978

Closed
kachayev mannequin opened this issue Dec 24, 2012 · 8 comments
Closed

Additional recipes for itertools docs #60978

kachayev mannequin opened this issue Dec 24, 2012 · 8 comments
Assignees
Labels
docs Documentation in the Doc dir type-feature A feature request or enhancement

Comments

@kachayev
Copy link
Mannequin

kachayev mannequin commented Dec 24, 2012

BPO 16774
Nosy @rhettinger, @ezio-melotti, @asvetlov, @serhiy-storchaka
Files
  • itertools.doc.diff
  • itertools.doc.v2.diff: Updated
  • itertools.doc.v3.diff: fixed
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/rhettinger'
    closed_at = <Date 2014-05-26.05:05:16.718>
    created_at = <Date 2012-12-24.20:40:15.077>
    labels = ['type-feature', 'docs']
    title = 'Additional recipes for itertools docs'
    updated_at = <Date 2014-05-26.05:05:16.717>
    user = 'https://bugs.python.org/kachayev'

    bugs.python.org fields:

    activity = <Date 2014-05-26.05:05:16.717>
    actor = 'rhettinger'
    assignee = 'rhettinger'
    closed = True
    closed_date = <Date 2014-05-26.05:05:16.718>
    closer = 'rhettinger'
    components = ['Documentation']
    creation = <Date 2012-12-24.20:40:15.077>
    creator = 'kachayev'
    dependencies = []
    files = ['28427', '28433', '28768']
    hgrepos = []
    issue_num = 16774
    keywords = ['patch']
    message_count = 8.0
    messages = ['178098', '178164', '180196', '180212', '180237', '184004', '219128', '219129']
    nosy_count = 7.0
    nosy_names = ['rhettinger', 'ezio.melotti', 'asvetlov', 'docs@python', 'python-dev', 'serhiy.storchaka', 'kachayev']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = 'patch review'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue16774'
    versions = ['Python 3.5']

    @kachayev
    Copy link
    Mannequin Author

    kachayev mannequin commented Dec 24, 2012

    Additional recipes for itertools documentation (widespread functions in other programming languages):

    • drop
    • split-at
    • split-by

    @kachayev kachayev mannequin assigned docspython Dec 24, 2012
    @kachayev kachayev mannequin added the docs Documentation in the Doc dir label Dec 24, 2012
    @ezio-melotti ezio-melotti added the type-feature A feature request or enhancement label Dec 24, 2012
    @kachayev
    Copy link
    Mannequin Author

    kachayev mannequin commented Dec 25, 2012

    Added:

    • takelast
    • droplast

    @kachayev
    Copy link
    Mannequin Author

    kachayev mannequin commented Jan 18, 2013

    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

    @serhiy-storchaka
    Copy link
    Member

    How are popular the proposed recipes? Not every possible combination of functions is worth to mention in the documentation.

    @kachayev
    Copy link
    Mannequin Author

    kachayev mannequin commented Jan 19, 2013

    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

    @rhettinger
    Copy link
    Contributor

    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.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 26, 2014

    New changeset 2781fb146f4a by Raymond Hettinger in branch 'default':
    bpo-16774: Add a new itertools recipe (suggested by Alexey Kachayev).
    http://hg.python.org/cpython/rev/2781fb146f4a

    @rhettinger
    Copy link
    Contributor

    In the end, I decided to add a variant of take_last().

    Thank you for the suggestion.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants