On Wed, Jun 01, 2016 at 11:24:35AM -0400, marky1991 . wrote:
What is the value of __assigned_name__ here:
x = y = z = AutoSymbol()
? Is it a list?
With my proposal, that would be a syntax error. However this would be allowed: x, y, z -> Symbol() # there's nothing "auto" about it and Symbol would receive a single argument, a tuple ('x', 'y', 'z'). Presumably then it could: * raise an exception, to indicate that it doesn't support creating three symbols at once; * return three different symbols, one for each of the names; * return a single symbol duplicated three times whatever makes sense for the application. But the important thing is, this would be *exactly* the same as: x, y, z = Symbol(('x', 'y', 'z')) The only magic is that you don't have to manually copy the names from the left hand side over onto the right and quote them. All Symbol knows is that it got passed a three-tuple as argument. It cannot know how it got there. -- Steve