Re: Inconsistent reaction to extend

2005-09-12 Thread Bruno Desthuilliers
Jerzy Karczmarczuk a écrit : > Gurus, No guru answered, so you'll have to bear with me... > before I am tempted to signal this as a bug, perhaps > you might convince me that it should be so. If I type > > l=range(4) > l.extend([1,2]) > > l gives [0,1,2,3,1,2], what else... > > On the other h

Re: Inconsistent reaction to extend

2005-09-09 Thread Terry Hancock
On Friday 09 September 2005 08:29 am, Steve Holden wrote: > Yes it is :) That's not an argument! That's just a contradiction. I'm not payin' for this! -- Terry Hancock ( hancock at anansispaceworks.com ) Anansi Spaceworks http://www.anansispaceworks.com -- http://mail.python.org/mailman/list

Re: Inconsistent reaction to extend

2005-09-09 Thread Steve Holden
Fredrik Lundh wrote: > Jerzy Karczmarczuk wrote: > > >>Gurus, before I am tempted to signal this as a bug, perhaps >>you might convince me that it should be so. > > > it's not a bug, and nobody should have to convince you about any- > thing; despite what you may think from reading certain slici

Re: Inconsistent reaction to extend

2005-09-09 Thread Antoon Pardon
Op 2005-09-09, Christophe schreef <[EMAIL PROTECTED]>: > Antoon Pardon a écrit : >>>Because creating a new list is potentially very time-consuming and >>>expensive of memory. Imagine you have a list of 100,000 large objects, and >>>you want to add one more object to it. The way Python works is that

Re: Inconsistent reaction to extend

2005-09-09 Thread Christophe
Antoon Pardon a écrit : >>Because creating a new list is potentially very time-consuming and >>expensive of memory. Imagine you have a list of 100,000 large objects, and >>you want to add one more object to it. The way Python works is that append >>and extend simply add that new object to the end o

Re: Inconsistent reaction to extend

2005-09-09 Thread Antoon Pardon
Op 2005-09-09, Steven D'Aprano schreef <[EMAIL PROTECTED]>: > On Fri, 09 Sep 2005 11:47:41 +0200, Jerzy Karczmarczuk wrote: > >> Gurus, before I am tempted to signal this as a bug, perhaps >> you might convince me that it should be so. If I type >> >> l=range(4) >> l.extend([1,2]) >> >> l gives

Re: Inconsistent reaction to extend

2005-09-09 Thread Steven D'Aprano
On Fri, 09 Sep 2005 11:47:41 +0200, Jerzy Karczmarczuk wrote: > Gurus, before I am tempted to signal this as a bug, perhaps > you might convince me that it should be so. If I type > > l=range(4) > l.extend([1,2]) > > l gives [0,1,2,3,1,2], what else... That is correct. range() returns a list.

Re: Inconsistent reaction to extend

2005-09-09 Thread Robert Kern
Jerzy Karczmarczuk wrote: > Gurus, before I am tempted to signal this as a bug, perhaps > you might convince me that it should be so. If I type > > l=range(4) > l.extend([1,2]) > > l gives [0,1,2,3,1,2], what else... > > On the other hand, try > > p=range(4).extend([1,2]) > > Then, p HAS NO V

Re: Inconsistent reaction to extend

2005-09-09 Thread Fredrik Lundh
Jerzy Karczmarczuk wrote: > Gurus, before I am tempted to signal this as a bug, perhaps > you might convince me that it should be so. it's not a bug, and nobody should have to convince you about any- thing; despite what you may think from reading certain slicing threads, this mailing list is not

Re: Inconsistent reaction to extend

2005-09-09 Thread Timo
Jerzy Karczmarczuk kirjoitti: > On the other hand, try > > p=range(4).extend([1,2]) > > Then, p HAS NO VALUE (NoneType). > > With append the behaviour is similar. I didn't try other methods, but > I suspect that it won't improve. > > > WHY? range(4) returns a list and Python's list.extend() retu

Inconsistent reaction to extend

2005-09-09 Thread Jerzy Karczmarczuk
Gurus, before I am tempted to signal this as a bug, perhaps you might convince me that it should be so. If I type l=range(4) l.extend([1,2]) l gives [0,1,2,3,1,2], what else... On the other hand, try p=range(4).extend([1,2]) Then, p HAS NO VALUE (NoneType). With append the behaviour is simil