[Python-ideas] Shuffled

Steven D'Aprano steve at pearwood.info
Mon Sep 5 21:03:10 EDT 2016


On Tue, Sep 06, 2016 at 02:50:02AM +0200, Arek Bulski wrote:

> We should add shuffled() analog to sorted. Also shuffle() should return
> self so mutating methods could be chained.

from random import shuffle
shuffle(mylist)

Why is that so important that it needs to be a built-in? In 15+ years of 
using Python, I've probably used shuffle() three or four times.



-- 
Steve


More information about the Python-ideas mailing list