<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18372">
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><BR><FONT size=2 face=Arial>> Note that using sorting to shuffle is
likely very inefficient.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Who cares? The OP's goal was to save a few
programmer</FONT></DIV>
<DIV><FONT size=2 face=Arial>clock cycles so he could in-line what we already
get from</FONT></DIV>
<DIV><FONT size=2 face=Arial>random.shuffle(). His request is use case
challenged</FONT></DIV>
<DIV><FONT size=2 face=Arial>(very few programs would benefit and those would
only</FONT></DIV>
<DIV><FONT size=2 face=Arial>save a line or two). If he actually cares
about O(n) time</FONT></DIV>
<DIV><FONT size=2 face=Arial>then it's trivial to write:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> s = list(iterable)</FONT></DIV>
<DIV><FONT size=2 face=Arial> random.shuffle(s)</FONT></DIV>
<DIV><FONT size=2 face=Arial> for elem in s:</FONT></DIV>
<DIV><FONT size=2 face=Arial> .
. .</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>But if he want's to mush it on one-line, I gave a
workable</FONT></DIV>
<DIV><FONT size=2 face=Arial>alternative.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Raymond</DIV>
<DIV><BR></DIV></FONT></BODY></HTML>