bz2.readline() slow ?

2006-11-24 Thread Soeren Sonnenburg
Dear all, I am a bit puzzled, as -snip- import bz2 f=bz2.BZ2File('data/data.bz2'); while f.readline(): pass -snip- takes twice the time (10 seconds) to read/decode a bz2 file compared to -snip- import bz2 f=bz2.BZ2File('data/data.bz2'); x=f.readlines() -snip

Thanks (was Re: consistency: extending arrays vs. multiplication ?)

2005-07-25 Thread Soeren Sonnenburg
Thanks a lot for all the answers!! Soeren -- http://mail.python.org/mailman/listinfo/python-list

Re: consistency: extending arrays vs. multiplication ?

2005-07-25 Thread Soeren Sonnenburg
On Sun, 2005-07-24 at 11:50 -0700, Robert Kern wrote: > Soeren Sonnenburg wrote: > > On Sun, 2005-07-24 at 13:36 +1000, Steven D'Aprano wrote: > > > >>On Sat, 23 Jul 2005 18:30:02 +0200, Soeren Sonnenburg wrote: [...] > >>Lists in Python can con

Re: consistency: extending arrays vs. multiplication ?

2005-07-24 Thread Soeren Sonnenburg
On Sat, 2005-07-23 at 12:15 -0700, Robert Kern wrote: > Soeren Sonnenburg wrote: > > Hi all, > > > > Just having started with python, I feel that simple array operations '*' > > and '+' don't do multiplication/addition but instead extend/join

Re: consistency: extending arrays vs. multiplication ?

2005-07-24 Thread Soeren Sonnenburg
On Sat, 2005-07-23 at 20:25 -0700, Dan Bishop wrote: > Soeren Sonnenburg wrote: > > Hi all, > > > > Just having started with python, I feel that simple array operations '*' > > and '+' don't do multiplication/addition but instead extend/j

Re: consistency: extending arrays vs. multiplication ?

2005-07-24 Thread Soeren Sonnenburg
On Sun, 2005-07-24 at 13:36 +1000, Steven D'Aprano wrote: > On Sat, 23 Jul 2005 18:30:02 +0200, Soeren Sonnenburg wrote: > > > Hi all, > > > > Just having started with python, I feel that simple array operations '*' > > and '+' don&

Re: consistency: extending arrays vs. multiplication ?

2005-07-24 Thread Soeren Sonnenburg
On Sat, 2005-07-23 at 23:35 +0200, Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Soeren > Sonnenburg wrote: > > > Just having started with python, I feel that simple array operations '*' > > and '+' don't do multiplica

consistency: extending arrays vs. multiplication ?

2005-07-23 Thread Soeren Sonnenburg
Hi all, Just having started with python, I feel that simple array operations '*' and '+' don't do multiplication/addition but instead extend/join an array: a=[1,2,3] >>> b=[4,5,6] >>> a+b [1, 2, 3, 4, 5, 6] instead of what I would have expected: [5,7,9] or >>> 2*a [1, 2, 3, 1, 2, 3] Well it i