Op 2005-03-18, Bengt Richter schreef <[EMAIL PROTECTED]>: > [ ... ] > > BTW, I would like a re-assign or find-and-rebind operation spelled ":=" which > would > make x := 123 mean look for x as if to read its value in a right hand side > expression, > (except do not look into __builtins__) and wherever found, rebind to 123 -- > and if not found, > raise an exception. > > I think var := 'something' would be a useful substitute for the idiom of > var[0] = 'something' and be unambiguous. > > ":=" as an operator could combine like <op>= if desired, so we could write > var +:= some.long.expression[that].you('do')**not.want.to.type.twice > instead of > _ = some.long.expression[that].you('do')**not.want.to.type.twice > var +:= _ # meaning var := var + _ > or such.
Well you have my support for this. But I have the impression this differs from the previous time you came up with a similar idea. If IRC your previous proposal limited the search to the local scope, making a := b equivallent to something like a; a = b. I must say I like your current idea better. -- Antoon Pardon -- http://mail.python.org/mailman/listinfo/python-list