Bruno Desthuilliers wrote: > Steven D'Aprano wrote: >> On Sat, 07 Oct 2006 17:21:55 -0500, Tim Chase wrote: >> >>>>> With the caveat of the "=" mentioned in the subject-line (being >>>>> different from "==")...I haven't found any way to override >>>>> assignment in the general case. >>>> Why would you want to do that? >>> For the same reason one would use property() to create >>> getter/setter functions for a particular variable--to intercept >>> attempts to set a variable. >> > (snip) > >> Suppose we bind the name "x" to the object 1, and then rebind the name "x" >> to the object []. Which object's hypothetical __assign__ method should get >> called? > > The current namespace object, of course.
Which is? Georg -- http://mail.python.org/mailman/listinfo/python-list