Re: [noob question] References and copying

2006-07-04 Thread Petr Prikryl
"zefciu" wrote in message news:[EMAIL PROTECTED] > Where can I find a good explanation when does an interpreter copy the > value, and when does it create the reference. I thought I understand > it, but I have just typed in following commands: > > >>> a=[[1,2],[3,4]] > >>> b=a[1] > >>> b=[5,6] > >>

Re: [noob question] References and copying

2006-06-09 Thread bruno at modulix
zefciu wrote: > Hello! > > Where can I find a good explanation when does an interpreter copy the > value, and when does it create the reference. Unless you explicitely ask for a copy (either using the copy module or a specific function or method), you'll get a reference. > I thought I understan

Re: [noob question] References and copying

2006-06-09 Thread Steve Holden
zefciu wrote: > Hello! > > Where can I find a good explanation when does an interpreter copy the > value, and when does it create the reference. I thought I understand > it, but I have just typed in following commands: > > a=[[1,2],[3,4]] b=a[1] b=[5,6] a > > [[1, 2], [3, 4]] >

Re: [noob question] References and copying

2006-06-09 Thread Boris Borcic
zefciu wrote: > Hello! > > Where can I find a good explanation when does an interpreter copy the > value, and when does it create the reference. I thought I understand > it, but I have just typed in following commands: > a=[[1,2],[3,4]] b=a[1] b=[5,6] a > [[1, 2], [3, 4]] >>>

[noob question] References and copying

2006-06-09 Thread zefciu
Hello! Where can I find a good explanation when does an interpreter copy the value, and when does it create the reference. I thought I understand it, but I have just typed in following commands: >>> a=[[1,2],[3,4]] >>> b=a[1] >>> b=[5,6] >>> a [[1, 2], [3, 4]] >>> b [5, 6] And I don't understan