[Python-ideas] Assignment decorators (Re: The Descriptor Protocol...)

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Mar 4 01:39:52 CET 2011


Guido van Rossum wrote:

> Eek! All other uses of 'as' in Python have the target on the right.

Well, it doesn't necessarily have to be 'as'. It could be

   def Fred = namedtuple('x y z')

but that wouldn't give as much of a clue that something
special is happening in the middle.

Is the reversal really all that much of a problem? It makes
sense when you read it as an English sentence: "Define
Fred as a named tuple." Just like all the other uses of
"as" mean what they seem to mean.

Given that each existing use of 'as' has its own unique
quirks, forcing 'as' to always bind on the right regardless
of anything else might be seen as a foolish consistency.

-- 
Greg



More information about the Python-ideas mailing list