Re: [Python-Dev] About adding a new iterator method called "shuffled"

2009-03-24 Thread Aahz
On Tue, Mar 24, 2009, Roy Hyunjin Han wrote: > > I know that Python has iterator methods called "sorted" and "reversed" and > these are handy shortcuts. > > Why not add a new iterator method called "shuffled"? Please do not post ideas like this to python-dev, please use python-ideas -- Aahz (a..

[Python-Dev] About adding a new iterator method called "shuffled"

2009-03-24 Thread Roy Hyunjin Han
I know that Python has iterator methods called "sorted" and "reversed" and these are handy shortcuts. Why not add a new iterator method called "shuffled"? >>> for x in shuffled(range(5)): >>>print x >>> 3 >>> 1 >>> 2 >>> 0 >>> 4 Currently, a person has to do the following because random.sh