is it a bug in Module copy or i am wrong??

2008-11-07 Thread yoma
python version 2.5 in module copy we all know that copy have two method: copy() and deepcopy(). and the explain is - A shallow copy constructs a new compound object and then (to the extent possible) inserts *the same objects* into it that the original contains. - A deep copy constructs a new

Re: is it a bug in Module copy or i am wrong??

2008-11-07 Thread Chris Rebert
On Thu, Nov 6, 2008 at 11:59 PM, yoma [EMAIL PROTECTED] wrote: python version 2.5 in module copy we all know that copy have two method: copy() and deepcopy(). and the explain is - A shallow copy constructs a new compound object and then (to the extent possible) inserts *the same objects*

Re: is it a bug in Module copy or i am wrong??

2008-11-07 Thread Marc 'BlackJack' Rintsch
On Thu, 06 Nov 2008 23:59:51 -0800, yoma wrote: import copy class A: i = 1 class B: a = A() b = B() x=copy.copy(b) y=copy.deepcopy(b) print id(x.a), id(b.a) print id(y.a), id(y.a) the result: 14505264 14505264 14505264 14505264 So maybe i have a wrong

Re: is it a bug in Module copy or i am wrong??

2008-11-07 Thread Terry Reedy
yoma wrote: python version 2.5 in module copy we all know that copy have two method: copy() and deepcopy(). and the explain is - A shallow copy constructs a new compound object and then (to the extent possible) inserts *the same objects* into it that the original contains. - A deep copy