Le jeudi 05 mai 2011 à 18:54 -0400, Alexander Belopolsky a écrit : > On Thu, May 5, 2011 at 6:32 PM, M.-A. Lemburg <mal at 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4