[Python-ideas] About adding a new iteratormethodcalled "shuffled"

Jacob Holm jh at improva.dk
Thu Mar 26 19:18:46 CET 2009


Oleg Broytmann wrote:
> On Thu, Mar 26, 2009 at 11:43:35AM -0600, Adam Olsen wrote:
>   
>> Is it or is it not broken?  That's all I want to know.  "maybe" isn't
>> good enough.  "Not broken for small lists" implies it IS broken for
>> large lists.
>>     
>
>    Practicality beats purity, IMHO. If shuffle cannot process a list
> I cannot even fit into virtual memory - I don't care, really.
>
> Oleg.
>   
A list of 2081 items certainly fits into the memory of my machine.  
There is a very clear sense in which it is broken for lists > 2080 
items.  It *may* be broken in other ways and for certain use cases for 
shorter lists, I don't know enough about the properties of the the PRNG 
to say anything about that.  I *think* someone mentioned that it was 
equidistributed in 623 dimensions and that this should mean it is as 
good as possible for any PRNG for any list up to 623 items.  If this is 
true, it would be nice to have a note about it in the docs.

Documented limitations are always better than undocumented ones. 
(Explicit is better than implicit...)

- Jacob



More information about the Python-ideas mailing list