Jerzy Karczmarczuk wrote: > Peter Otten wrote: >> [EMAIL PROTECTED] wrote: >> >> >>>Just to satisfy my curiousity: Is there a way to do something like the >>>reference solution I suggest above? >> >> >> No. You cannot overload assignment. > > I have the impression that this is not an issue, to overload assignments, > which btw. *can* be overloaded, but the absence of *aliasing* > (undiscriminate handling of pointers) in Python. Am I wrong?
I think so. a = b will always make a a reference to (the same object as) b. What can be overloaded is attribute assignment: x.a = b can do anything from creating an attribute that references b to wiping your hard disk. I don't understand what you mean by "absence of aliasing", but conceptually every python variable is a -- well-behaved -- pointer. Peter -- http://mail.python.org/mailman/listinfo/python-list