From 0379fa1b368aea80c3572ca3caeafa7436de248d Mon Sep 17 00:00:00 2001 From: accraze Date: Thu, 22 Dec 2016 16:20:30 -0800 Subject: [PATCH 1/3] added itertools docs fixes #954 --- docs/language/core.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/language/core.rst b/docs/language/core.rst index 288d72a..2650430 100644 --- a/docs/language/core.rst +++ b/docs/language/core.rst @@ -1280,3 +1280,22 @@ also includes all Python reserved words. All names are in unmangled form => (import hy) => (in "defclass" (hy.core.reserved.names)) True + + +Included itertools +================== + +All of Python's itertools are available, however some of the names have been +changed: + +- `starmap` has been changed to `*map` + + + - `combinations_with_replacement` has been changed to `multicombinations` + + - `groupby` has been changed to`group-by` + + - `takewhile` has been changed to `take-while` + + Please refer to the `Python documentation + `_ for more information. From b9106de1ab87fd5442f8108c764f851c3e82125d Mon Sep 17 00:00:00 2001 From: gilch Date: Wed, 4 Jan 2017 13:04:41 -0700 Subject: [PATCH 2/3] list all itertools --- docs/language/core.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/language/core.rst b/docs/language/core.rst index 2650430..f14785c 100644 --- a/docs/language/core.rst +++ b/docs/language/core.rst @@ -1285,17 +1285,23 @@ also includes all Python reserved words. All names are in unmangled form Included itertools ================== +count cycle repeat accumulate chain compress drop-while remove group-by islice *map take-while tee zip-longest product permutations combinations multicombinations +--------- + All of Python's itertools are available, however some of the names have been changed: -- `starmap` has been changed to `*map` - + - `starmap` has been changed to `*map` - `combinations_with_replacement` has been changed to `multicombinations` - `groupby` has been changed to`group-by` - `takewhile` has been changed to `take-while` + + - `dropwhile` has been changed to `drop-while` + + - `filterfalse` has been changed to `remove` Please refer to the `Python documentation `_ for more information. From c8171bc0c5646eb58dd5ab1aada2a72fd1ab1803 Mon Sep 17 00:00:00 2001 From: Kodi Arfer Date: Wed, 4 Jan 2017 15:11:54 -0800 Subject: [PATCH 3/3] Itertools docs edits --- docs/language/core.rst | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/docs/language/core.rst b/docs/language/core.rst index f14785c..a8952d8 100644 --- a/docs/language/core.rst +++ b/docs/language/core.rst @@ -26,8 +26,7 @@ Returns an iterator of all but the last item in *coll*. => (list (butlast [])) [] - => (import itertools) - => (list (take 5 (butlast (itertools.count 10)))) + => (list (take 5 (butlast (count 10)))) [10, 11, 12, 13, 14] @@ -994,8 +993,7 @@ Returns an iterator of all but the last *n* items in *coll*. Raises => (list (drop-last 100 (range 100))) [] - => (import itertools) - => (list (take 5 (drop-last 100 (itertools.count 10)))) + => (list (take 5 (drop-last 100 (count 10)))) [10, 11, 12, 13, 14] @@ -1288,20 +1286,17 @@ Included itertools count cycle repeat accumulate chain compress drop-while remove group-by islice *map take-while tee zip-longest product permutations combinations multicombinations --------- -All of Python's itertools are available, however some of the names have been -changed: +All of Python's `itertools `_ +are available. Some of their names have been changed: - - `starmap` has been changed to `*map` + - ``starmap`` has been changed to ``*map`` - - `combinations_with_replacement` has been changed to `multicombinations` + - ``combinations_with_replacement`` has been changed to ``multicombinations`` - - `groupby` has been changed to`group-by` + - ``groupby`` has been changed to ``group-by`` - - `takewhile` has been changed to `take-while` + - ``takewhile`` has been changed to ``take-while`` - - `dropwhile` has been changed to `drop-while` + - ``dropwhile`` has been changed to ``drop-while`` - - `filterfalse` has been changed to `remove` - - Please refer to the `Python documentation - `_ for more information. + - ``filterfalse`` has been changed to ``remove``