Re: behavior varied between empty string '' and empty list []

2008-03-24 Thread Gabriel Genellina
En Mon, 24 Mar 2008 15:22:43 -0300, Tzury Bar Yochay <[EMAIL PROTECTED]> escribió: > while I can invoke methods of empty string '' right in typing > (''.join(), etc.) I can't do the same with empty list > > example: > a = [1,2,3] b = [].extend(a) b b = [] b.extend(a) >>>

behavior varied between empty string '' and empty list []

2008-03-24 Thread Tzury Bar Yochay
while I can invoke methods of empty string '' right in typing (''.join(), etc.) I can't do the same with empty list example: >>> a = [1,2,3] >>> b = [].extend(a) >>> b >>> b = [] >>> b.extend(a) >>> b [1,2,3] I would not use b = a since I don't want changes on 'b' to apply on 'a' do you think t