diff options
Diffstat (limited to 'wqflask/utility/chunks.py')
-rw-r--r-- | wqflask/utility/chunks.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wqflask/utility/chunks.py b/wqflask/utility/chunks.py index 9565fb96..b0e33c08 100644 --- a/wqflask/utility/chunks.py +++ b/wqflask/utility/chunks.py @@ -6,21 +6,21 @@ import time def divide_into_chunks(the_list, number_chunks): """Divides a list into approximately number_chunks smaller lists - + >>> divide_into_chunks([1, 2, 7, 3, 22, 8, 5, 22, 333], 3) [[1, 2, 7], [3, 22, 8], [5, 22, 333]] - >>> divide_into_chunks([1, 2, 7, 3, 22, 8, 5, 22, 333], 4) + >>> divide_into_chunks([1, 2, 7, 3, 22, 8, 5, 22, 333], 4) [[1, 2, 7], [3, 22, 8], [5, 22, 333]] - >>> divide_into_chunks([1, 2, 7, 3, 22, 8, 5, 22, 333], 5) + >>> divide_into_chunks([1, 2, 7, 3, 22, 8, 5, 22, 333], 5) [[1, 2], [7, 3], [22, 8], [5, 22], [333]] >>> - + """ length = len(the_list) if length == 0: return [[]] - + if length <= number_chunks: number_chunks = length |