[C++-sig] Python Assignment
Jey Kottalam
jeyk at cox.net
Fri Aug 16 23:53:36 CEST 2002
I believe this is off-topic here, but...
import copy
a = MyMatrix
b = copy.deepcopy(a) # I think this is correct
Can someone confirm this?
-Jey Kottalam
>
> From: Enrico Ng <enrico at fnal.gov>
> Date: 2002/08/16 Fri PM 02:55:02 EDT
> To: c++-sig at python.org
> Subject: [C++-sig] Python Assignment
>
> I would like the beable to tell python when to make a copy and when not
> to.
>
> In python, if I do:
>
> a=MyMatrix
> b=a
>
> changes in b will affect a and vice versa because b points to a.
> I would like to tell python to make a copy if I try to change b so a is
> not affected.
> Same if I try to change a.
>
> Is there a way to do this?
>
>
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>
More information about the Cplusplus-sig
mailing list