Unsorting(randomizing) a sequence
Jeremy Hylton
jeremy at cnri.reston.va.us
Wed Aug 18 13:12:58 EDT 1999
>>>>> "SM" == Skip Montanaro <skip at mojam.com> writes:
Stephan> Furthermore, Skip used he module whrandom, whereas I used
Stephan> random. Any ideas in which respect these modules differ?
SM> Well, if you look at random.randrange, you'll find it
SM> exceedingly similar to whrandom.randrange:
>>>> import whrandom, random random.randrange
SM> <method whrandom.randrange of whrandom instance at 814a370>
>>>> whrandom.randrange
SM> <method whrandom.randrange of whrandom instance at 814a370>
The intended use of the standard library here is for users to import
random to get access to whrandom. whrandom implements a specific
method for generating random numbers. It could easily be replaced
with a different, improved module at some time in the future. If user
code imports random, it will automatically get the benefit of the new
implementation.
Jeremy
More information about the Python-list
mailing list