Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Fri, 21 Oct 2005 13:33:18 -0400, Mike Meyer wrote: > >> Paul Dale <[EMAIL PROTECTED]> writes: >> >>> Hi everyone, >>> >>> Is it possible to bind a list member or variable to a variable such that >>> >>> temp = 5 >>> >>> list = [ temp ] > > Don't use the names of built-in functions as variables. > >>> temp == 6 >>> >>> list >>> >>> would show >>> >>> list = [ 6 ] >> >> No. You need to either put a mutable in the list, or subclass list so >> that indexing gets the value, looks it up in the appropriate >> namespace, and returns that value. > > Or something even conceptually simpler than having to muck about with > looking up different namespaces: [elided]
Um, that's the *first* solution I proposed: putting a mutable on the list. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list