Re: how to format a python source file with tools?

2009-11-30 Thread gil_johnson
On Nov 27, 9:58 am, "Diez B. Roggisch" wrote: [...] > > so i would like to have a tool to intelligently format the code for me > > and make the code more beautiful > > and automated. > > This is not possible. Consider the following situation: > [...] > Both are semantically radically different,

Re: Most efficient way to "pre-grow" a list?

2009-11-08 Thread gil_johnson
On Nov 6, 8:46 pm, gil_johnson wrote: > >>> arr[0] = initializer > >>> for i in range N: > >>>      arr.extend(arr) > > This doubles the array every time through the loop, and you can add > the powers of 2 to get the desired result. > Gil To al

Re: Most efficient way to "pre-grow" a list?

2009-11-08 Thread gil_johnson
On Nov 6, 8:46 pm, gil_johnson wrote: > I don't have the code with me, but for huge arrays, I have used > something like: > > >>> arr[0] = initializer > >>> for i in range N: > >>>      arr.extend(arr) > > This doubles the array every tim

Re: Most efficient way to "pre-grow" a list?

2009-11-10 Thread gil_johnson
On Nov 9, 10:56 pm, "Gabriel Genellina" wrote: > > [much cutting] > > def method3a(): >    newArray = array.array('I', [INITIAL_VALUE]) * SIZE >    assert len(newArray)==SIZE >    assert newArray[SIZE-1]==INITIAL_VALUE > > [more cutting] > > So arrays are faster than lists, and in both cases one_it

Re: A "terminators' club" for clp

2009-11-14 Thread gil_johnson
On Nov 13, 5:29 pm, kj wrote: [...] > Or it could be set up so that at least n > 1 "delete" votes and no > "keep" votes are required to get something nixed.  Etc. > > This seems simpler than all-out moderation. > > ("all-out moderation"? now, there's an oxymoron for ya!) > How about using a "rank

Re: A "terminators' club" for clp

2009-11-16 Thread gil_johnson
On Nov 14, 12:08 pm, r wrote: > On Nov 14, 7:28 am, gil_johnson wrote: > Actually there is a "rank this post" (gotta be careful with that > verbage!) AND a "report this post as spam". Of course it only exists > in GG's and not Usenet. I *do* know that the s