7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
10 # FOR A PARTICULAR PURPOSE. |
10 # FOR A PARTICULAR PURPOSE. |
11 # |
11 # |
|
12 |
|
13 """PyAMS_utils list module |
|
14 |
|
15 This module is dedicated to lists and iterators management. It provides function to extract |
|
16 unique values from a list or iterator in their original order, or to iterate over an iterator in |
|
17 random order; it also provides a "boolean_iter" function (usable as TALES extension) to check if |
|
18 an iterator returns at least one value, without consuming this iterator (the function returns a |
|
19 tuple containing a boolean value to specify if iterator is empty or not, and the original |
|
20 iterator). |
|
21 """ |
12 |
22 |
13 __docformat__ = 'restructuredtext' |
23 __docformat__ = 'restructuredtext' |
14 |
24 |
15 from itertools import filterfalse, tee |
25 from itertools import filterfalse, tee |
16 from random import random, shuffle |
26 from random import random, shuffle |