On Fri, Sep 9, 2016 at 9:36 AM, Xavier Combelle firstname.lastname@example.org wrote:
and eventually this one work in all case of iterable
def shuffled3(iterable): result = list(iterable) random.shuffle(result) return result
This is the one obvious way to do this. Not all iterables can logically be shuffled, so the most normal approach would be to turn it into a list, then shuffle. Which is exactly what this does.