What is equivalent of *this = that in python?

Emin.shopper Martinian.shopper emin.shopper at gmail.com
Fri Jun 1 11:53:29 EDT 2007


I have a distributed application using xmlrpc and I'd like for a local
object to sync itself to match a remote version of the object. I realize
that I can copy all the attributes from the remote object to the local
object, but that seems like an ugly solution. There must be a better way...

Thanks,
-Emin

On 6/1/07, Carsten Haese <carsten at uniqsys.com> wrote:
>
> On Fri, 2007-06-01 at 11:30 -0400, Emin.shopper Martinian.shopper wrote:
> > Dear Experts,
> >
> > How do I reassign self to another object? For example, I want
> > something like
> >
> > class foo:
> >     def Update(self,other):
> >         # make this object the same as other or make this object a
> > copy of other
> >         self = other # This won't work. What I really want is *this =
> > other in C++ terminology.
>
> There is no such thing in Python. What's the actual problem you're
> trying to solve?
>
> --
> Carsten Haese
> http://informixdb.sourceforge.net
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070601/79666d3a/attachment.html>


More information about the Python-list mailing list