Le jeudi 05 mai 2011 à 18:54 -0400, Alexander Belopolsky a écrit : > On Thu, May 5, 2011 at 6:32 PM, M.-A. Lemburg <m...@egenix.com> wrote: > .. > >> Either way, the code is simpler by just using the default. > > > > ... as long as the casual reader knows what the default it :-) > > > > .. or cares. I this particular case, it hardly matters how random > bits are encoded.
You don't get the same random number sequence if you use a different encoding. >>> r=random.Random() >>> r.seed('\xe9'.encode('iso-8859-1')); r.randint(0, 1000) 639 >>> r.seed('\xe9'.encode('utf-8')); r.randint(0, 1000) 992 So it is useful to know how the seed was computed. The real question is which encoding gives the most random numbers? :-) Victor _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com